Merge pull request #7 in PEC/essentials from feature/ecs-747 to development

* commit 'e0bfb8f0915de0597a05bc658bf9b9a235566b38':
  Fixed issue preventing lighting scene feedback from updating correctly.
  Bug fix for LutronQuantumArea class that caused crash when debug level was set to 2 and data was received from device.  Updates EssentialsEnvironmentDriver to only include environment devices in UI container columns if a matching UI driver can be constructed (ignores DIN8SW8)
This commit is contained in:
Heath Volmer
2018-06-26 14:51:18 -04:00
8 changed files with 39 additions and 32 deletions

View File

@@ -26,6 +26,8 @@ namespace PepperDash.Essentials.Core.Lighting
: base(key, name) : base(key, name)
{ {
LightingScenes = new List<LightingScene>(); LightingScenes = new List<LightingScene>();
CurrentLightingScene = new LightingScene();
} }
public abstract void SelectScene(LightingScene scene); public abstract void SelectScene(LightingScene scene);

View File

@@ -17,9 +17,9 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
CTimer SubscribeAfterLogin; CTimer SubscribeAfterLogin;
public int IntegrationId; string IntegrationId;
public string Username; string Username;
public string Password; string Password;
const string Delimiter = "\x0d\x0a"; const string Delimiter = "\x0d\x0a";
const string Set = "#"; const string Set = "#";
@@ -32,8 +32,8 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
IntegrationId = props.IntegrationId; IntegrationId = props.IntegrationId;
Username = props.Username; Username = props.Control.TcpSshProperties.Username;
Password = props.Password; Password = props.Control.TcpSshProperties.Password;
LightingScenes = props.Scenes; LightingScenes = props.Scenes;
@@ -89,7 +89,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// <param name="args"></param> /// <param name="args"></param>
void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args)
{ {
Debug.Console(2, this, "Text Received: '{0}'"); Debug.Console(2, this, "Text Received: '{0}'", args.Text);
if (args.Text.Contains("login:")) if (args.Text.Contains("login:"))
{ {
@@ -120,7 +120,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// <param name="args"></param> /// <param name="args"></param>
void PortGather_LineReceived(object sender, GenericCommMethodReceiveTextArgs args) void PortGather_LineReceived(object sender, GenericCommMethodReceiveTextArgs args)
{ {
Debug.Console(2, this, "Line Received: '{0}'"); Debug.Console(2, this, "Line Received: '{0}'", args.Text);
try try
{ {
@@ -128,7 +128,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
{ {
var response = args.Text.Split(','); var response = args.Text.Split(',');
var integrationId = Int32.Parse(response[1]); var integrationId = response[1];
if (integrationId != IntegrationId) if (integrationId != IntegrationId)
{ {
@@ -143,7 +143,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
{ {
case (int)eAction.Scene: case (int)eAction.Scene:
{ {
var scene = Int32.Parse(response[3]); var scene = response[3];
CurrentLightingScene = LightingScenes.FirstOrDefault(s => s.ID.Equals(scene)); CurrentLightingScene = LightingScenes.FirstOrDefault(s => s.ID.Equals(scene));
OnLightingSceneChange(); OnLightingSceneChange();
@@ -180,7 +180,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
public override void SelectScene(LightingScene scene) public override void SelectScene(LightingScene scene)
{ {
Debug.Console(1, this, "Selecting Scene: '{0}'", scene.Name); Debug.Console(1, this, "Selecting Scene: '{0}'", scene.Name);
SendLine(string.Format("{0}AREA,{1},{2},{3}", Set, IntegrationId, eAction.Scene, scene.ID)); SendLine(string.Format("{0}AREA,{1},{2},{3}", Set, IntegrationId, (int)eAction.Scene, scene.ID));
} }
/// <summary> /// <summary>
@@ -188,7 +188,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// </summary> /// </summary>
public void MasterRaise() public void MasterRaise()
{ {
SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, eAction.Raise)); SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, (int)eAction.Raise));
} }
/// <summary> /// <summary>
@@ -196,7 +196,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// </summary> /// </summary>
public void MasterLower() public void MasterLower()
{ {
SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, eAction.Lower)); SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, (int)eAction.Lower));
} }
/// <summary> /// <summary>
@@ -204,7 +204,7 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
/// </summary> /// </summary>
public void MasterRaiseLowerStop() public void MasterRaiseLowerStop()
{ {
SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, eAction.Stop)); SendLine(string.Format("{0}AREA,{1},{2}", Set, IntegrationId, (int)eAction.Stop));
} }
/// <summary> /// <summary>
@@ -239,10 +239,11 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Lutron
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public ControlPropertiesConfig Control { get; set; } public ControlPropertiesConfig Control { get; set; }
public int IntegrationId { get; set; } public string IntegrationId { get; set; }
public List<LightingScene> Scenes { get; set; } public List<LightingScene> Scenes { get; set; }
public string Username { get; set; } // Moved to use existing properties in Control object
public string Password { get; set; } //public string Username { get; set; }
//public string Password { get; set; }
} }
} }

View File

@@ -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 2017")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
[assembly: AssemblyVersion("1.3.0.*")] [assembly: AssemblyVersion("1.2.0.*")]

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ControlSystem> <ControlSystem>
<Name>Desk MC3</Name> <Name>Test RMC3</Name>
<Address>ssh 10.0.0.15</Address> <Address>auto 192.168.1.40</Address>
<ProgramSlot>Program01</ProgramSlot> <ProgramSlot>Program01</ProgramSlot>
<Storage>Internal Flash</Storage> <Storage>Internal Flash</Storage>
</ControlSystem> </ControlSystem>

View File

@@ -121,23 +121,28 @@ namespace PepperDash.Essentials
if (device != null) if (device != null)
{ {
Devices.Add(device);
// Build the driver // Build the driver
var devicePanelDriver = GetPanelDriverForDevice(device, column); var devicePanelDriver = GetPanelDriverForDevice(device, column);
// Add new PanelDriverBase SubDriver // Add new PanelDriverBase SubDriver
if (devicePanelDriver != null) if (devicePanelDriver != null)
{
Devices.Add(device);
DeviceSubDrivers.Add(devicePanelDriver); DeviceSubDrivers.Add(devicePanelDriver);
Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key); Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key);
column++; column++;
// Quit if device count is exceeded // Quit if device count is exceeded
if (column > 4) if (column > 4)
break; break;
} }
else
Debug.Console(1, "Unable to build environment driver for device: '{0}'", device.Key);
}
} }

View File

@@ -214,7 +214,6 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, avDriver.ShowActiveCallsList); TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, avDriver.ShowActiveCallsList);
// Set Call Status Subpage Position // Set Call Status Subpage Position
#warning may need to add a new position when environment icon is displayed
if (nextJoin == 3951) if (nextJoin == 3951)
{ {