diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo index 6d160f2d..21838c07 100644 Binary files a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo and b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo differ diff --git a/Essentials Core/PepperDashEssentialsBase/Touchpanels/ModalDialog.cs b/Essentials Core/PepperDashEssentialsBase/Touchpanels/ModalDialog.cs index c704fa13..bba8fe3e 100644 --- a/Essentials Core/PepperDashEssentialsBase/Touchpanels/ModalDialog.cs +++ b/Essentials Core/PepperDashEssentialsBase/Touchpanels/ModalDialog.cs @@ -77,7 +77,6 @@ namespace PepperDash.Essentials.Core BasicTriList TriList; Action ModalCompleteAction; - //CTimer Timer; static object CompleteActionLock = new object(); @@ -148,13 +147,21 @@ namespace PepperDash.Essentials.Core } /// - /// Hide dialog from elsewhere, fires no actions^ + /// Hide dialog from elsewhere, fires CompleteAction /// public void CancelDialog() { OnModalComplete(0); } + /// + /// Hides dialog. Fires no action + /// + public void HideDialog() + { + TriList.BooleanInput[ModalVisibleJoin].BoolValue = false; + } + // When the modal is cleared or times out, clean up the various bits void OnModalComplete(uint buttonNum) { @@ -162,10 +169,7 @@ namespace PepperDash.Essentials.Core var action = ModalCompleteAction; if (action != null) - { - //Debug.Console(2, "Modal complete action"); action(buttonNum); - } } } diff --git a/Essentials DM/Essentials_DM/Essentials_DM.projectinfo b/Essentials DM/Essentials_DM/Essentials_DM.projectinfo index cf9b842f..35050d8d 100644 Binary files a/Essentials DM/Essentials_DM/Essentials_DM.projectinfo and b/Essentials DM/Essentials_DM/Essentials_DM.projectinfo differ diff --git a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo index ec9dca11..8623114d 100644 Binary files a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo and b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo differ diff --git a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo index b6d90376..ecb02289 100644 Binary files a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo and b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo differ diff --git a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs index 093720df..2843f0b0 100644 --- a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs @@ -179,9 +179,6 @@ namespace PepperDash.Essentials /// public override void Show() { - if(CurrentRoom != null) - CurrentRoom.OnFeedback.OutputChange += new EventHandler(OnFeedback_OutputChange); - TriList.BooleanInput[UIBoolJoin.TopBarVisible].BoolValue = true; TriList.BooleanInput[UIBoolJoin.ActivityFooterVisible].BoolValue = true; @@ -218,19 +215,12 @@ namespace PepperDash.Essentials // Note: some of these are not directly-related to the huddle space UI, but are held over // in case TriList.SetSigFalseAction(UIBoolJoin.ShowPowerOffPress, PowerButtonPressed); - TriList.SetSigFalseAction(UIBoolJoin.PowerOffCancelPress, CancelPowerOff); - TriList.SetSigFalseAction(UIBoolJoin.PowerOffConfirmPress, FinishPowerOff); TriList.SetSigFalseAction(UIBoolJoin.PowerOffMorePress, () => { CancelPowerOffTimer(); TriList.BooleanInput[UIBoolJoin.PowerOffStep1Visible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.PowerOffStep2Visible].BoolValue = true; }); - TriList.SetSigFalseAction(UIBoolJoin.AllRoomsOffPress, () => - { - EssentialsHuddleSpaceRoom.AllRoomsOff(); - CancelPowerOff(); - }); TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () => { if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IPower) @@ -245,24 +235,13 @@ namespace PepperDash.Essentials /// /// /// - void OnFeedback_OutputChange(object sender, EventArgs e) - { - if (CurrentRoom.OnFeedback.BoolValue) - { - TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = true; - } - else - { - TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false; - TriList.BooleanInput[UIBoolJoin.StagingPageVisible].BoolValue = false; - } - } + //void OnFeedback_OutputChange(object sender, EventArgs e) + //{ + + //} public override void Hide() { - if (CurrentRoom != null) - CurrentRoom.OnFeedback.OutputChange -= OnFeedback_OutputChange; - HideAndClearCurrentDisplayModeSigsInUse(); TriList.BooleanInput[UIBoolJoin.TopBarVisible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.ActivityFooterVisible].BoolValue = false; @@ -271,7 +250,7 @@ namespace PepperDash.Essentials TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false; //TriList.BooleanInput[UIBoolJoin.StagingPageVisible].BoolValue = false; VolumeButtonsPopupFeedback.ClearNow(); - CancelPowerOff(); + //CancelPowerOff(); base.Hide(); } @@ -330,6 +309,7 @@ namespace PepperDash.Essentials b => { if (!b) ShareButtonPressed(); })); ActivityFooterSrl.Count = 1; TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 0; + ShareButtonSig.BoolValue = false; } /// @@ -352,13 +332,13 @@ namespace PepperDash.Essentials /// void ShareButtonPressed() { - if (!_CurrentRoom.OnFeedback.BoolValue) - { + //if (!_CurrentRoom.OnFeedback.BoolValue) + //{ ShareButtonSig.BoolValue = true; TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false; TriList.BooleanInput[UIBoolJoin.StagingPageVisible].BoolValue = true; TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = true; - } + //} } uint CurrentInterlockedModalJoin; @@ -486,6 +466,7 @@ namespace PepperDash.Essentials /// void ShutdownPromptTimer_HasStarted(object sender, EventArgs e) { + // Do we need to check where the UI is? No? var timer = CurrentRoom.ShutdownPromptTimer; EndMeetingButtonSig.BoolValue = true; @@ -495,6 +476,29 @@ namespace PepperDash.Essentials { var modal = new ModalDialog(TriList); var message = string.Format("Meeting will end in {0} seconds", CurrentRoom.ShutdownPromptSeconds); + + // figure out a cleaner way to update gauge + var gauge = CurrentRoom.ShutdownPromptTimer.PercentFeedback; + EventHandler gaugeHandler = null; + gaugeHandler = (o, a) => TriList.UShortInput[ModalDialog.TimerGaugeJoin].UShortValue = + (ushort)(gauge.UShortValue * 65535 / 100); + gauge.OutputChange += gaugeHandler; + + // respond to offs by cancelling dialog + var onFb = CurrentRoom.OnFeedback; + EventHandler offHandler = null; + offHandler = (o, a) => + { + if (!onFb.BoolValue) + { + EndMeetingButtonSig.BoolValue = false; + modal.HideDialog(); + onFb.OutputChange -= offHandler; + gauge.OutputChange -= gaugeHandler; + } + }; + onFb.OutputChange += offHandler; + modal.PresentModalDialog(2, "End Meeting", "Power", message, "Cancel", "End Meeting Now", true, but => { @@ -513,7 +517,8 @@ namespace PepperDash.Essentials /// void ShutdownPromptTimer_HasFinished(object sender, EventArgs e) { - ShareButtonSig.BoolValue = true; // restore Share fb + + Debug.Console(2, "UI shutdown prompt finished"); EndMeetingButtonSig.BoolValue = false; } @@ -524,6 +529,8 @@ namespace PepperDash.Essentials /// void ShutdownPromptTimer_WasCancelled(object sender, EventArgs e) { + Debug.Console(2, "UI shutdown prompt cancelled"); + ShareButtonSig.BoolValue = true; // restore Share fb EndMeetingButtonSig.BoolValue = false; } @@ -542,23 +549,23 @@ namespace PepperDash.Essentials /// /// Runs the power off function on the current room /// - public void FinishPowerOff() - { - if (CurrentRoom == null) - return; - CurrentRoom.RunRouteAction("roomOff"); - CancelPowerOff(); - } + //public void FinishPowerOff() + //{ + // if (CurrentRoom == null) + // return; + // CurrentRoom.RunRouteAction("roomOff"); + // CancelPowerOff(); + //} /// /// Hides power off pages and stops timer /// - void CancelPowerOff() - { - CancelPowerOffTimer(); - TriList.BooleanInput[UIBoolJoin.PowerOffStep1Visible].BoolValue = false; - TriList.BooleanInput[UIBoolJoin.PowerOffStep2Visible].BoolValue = false; - } + //void CancelPowerOff() + //{ + // CancelPowerOffTimer(); + // TriList.BooleanInput[UIBoolJoin.PowerOffStep1Visible].BoolValue = false; + // TriList.BooleanInput[UIBoolJoin.PowerOffStep2Visible].BoolValue = false; + //} /// /// @@ -612,11 +619,14 @@ namespace PepperDash.Essentials if (_CurrentRoom != null) { // Disconnect current room - _CurrentRoom.OnFeedback.OutputChange -= _CurrentRoom_OnFeedback_OutputChange; - _CurrentRoom.CurrentVolumeDeviceChange -= this._CurrentRoom_CurrentAudioDeviceChange; + _CurrentRoom.OnFeedback.OutputChange -= CurrentRoom_OnFeedback_OutputChange; + _CurrentRoom.CurrentVolumeDeviceChange -= this.CurrentRoom_CurrentAudioDeviceChange; ClearAudioDeviceConnections(); - _CurrentRoom.CurrentSingleSourceChange -= this._CurrentRoom_SourceInfoChange; + _CurrentRoom.CurrentSingleSourceChange -= this.CurrentRoom_SourceInfoChange; DisconnectSource(_CurrentRoom.CurrentSourceInfo); + _CurrentRoom.ShutdownPromptTimer.HasStarted -= ShutdownPromptTimer_HasStarted; + _CurrentRoom.ShutdownPromptTimer.HasFinished -= ShutdownPromptTimer_HasFinished; + _CurrentRoom.ShutdownPromptTimer.WasCancelled -= ShutdownPromptTimer_WasCancelled; } _CurrentRoom = room; @@ -654,16 +664,15 @@ namespace PepperDash.Essentials TriList.StringInput[UIStringJoin.CurrentRoomName].StringValue = _CurrentRoom.Name; // Shutdown timer - //_CurrentRoom.ShutdownPromptTimer.IsRunningFeedback.OutputChange += Shutdown_IsRunningFeedback_OutputChange; _CurrentRoom.ShutdownPromptTimer.HasStarted += ShutdownPromptTimer_HasStarted; _CurrentRoom.ShutdownPromptTimer.HasFinished += ShutdownPromptTimer_HasFinished; _CurrentRoom.ShutdownPromptTimer.WasCancelled += ShutdownPromptTimer_WasCancelled; // Link up all the change events from the room - _CurrentRoom.OnFeedback.OutputChange += _CurrentRoom_OnFeedback_OutputChange; - _CurrentRoom.CurrentVolumeDeviceChange += _CurrentRoom_CurrentAudioDeviceChange; + _CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange; + _CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange; RefreshAudioDeviceConnections(); - _CurrentRoom.CurrentSingleSourceChange += _CurrentRoom_SourceInfoChange; + _CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange; RefreshSourceInfo(); } else @@ -676,19 +685,22 @@ namespace PepperDash.Essentials /// /// For room on/off changes /// - void _CurrentRoom_OnFeedback_OutputChange(object sender, EventArgs e) + void CurrentRoom_OnFeedback_OutputChange(object sender, EventArgs e) { var value = _CurrentRoom.OnFeedback.BoolValue; TriList.BooleanInput[UIBoolJoin.RoomIsOn].BoolValue = value; - if (value) + if (value) //ON { SetupActivityFooterWhenRoomOn(); TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false; + TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = true; } else { SetupActivityFooterWhenRoomOff(); TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true; + TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false; + TriList.BooleanInput[UIBoolJoin.StagingPageVisible].BoolValue = false; } } @@ -848,7 +860,7 @@ namespace PepperDash.Essentials /// /// Handler for when the room's volume control device changes /// - void _CurrentRoom_CurrentAudioDeviceChange(object sender, VolumeDeviceChangeEventArgs args) + void CurrentRoom_CurrentAudioDeviceChange(object sender, VolumeDeviceChangeEventArgs args) { if (args.Type == ChangeType.WillChange) ClearAudioDeviceConnections(); @@ -859,7 +871,7 @@ namespace PepperDash.Essentials /// /// Handles source change /// - void _CurrentRoom_SourceInfoChange(EssentialsRoomBase room, + void CurrentRoom_SourceInfoChange(EssentialsRoomBase room, SourceListItem info, ChangeType change) { if (change == ChangeType.WillChange) diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 8c91ecc3..8e4d7c9e 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index f414a860..32965362 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ