mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
feat: Implement help request status tracking in Fusion system
This commit is contained in:
@@ -76,12 +76,18 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
|
|
||||||
private bool _helpRequestSent;
|
private bool _helpRequestSent;
|
||||||
|
|
||||||
|
private eFusionHelpResponse _helpRequestStatus;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public StringFeedback HelpRequestResponseFeedback { get; private set; }
|
public StringFeedback HelpRequestResponseFeedback { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public BoolFeedback HelpRequestSentFeedback { get; private set; }
|
public BoolFeedback HelpRequestSentFeedback { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public StringFeedback HelpRequestStatusFeedback { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
#region System Info Sigs
|
#region System Info Sigs
|
||||||
|
|
||||||
//StringSigData SystemName;
|
//StringSigData SystemName;
|
||||||
@@ -297,11 +303,10 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
|
|
||||||
FusionRVI.GenerateFileForAllFusionDevices();
|
FusionRVI.GenerateFileForAllFusionDevices();
|
||||||
|
|
||||||
HelpRequestResponseFeedback = new StringFeedback("HelpRequestResponse", () => FusionRoom.Help.InputSig.StringValue);
|
HelpRequestResponseFeedback = new StringFeedback("HelpRequestResponse", () => FusionRoom.Help.OutputSig.StringValue);
|
||||||
HelpRequestResponseFeedback.LinkInputSig(FusionRoom.Help.InputSig);
|
|
||||||
|
|
||||||
HelpRequestSentFeedback = new BoolFeedback("HelpRequestSent", () => _helpRequestSent);
|
HelpRequestSentFeedback = new BoolFeedback("HelpRequestSent", () => _helpRequestSent);
|
||||||
|
HelpRequestStatusFeedback = new StringFeedback("HelpRequestStatus", () => _helpRequestStatus.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1767,10 +1772,59 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
{
|
{
|
||||||
if (args.EventId == FusionEventIds.HelpMessageReceivedEventId)
|
if (args.EventId == FusionEventIds.HelpMessageReceivedEventId)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(LogEventLevel.Information, this, "Help message received from Fusion for room '{0}'",
|
this.LogInformation( "Help message received from Fusion for room '{0}'",
|
||||||
Room.Name);
|
Room.Name);
|
||||||
|
|
||||||
|
this.LogDebug("Help message content: {0}", FusionRoom.Help.OutputSig.StringValue);
|
||||||
// Fire help request event
|
// Fire help request event
|
||||||
HelpRequestResponseFeedback.FireUpdate();
|
HelpRequestResponseFeedback.FireUpdate();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(FusionRoom.Help.OutputSig.StringValue))
|
||||||
|
{
|
||||||
|
switch (FusionRoom.Help.OutputSig.StringValue)
|
||||||
|
{
|
||||||
|
case "Please wait, a technician is on his / her way.":
|
||||||
|
this.LogInformation("Please wait, a technician is on his / her way.",
|
||||||
|
Room.Name);
|
||||||
|
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.HelpOnTheWay;
|
||||||
|
break;
|
||||||
|
case "Please call the helpdesk.":
|
||||||
|
this.LogInformation("Please call the helpdesk.");
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.CallHelpDesk;
|
||||||
|
break;
|
||||||
|
case "Please wait, I will reschedule your meeting to a different room.":
|
||||||
|
this.LogInformation("Please wait, I will reschedule your meeting to a different room.",
|
||||||
|
Room.Name);
|
||||||
|
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.ReschedulingMeeting;
|
||||||
|
break;
|
||||||
|
case "I will be taking control of your system. Please be patient while I adjust the settings.":
|
||||||
|
this.LogInformation("I will be taking control of your system. Please be patient while I adjust the settings.",
|
||||||
|
Room.Name);
|
||||||
|
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.TakingControl;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.LogInformation("Unknown help request code received from Fusion for room '{0}'",
|
||||||
|
Room.Name);
|
||||||
|
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.None;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_helpRequestStatus == eFusionHelpResponse.None)
|
||||||
|
{
|
||||||
|
_helpRequestSent = false;
|
||||||
|
HelpRequestSentFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
HelpRequestStatusFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1835,9 +1889,14 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
|
|
||||||
FusionRoom.Help.InputSig.StringValue = requestString;
|
FusionRoom.Help.InputSig.StringValue = requestString;
|
||||||
|
|
||||||
Debug.LogMessage(LogEventLevel.Information, this, "Help request sent to Fusion from room '{0}'", Room.Name);
|
this.LogInformation("Help request sent to Fusion from room '{0}'", Room.Name);
|
||||||
|
this.LogDebug("Help request content: {0}", FusionRoom.Help.InputSig.StringValue);
|
||||||
|
|
||||||
_helpRequestSent = true;
|
_helpRequestSent = true;
|
||||||
|
HelpRequestSentFeedback.FireUpdate();
|
||||||
|
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.HelpRequested;
|
||||||
|
HelpRequestStatusFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -1847,6 +1906,9 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
{
|
{
|
||||||
FusionRoom.Help.InputSig.StringValue = "";
|
FusionRoom.Help.InputSig.StringValue = "";
|
||||||
_helpRequestSent = false;
|
_helpRequestSent = false;
|
||||||
|
HelpRequestSentFeedback.FireUpdate();
|
||||||
|
_helpRequestStatus = eFusionHelpResponse.None;
|
||||||
|
HelpRequestStatusFeedback.FireUpdate();
|
||||||
Debug.LogMessage(LogEventLevel.Information, this, "Help request cancelled in Fusion for room '{0}'", Room.Name);
|
Debug.LogMessage(LogEventLevel.Information, this, "Help request cancelled in Fusion for room '{0}'", Room.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,10 +21,14 @@ namespace PepperDash.Essentials.Core.Fusion
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
BoolFeedback HelpRequestSentFeedback { get; }
|
BoolFeedback HelpRequestSentFeedback { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Feedback containing the current status of the help request
|
||||||
|
/// </summary>
|
||||||
|
StringFeedback HelpRequestStatusFeedback { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends a help request
|
/// Sends a help request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="isHtml"></param>
|
|
||||||
void SendHelpRequest();
|
void SendHelpRequest();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
37
src/PepperDash.Essentials.Core/Fusion/eFusionHelpResponse.cs
Normal file
37
src/PepperDash.Essentials.Core/Fusion/eFusionHelpResponse.cs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Fusion
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enumeration of possible Fusion Help Responses based on the standard responses from Fusion
|
||||||
|
/// </summary>
|
||||||
|
public enum eFusionHelpResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// No help response
|
||||||
|
/// </summary>
|
||||||
|
None,
|
||||||
|
/// <summary>
|
||||||
|
/// Help has been requested
|
||||||
|
/// </summary>
|
||||||
|
HelpRequested,
|
||||||
|
/// <summary>
|
||||||
|
/// Help is on the way
|
||||||
|
/// </summary>
|
||||||
|
HelpOnTheWay,
|
||||||
|
/// <summary>
|
||||||
|
/// Please call the helpdesk.
|
||||||
|
/// </summary>
|
||||||
|
CallHelpDesk,
|
||||||
|
/// <summary>
|
||||||
|
/// Rescheduling meeting.
|
||||||
|
/// </summary>
|
||||||
|
ReschedulingMeeting,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Technician taking control.
|
||||||
|
/// </summary>
|
||||||
|
TakingControl,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user