Merge pull request #391 from PepperDash/hotfix/fix-joinedsiginterlock-nullref

Hotfix/fix joinedsiginterlock nullref
This commit is contained in:
Andrew Welker
2020-08-27 20:51:18 -04:00
committed by GitHub
2 changed files with 24 additions and 12 deletions

View File

@@ -349,7 +349,7 @@ namespace PepperDash.Essentials
// Check if the popup interlock is shown, and if one of the header popups is current, then show the carets subpage
if (e.IsShown)
{
if (e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
if (Parent.EnvironmentDriver != null && e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HeaderActiveCallsListVisible)
headerPopupShown = true;

View File

@@ -18,7 +18,7 @@ namespace PepperDash.Essentials
/// <summary>
/// The parent driver for this
/// </summary>
EssentialsPanelMainInterfaceDriver Parent;
private readonly EssentialsPanelMainInterfaceDriver _parent;
CTimer PositionTimer;
@@ -32,34 +32,46 @@ namespace PepperDash.Essentials
public ScreenSaverController(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
: base(parent.TriList)
{
Parent = parent;
_parent = parent;
PositionTimeoutMs = config.ScreenSaverMovePositionIntervalMs;
TriList.SetSigFalseAction(UIBoolJoin.MCScreenSaverClosePress, () => this.Hide());
PositionJoins = new List<uint>() { UIBoolJoin.MCScreenSaverPosition1Visible, UIBoolJoin.MCScreenSaverPosition2Visible, UIBoolJoin.MCScreenSaverPosition3Visible, UIBoolJoin.MCScreenSaverPosition4Visible };
var cmdName = String.Format("shwscrsvr-{0}", config.IpId);
CrestronConsole.AddNewConsoleCommand((o) => Show(), cmdName, "Shows Panel Screensaver", ConsoleAccessLevelEnum.AccessOperator);
TriList.SetSigFalseAction(UIBoolJoin.MCScreenSaverClosePress, Hide);
}
public override void Show()
{
TriList.SetBool(UIBoolJoin.MCScreenSaverVisible, true);
Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MCScreenSaverVisible);
//TriList.SetBool(UIBoolJoin.MCScreenSaverVisible, true);
_parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MCScreenSaverVisible);
CurrentPositionIndex = 0;
SetCurrentPosition();
StartPositionTimer();
base.Show();
}
public override void Hide()
{
if (PositionTimer != null)
{
PositionTimer.Stop();
PositionTimer.Dispose();
PositionTimer = null;
}
ClearAllPositions();
TriList.SetBool(UIBoolJoin.MCScreenSaverVisible, false);
Parent.AvDriver.PopupInterlock.HideAndClear();
//TriList.SetBool(UIBoolJoin.MCScreenSaverVisible, false);
_parent.AvDriver.PopupInterlock.HideAndClear();
base.Hide();
}
void StartPositionTimer()
{
if (PositionTimer == null)