Warming, cooling synced with display.

This commit is contained in:
Heath Volmer
2017-08-23 15:43:30 -06:00
parent 19f3b10f90
commit 2c8259e350
10 changed files with 26 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
@@ -97,7 +98,7 @@ namespace PepperDash.Essentials.Core
{
TriList = triList;
// Attach actions to buttons
triList.SetSigFalseAction(Button1Join, () => OnModalComplete(1));
triList.SetSigFalseAction(Button1Join, () => OnModalComplete(1));
triList.SetSigFalseAction(Button2Join, () => OnModalComplete(2));
triList.SetSigFalseAction(CancelButtonJoin, () => { if (CanCancel) CancelDialog(); });
CanCancel = true;

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.CrestronThread;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using PepperDash.Essentials.Core;
@@ -233,11 +234,16 @@ namespace PepperDash.Essentials.Devices.Displays
Debug.Console(2, this, "NEW POWER STATE={0}, CURRENT={1}", newVal, _PowerIsOn);
if (newVal != _PowerIsOn)
{
_PowerIsOn = newVal;
CrestronEnvironment.Sleep(1500);
Debug.Console(2, this, "NEW POWER STATE AFTER PAUSE={0} CURRENT={1}", newVal, _PowerIsOn);
if (newVal != _PowerIsOn)
PowerIsOnFeedback.FireUpdate();
CrestronInvoke.BeginInvoke(o =>
{
CrestronEnvironment.Sleep(1500);
Debug.Console(2, this, "NEW POWER STATE AFTER PAUSE={0} CURRENT={1}", newVal, _PowerIsOn);
if (newVal != _PowerIsOn)
{
_PowerIsOn = newVal;
PowerIsOnFeedback.FireUpdate();
}
});
}
}

View File

@@ -22,10 +22,10 @@ namespace PepperDash.Essentials
{
var disp = DefaultDisplay as DisplayBase;
var val = CurrentSourceInfo != null
&& CurrentSourceInfo.Type == eSourceListItemType.Route
&& disp != null
&& disp.PowerIsOnFeedback.BoolValue;
Debug.Console(2, this, "************** ROOM POWER {0}", val);
&& CurrentSourceInfo.Type == eSourceListItemType.Route
&& disp != null
&& disp.PowerIsOnFeedback.BoolValue;
Debug.Console(2, this, "Display power={0}, has CurrentSource={1}", disp.PowerIsOnFeedback, CurrentSourceInfo != null);
return val;
};
}
@@ -58,14 +58,9 @@ namespace PepperDash.Essentials
{
var disp = DefaultDisplay as DisplayBase;
if (disp != null)
{
Debug.Console(2, this, "IS COOLING FUNC-- Display cooling={0}", disp.IsCoolingDownFeedback.BoolValue);
return disp.IsCoolingDownFeedback.BoolValue;
}
else
{
return false;
}
};
}
}

View File

@@ -60,7 +60,7 @@ namespace PepperDash.Essentials
set
{
_DefaultRoomKey = value;
CurrentRoom = DeviceManager.GetDeviceForKey(value) as EssentialsHuddleSpaceRoom;
//CurrentRoom = DeviceManager.GetDeviceForKey(value) as EssentialsHuddleSpaceRoom;
}
}
string _DefaultRoomKey;
@@ -523,7 +523,6 @@ namespace PepperDash.Essentials
/// <param name="e"></param>
void ShutdownPromptTimer_HasFinished(object sender, EventArgs e)
{
Debug.Console(2, "UI shutdown prompt finished");
EndMeetingButtonSig.BoolValue = false;
}
@@ -638,6 +637,7 @@ namespace PepperDash.Essentials
_CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange;
_CurrentRoom.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange;
}
_CurrentRoom = room;
if (_CurrentRoom != null)
@@ -679,7 +679,9 @@ namespace PepperDash.Essentials
_CurrentRoom.ShutdownPromptTimer.WasCancelled += ShutdownPromptTimer_WasCancelled;
// Link up all the change events from the room
Debug.Console(2, "UI -- Room is already on={0} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%", _CurrentRoom.OnFeedback.BoolValue);
_CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange;
CurrentRoom_SyncOnFeedback();
_CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingFeedback_OutputChange;
_CurrentRoom.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange;
@@ -699,6 +701,11 @@ namespace PepperDash.Essentials
/// For room on/off changes
/// </summary>
void CurrentRoom_OnFeedback_OutputChange(object sender, EventArgs e)
{
CurrentRoom_SyncOnFeedback();
}
void CurrentRoom_SyncOnFeedback()
{
var value = _CurrentRoom.OnFeedback.BoolValue;
Debug.Console(2, CurrentRoom, "UI: Is on event={0}", value);