mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-12 11:15:08 +00:00
Refining power off dialog; added helpers to TPController for console-signal debugging
This commit is contained in:
Binary file not shown.
@@ -149,7 +149,7 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public override void Shutdown()
|
||||
{
|
||||
RunRouteAction("roomoff");
|
||||
RunRouteAction("roomOff");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -261,8 +261,6 @@ namespace PepperDash.Essentials
|
||||
if (successCallback != null)
|
||||
successCallback();
|
||||
|
||||
#warning Need to again handle special commands in here.
|
||||
|
||||
}, 0); // end of CTimer
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace PepperDash.Essentials
|
||||
if (!ShutdownPromptTimer.IsRunningFeedback.BoolValue)
|
||||
ShutdownType = ShutdownType.None;
|
||||
};
|
||||
ShutdownPromptTimer.HasFinished += (o, a) => Shutdown(); // Shutdown is triggered
|
||||
|
||||
ShutdownPromptSeconds = 60;
|
||||
ShutdownVacancySeconds = 120;
|
||||
|
||||
@@ -476,74 +476,9 @@ namespace PepperDash.Essentials
|
||||
if (!room.OnFeedback.BoolValue || room.ShutdownPromptTimer.IsRunningFeedback.BoolValue)
|
||||
return;
|
||||
|
||||
//EndMeetingButtonSig.BoolValue = true;
|
||||
//ShareButtonSig.BoolValue = false;
|
||||
|
||||
CurrentRoom.StartShutdown(ShutdownType.Manual);
|
||||
|
||||
//// Timeout or button 1 press will shut down
|
||||
//var modal = new ModalDialog(TriList);
|
||||
//uint time = 60000;
|
||||
//uint seconds = time / 1000;
|
||||
//var message = string.Format("Meeting will end in {0} seconds", seconds);
|
||||
//modal.PresentModalTimerDialog(2, "End Meeting", "Power", message,
|
||||
// "End Meeting Now", "Cancel", time, true,
|
||||
// but =>
|
||||
// {
|
||||
// if (but != 2)
|
||||
// CurrentRoom.RunRouteAction("roomOff");
|
||||
// else
|
||||
// ShareButtonSig.BoolValue = true; // restore Share fb
|
||||
// EndMeetingButtonSig.BoolValue = false;
|
||||
// });
|
||||
}
|
||||
|
||||
#warning WHAT I'M TRYING TO DO WITH SHUTDOWN PROMPTS. SEE COMMENT
|
||||
// UI should ask room to shutdown
|
||||
// UI should be attached to room's shutdown timer
|
||||
// When timer starts, the UI should present a corresponding modal, with the right text
|
||||
// the modal bar will decrement depending on the timer's percent
|
||||
// If the user selects "end now"
|
||||
// Cancel the modal
|
||||
// Call shutdown on the room (which should cancel any timers)
|
||||
// Room cancels timer
|
||||
// Room fires Shutdown event?
|
||||
// If the UI cancels shutdown
|
||||
// Call cancel shutdown on room
|
||||
// Timer will go low
|
||||
// Fire shutdown cancelled event?
|
||||
//
|
||||
|
||||
//void Shutdown_IsRunningFeedback_OutputChange(object sender, EventArgs e)
|
||||
//{
|
||||
// var timer = CurrentRoom.ShutdownPromptTimer;
|
||||
// if (timer.IsRunningFeedback.BoolValue)
|
||||
// {
|
||||
// EndMeetingButtonSig.BoolValue = true;
|
||||
// ShareButtonSig.BoolValue = false;
|
||||
|
||||
// if (CurrentRoom.ShutdownType == ShutdownType.Manual)
|
||||
// {
|
||||
// var modal = new ModalDialog(TriList);
|
||||
// var message = string.Format("Meeting will end in {0} seconds", CurrentRoom.ShutdownPromptSeconds);
|
||||
// modal.PresentModalTimerDialog(2, "End Meeting", "Power", message,
|
||||
// "End Meeting Now", "Cancel", 0, true,
|
||||
// but =>
|
||||
// {
|
||||
// if (but != 2) // any button except for End cancels
|
||||
// timer.Cancel();
|
||||
// else
|
||||
// ShareButtonSig.BoolValue = true; // restore Share fb
|
||||
// EndMeetingButtonSig.BoolValue = false;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// else // Timer stopped.
|
||||
// {
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -560,8 +495,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
var modal = new ModalDialog(TriList);
|
||||
var message = string.Format("Meeting will end in {0} seconds", CurrentRoom.ShutdownPromptSeconds);
|
||||
modal.PresentModalTimerDialog(2, "End Meeting", "Power", message,
|
||||
"End Meeting Now", "Cancel", 0, true,
|
||||
modal.PresentModalDialog(2, "End Meeting", "Power", message, "Cancel", "End Meeting Now", true,
|
||||
but =>
|
||||
{
|
||||
if (but != 2) // any button except for End cancels
|
||||
|
||||
@@ -654,8 +654,8 @@ namespace PepperDash.Essentials
|
||||
uint time = 60000;
|
||||
uint seconds = time / 1000;
|
||||
var message = string.Format("Meeting will end in {0} seconds", seconds);
|
||||
modal.PresentModalTimerDialog(2, "End Meeting", "Power", message,
|
||||
"End Meeting Now", "Cancel", time, true,
|
||||
modal.PresentModalDialog(2, "End Meeting", "Power", message,
|
||||
"End Meeting Now", "Cancel", true,
|
||||
but =>
|
||||
{
|
||||
EndMeetingButtonSig.BoolValue = false;
|
||||
|
||||
@@ -175,6 +175,32 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
}
|
||||
|
||||
public void PulseBool(uint join)
|
||||
{
|
||||
var act = Panel.BooleanInput[join].UserObject as Action<bool>;
|
||||
if (act != null)
|
||||
{
|
||||
act(true);
|
||||
act(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBoolSig(uint join, bool value)
|
||||
{
|
||||
var act = Panel.BooleanInput[join].UserObject as Action<bool>;
|
||||
if (act != null)
|
||||
act(value);
|
||||
}
|
||||
|
||||
public void SetIntSig(uint join, ushort value)
|
||||
{
|
||||
var act = Panel.BooleanInput[join].UserObject as Action<ushort>;
|
||||
if (act != null)
|
||||
{
|
||||
act(value);
|
||||
}
|
||||
}
|
||||
|
||||
void Tsw_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
if (Debug.Level == 2)
|
||||
|
||||
Reference in New Issue
Block a user