diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index 10282fc4..5ac950e4 100644 --- a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -60,7 +60,7 @@ False - ..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll + ..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll False diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo index ecc278b2..1e97c7f6 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 bba8fe3e..8af796f1 100644 --- a/Essentials Core/PepperDashEssentialsBase/Touchpanels/ModalDialog.cs +++ b/Essentials Core/PepperDashEssentialsBase/Touchpanels/ModalDialog.cs @@ -30,6 +30,10 @@ namespace PepperDash.Essentials.Core /// Shows the timer guage if in use. Bool feedback 3996 /// public const uint TimerVisibleJoin = 3996; + /// + /// Visibility join to show "X" button 3997 + /// + public const uint CancelVisibleJoin = 3997; /// /// Shows the modal subpage. Boolean feeback join 3999 /// @@ -73,6 +77,11 @@ namespace PepperDash.Essentials.Core get { return TriList.BooleanInput[ModalVisibleJoin].BoolValue; } } + /// + /// + /// + public bool CanCancel { get; private set; } + BasicTriList TriList; @@ -90,7 +99,8 @@ namespace PepperDash.Essentials.Core // Attach actions to buttons triList.SetSigFalseAction(Button1Join, () => OnModalComplete(1)); triList.SetSigFalseAction(Button2Join, () => OnModalComplete(2)); - triList.SetSigFalseAction(CancelButtonJoin, () => CancelDialog()); + triList.SetSigFalseAction(CancelButtonJoin, () => { if (CanCancel) CancelDialog(); }); + CanCancel = true; } /// @@ -103,9 +113,8 @@ namespace PepperDash.Essentials.Core /// True when modal is created. public bool PresentModalDialog(uint numberOfButtons, string title, string iconName, string message, string button1Text, - string button2Text, bool showGauge, Action completeAction) + string button2Text, bool showGauge, bool showCancel, Action completeAction) { - //Debug.Console(0, "Present dialog"); // Don't reset dialog if visible now if (!ModalIsVisible) { @@ -137,9 +146,13 @@ namespace PepperDash.Essentials.Core } // Show/hide guage TriList.BooleanInput[TimerVisibleJoin].BoolValue = showGauge; + + CanCancel = showCancel; + TriList.BooleanInput[CancelVisibleJoin].BoolValue = showCancel; //Reveal and activate TriList.BooleanInput[ModalVisibleJoin].BoolValue = true; + return true; } diff --git a/Essentials DM/Essentials_DM/Essentials_DM.projectinfo b/Essentials DM/Essentials_DM/Essentials_DM.projectinfo index c4d11a27..72932922 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/Display/SamsungMDCDisplay.cs b/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs index 1b50bc20..5fe14874 100644 --- a/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs +++ b/Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs @@ -21,6 +21,7 @@ namespace PepperDash.Essentials.Devices.Displays public byte ID { get; private set; } + bool _PowerIsOn; bool _IsWarmingUp; bool _IsCoolingDown; @@ -35,8 +36,7 @@ namespace PepperDash.Essentials.Devices.Displays protected override Func PowerIsOnFeedbackFunc { get { return () => _PowerIsOn; } } protected override Func IsCoolingDownFeedbackFunc { get { return () => _IsCoolingDown; } } protected override Func IsWarmingUpFeedbackFunc { get { return () => _IsWarmingUp; } } - protected override Func CurrentInputFeedbackFunc { get { return () => _CurrentInputPort.Key; } } - + protected override Func CurrentInputFeedbackFunc { get { return () => _CurrentInputPort.Key; } } /// /// Constructor for IBasicCommunication @@ -62,7 +62,6 @@ namespace PepperDash.Essentials.Devices.Displays Init(); } - /// /// Constructor for COM /// @@ -120,7 +119,6 @@ namespace PepperDash.Essentials.Devices.Displays MuteFeedback = new BoolFeedback(() => _IsMuted); StatusGet(); - //StatusTimer = new CTimer(o => StatusGet(), null, 0, 30000); } /// @@ -157,13 +155,11 @@ namespace PepperDash.Essentials.Devices.Displays /// void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e) { - //Debug.Console(2, this, "Socket in: {0}", ComTextHelper.GetEscapedText(e.Bytes)); // This is probably not thread-safe buffering // Append the incoming bytes with whatever is in the buffer var newBytes = new byte[IncomingBuffer.Length + e.Bytes.Length]; IncomingBuffer.CopyTo(newBytes, 0); e.Bytes.CopyTo(newBytes, IncomingBuffer.Length); - //Debug.Console(2, this, "Buffer+new: {0}", ComTextHelper.GetEscapedText(newBytes)); // Need to find AA FF and have for (int i = 0; i < newBytes.Length; i++) @@ -192,7 +188,8 @@ namespace PepperDash.Essentials.Devices.Displays switch (message[1]) // type byte { case 0x00: // General status - UpdatePowerFBWithSource(message[2], message[3]); // "power" can be misrepresented when the display sleeps + UpdatePowerFB(message[2]); // "power" can be misrepresented when the display sleeps + UpdateInputFb(message[5]); UpdateVolumeFB(message[3]); UpdateMuteFb(message[4]); UpdateInputFb(message[5]); @@ -230,28 +227,17 @@ namespace PepperDash.Essentials.Devices.Displays IncomingBuffer = newBytes; } - /// - /// Checks power feedback AND that source >0x10 - /// - /// - /// - void UpdatePowerFBWithSource(byte pb, byte ib) - { - var newVal = pb == 1 && ib > 0x10; - if (newVal != _PowerIsOn) - { - _PowerIsOn = newVal; - PowerIsOnFeedback.FireUpdate(); - } - } - void UpdatePowerFB(byte pb) { var newVal = pb == 1; + Debug.Console(2, this, "NEW POWER STATE={0}, CURRENT={1}", newVal, _PowerIsOn); if (newVal != _PowerIsOn) { _PowerIsOn = newVal; - PowerIsOnFeedback.FireUpdate(); + CrestronEnvironment.Sleep(1500); + Debug.Console(2, this, "NEW POWER STATE AFTER PAUSE={0} CURRENT={1}", newVal, _PowerIsOn); + if (newVal != _PowerIsOn) + PowerIsOnFeedback.FireUpdate(); } } @@ -260,7 +246,7 @@ namespace PepperDash.Essentials.Devices.Displays /// /// void UpdateVolumeFB(byte b) - { + { var newVol = (ushort)Scale((double)b, 0, 100, 0, 65535); if (!VolumeIsRamping) _LastVolumeSent = newVol; @@ -346,7 +332,7 @@ namespace PepperDash.Essentials.Devices.Displays { // If a display has unreliable-power off feedback, just override this and // remove this check. - if (PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown) + if (!_IsWarmingUp && !_IsCoolingDown) // PowerIsOnFeedback.BoolValue && { //Send(PowerOffCmd); SendBytes(new byte[] { 0xAA, 0x11, 0x00, 0x01, 0x00, 0x00 }); 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 06c175c7..bca34499 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/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 1c16c428..06816ff6 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -29,8 +29,8 @@ namespace PepperDash.Essentials /// public override void InitializeSystem() { - CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file", - ConsoleAccessLevelEnum.AccessOperator); + //CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file", + // ConsoleAccessLevelEnum.AccessOperator); //CrestronConsole.AddNewConsoleCommand(s => TearDown(), "ungo", "Reloads configuration file", // ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(s => @@ -40,7 +40,7 @@ namespace PepperDash.Essentials }, "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator); - //GoWithLoad(); + GoWithLoad(); } /// diff --git a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs index 9c871c07..364af83a 100644 --- a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs +++ b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs @@ -1050,6 +1050,10 @@ namespace PepperDash.Essentials.Fusion void SetUpOccupancy() { + + return; + + #warning Add actual object logic check here //if (Room.OccupancyObj != null) //{ diff --git a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo index 55a574dd..1d8c9804 100644 Binary files a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo and b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo differ diff --git a/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs b/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs index 4900992f..aee79fb0 100644 --- a/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs +++ b/Essentials/PepperDashEssentials/Room/EssentialsHuddleSpaceRoom.cs @@ -30,6 +30,45 @@ namespace PepperDash.Essentials }; } } + /// + /// + /// + protected override Func IsWarmingFeedbackFunc + { + get + { + return () => + { + var disp = DefaultDisplay as DisplayBase; + if (disp != null) + return disp.IsWarmingUpFeedback.BoolValue; + else + return false; + }; + } + } + /// + /// + /// + protected override Func IsCoolingFeedbackFunc + { + get + { + return () => + { + 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; + } + }; + } + } public EssentialsRoomPropertiesConfig Config { get; private set; } @@ -129,6 +168,7 @@ namespace PepperDash.Essentials var disp = DefaultDisplay as DisplayBase; if (disp != null) { + // Link power, warming, cooling to display disp.PowerIsOnFeedback.OutputChange += (o, a) => { if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue) @@ -138,11 +178,15 @@ namespace PepperDash.Essentials OnFeedback.FireUpdate(); } }; + + disp.IsWarmingUpFeedback.OutputChange += (o, a) => { IsWarmingUpFeedback.FireUpdate(); }; + disp.IsCoolingDownFeedback.OutputChange += (o, a) => { IsCoolingDownFeedback.FireUpdate(); }; } SourceListKey = "default"; EnablePowerOnToLastSource = true; - } + } + /// /// diff --git a/Essentials/PepperDashEssentials/Room/EssentialsPresentationRoom.cs b/Essentials/PepperDashEssentials/Room/EssentialsPresentationRoom.cs index c022575a..f0420b30 100644 --- a/Essentials/PepperDashEssentials/Room/EssentialsPresentationRoom.cs +++ b/Essentials/PepperDashEssentials/Room/EssentialsPresentationRoom.cs @@ -22,7 +22,10 @@ namespace PepperDash.Essentials || (Display1SourceInfo != null && Display1SourceInfo.Type != eSourceListItemType.Off) || (Display2SourceInfo != null - && Display2SourceInfo.Type != eSourceListItemType.Off); } } + && Display2SourceInfo.Type != eSourceListItemType.Off); } } + + protected override Func IsWarmingFeedbackFunc { get { return () =>false;; } } + protected override Func IsCoolingFeedbackFunc { get { return () => false; } } public EssentialsPresentationRoomPropertiesConfig Config { get; private set; } diff --git a/Essentials/PepperDashEssentials/Room/EssentialsRoomBase.cs b/Essentials/PepperDashEssentials/Room/EssentialsRoomBase.cs index 94ddd749..86cdaa44 100644 --- a/Essentials/PepperDashEssentials/Room/EssentialsRoomBase.cs +++ b/Essentials/PepperDashEssentials/Room/EssentialsRoomBase.cs @@ -27,8 +27,11 @@ namespace PepperDash.Essentials /// public BoolFeedback OnFeedback { get; private set; } - public BoolFeedback IsWarmingFeedback { get; private set; } - public BoolFeedback IsCoolingFeedback { get; private set; } + public BoolFeedback IsWarmingUpFeedback { get; private set; } + public BoolFeedback IsCoolingDownFeedback { get; private set; } + + protected abstract Func IsWarmingFeedbackFunc { get; } + protected abstract Func IsCoolingFeedbackFunc { get; } /// /// Timer used for informing the UIs of a shutdown @@ -67,8 +70,10 @@ namespace PepperDash.Essentials ShutdownType = ShutdownType.None; OnFeedback = new BoolFeedback(OnFeedbackFunc); - } + IsWarmingUpFeedback = new BoolFeedback(IsWarmingFeedbackFunc); + IsCoolingDownFeedback = new BoolFeedback(IsCoolingFeedbackFunc); + } /// /// diff --git a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs index 2843f0b0..a7f239da 100644 --- a/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UI Drivers/EssentialsHuddlePanelAvFunctionsDriver.cs @@ -140,6 +140,8 @@ namespace PepperDash.Essentials /// CTimer PowerOffTimer; + ModalDialog WarmingCoolingModal; + /// /// Constructor /// @@ -203,13 +205,17 @@ namespace PepperDash.Essentials ShowInterlockedModal(UIBoolJoin.HelpPageVisible); }); - TriList.SetSigFalseAction(UIBoolJoin.RoomHeaderButtonPress, () => - ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible)); + //TriList.SetSigFalseAction(UIBoolJoin.RoomHeaderButtonPress, () => + // ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible)); #warning Add press and hold to gear button here - TriList.BooleanInput[UIBoolJoin.GearButtonVisible].BoolValue = false; +#warning Hide Gear on ipad for now + TriList.BooleanInput[UIBoolJoin.GearButtonVisible].BoolValue = true; TriList.SetSigFalseAction(UIBoolJoin.GearHeaderButtonPress, () => - ShowInterlockedModal(UIBoolJoin.VolumesPageVisible)); + ShowInterlockedModal(UIBoolJoin.TechPanelSetupVisible)); + //ShowInterlockedModal(UIBoolJoin.VolumesPageVisible)); + TriList.SetSigFalseAction(UIBoolJoin.TechPagesExitButton, () => + HideCurrentInterlockedModal()); // power-related functions // Note: some of these are not directly-related to the huddle space UI, but are held over @@ -499,7 +505,7 @@ namespace PepperDash.Essentials }; onFb.OutputChange += offHandler; - modal.PresentModalDialog(2, "End Meeting", "Power", message, "Cancel", "End Meeting Now", true, + modal.PresentModalDialog(2, "End Meeting", "Power", message, "Cancel", "End Meeting Now", true, true, but => { if (but != 2) // any button except for End cancels @@ -616,10 +622,10 @@ namespace PepperDash.Essentials void SetCurrentRoom(EssentialsHuddleSpaceRoom room) { if (_CurrentRoom == room) return; + // Disconnect current (probably never called) if (_CurrentRoom != null) { // Disconnect current room - _CurrentRoom.OnFeedback.OutputChange -= CurrentRoom_OnFeedback_OutputChange; _CurrentRoom.CurrentVolumeDeviceChange -= this.CurrentRoom_CurrentAudioDeviceChange; ClearAudioDeviceConnections(); _CurrentRoom.CurrentSingleSourceChange -= this.CurrentRoom_SourceInfoChange; @@ -627,7 +633,11 @@ namespace PepperDash.Essentials _CurrentRoom.ShutdownPromptTimer.HasStarted -= ShutdownPromptTimer_HasStarted; _CurrentRoom.ShutdownPromptTimer.HasFinished -= ShutdownPromptTimer_HasFinished; _CurrentRoom.ShutdownPromptTimer.WasCancelled -= ShutdownPromptTimer_WasCancelled; - } + + _CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange; + _CurrentRoom.IsWarmingUpFeedback.OutputChange -= CurrentRoom_IsWarmingFeedback_OutputChange; + _CurrentRoom.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange; + } _CurrentRoom = room; if (_CurrentRoom != null) @@ -670,6 +680,9 @@ namespace PepperDash.Essentials // Link up all the change events from the room _CurrentRoom.OnFeedback.OutputChange += CurrentRoom_OnFeedback_OutputChange; + _CurrentRoom.IsWarmingUpFeedback.OutputChange += CurrentRoom_IsWarmingFeedback_OutputChange; + _CurrentRoom.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange; + _CurrentRoom.CurrentVolumeDeviceChange += CurrentRoom_CurrentAudioDeviceChange; RefreshAudioDeviceConnections(); _CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange; @@ -688,6 +701,7 @@ namespace PepperDash.Essentials void CurrentRoom_OnFeedback_OutputChange(object sender, EventArgs e) { var value = _CurrentRoom.OnFeedback.BoolValue; + Debug.Console(2, CurrentRoom, "UI: Is on event={0}", value); TriList.BooleanInput[UIBoolJoin.RoomIsOn].BoolValue = value; if (value) //ON { @@ -704,6 +718,46 @@ namespace PepperDash.Essentials } } + /// + /// + /// + void CurrentRoom_IsWarmingFeedback_OutputChange(object sender, EventArgs e) + { + var value = CurrentRoom.IsWarmingUpFeedback.BoolValue; + Debug.Console(2, CurrentRoom, "UI: WARMING event={0}", value); + + if (value) + { + WarmingCoolingModal = new ModalDialog(TriList); + WarmingCoolingModal.PresentModalDialog(0, "Powering up", "Power", "Room is warming up. Please wait.", + "", "", false, false, null); + } + else + { + if (WarmingCoolingModal != null) + WarmingCoolingModal.CancelDialog(); + } + } + + + void IsCoolingDownFeedback_OutputChange(object sender, EventArgs e) + { + var value = CurrentRoom.IsCoolingDownFeedback.BoolValue; + Debug.Console(2, CurrentRoom, "UI: Cooldown event={0}", value); + + if (value) + { + WarmingCoolingModal = new ModalDialog(TriList); + WarmingCoolingModal.PresentModalDialog(0, "Shutting down", "Power", "Room is shutting down. Please wait.", + "", "", false, false, null); + } + else + { + if (WarmingCoolingModal != null) + WarmingCoolingModal.CancelDialog(); + } + } + /// /// Hides source for provided source info /// diff --git a/Essentials/PepperDashEssentials/UI Drivers/EssentialsPresentationPanelAvFunctionsDriver.cs b/Essentials/PepperDashEssentials/UI Drivers/EssentialsPresentationPanelAvFunctionsDriver.cs index 7f4d0029..3d422804 100644 --- a/Essentials/PepperDashEssentials/UI Drivers/EssentialsPresentationPanelAvFunctionsDriver.cs +++ b/Essentials/PepperDashEssentials/UI Drivers/EssentialsPresentationPanelAvFunctionsDriver.cs @@ -655,7 +655,7 @@ namespace PepperDash.Essentials uint seconds = time / 1000; var message = string.Format("Meeting will end in {0} seconds", seconds); modal.PresentModalDialog(2, "End Meeting", "Power", message, - "End Meeting Now", "Cancel", true, + "End Meeting Now", "Cancel", true, true, but => { EndMeetingButtonSig.BoolValue = false; diff --git a/Essentials/PepperDashEssentials/UI Drivers/UIBoolJoin.cs b/Essentials/PepperDashEssentials/UI Drivers/UIBoolJoin.cs index d9033fdd..8ebaf2ed 100644 --- a/Essentials/PepperDashEssentials/UI Drivers/UIBoolJoin.cs +++ b/Essentials/PepperDashEssentials/UI Drivers/UIBoolJoin.cs @@ -113,6 +113,14 @@ namespace PepperDash.Essentials /// public const uint VolumesPageVisible = 3870; /// + /// 3901 + /// + public const uint TechPagesExitButton = 3901; + /// + /// 3902 + /// + public const uint TechPanelSetupVisible = 3902; + /// /// 3999 /// public const uint GenericModalVisible = 3999; diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 8e4d7c9e..8def586a 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 32965362..5b657b49 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ