Updates to finesse screen saver and get phone/video number display working correclty

This commit is contained in:
Neil Dorin
2020-08-06 22:04:07 -06:00
parent d6581cab2e
commit b7c9677c7a
3 changed files with 43 additions and 13 deletions

View File

@@ -59,15 +59,17 @@ namespace PepperDash.Essentials
void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
{
var timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000;
if (args.Sig.BoolValue)
{
if (InactivityTimer != null)
{
InactivityTimer.Reset();
InactivityTimer.Reset(timeoutMs);
}
else
{
InactivityTimer = new CTimer((o) => InactivityTimerExpired(), Config.ScreenSaverTimeoutMin * 60 * 1000);
InactivityTimer = new CTimer((o) => InactivityTimerExpired(), timeoutMs);
}
}
}

View File

@@ -20,7 +20,7 @@ namespace PepperDash.Essentials
List<uint> PositionJoins;
int CurrentPositionIndex;
int CurrentPositionIndex = 0;
public ScreenSaverController(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
: base(parent.TriList)
@@ -39,6 +39,8 @@ namespace PepperDash.Essentials
{
TriList.SetBool(UIBoolJoin.MCScreenSaverVisible, true);
CurrentPositionIndex = 0;
SetCurrentPosition();
StartPositionTimer();
base.Show();
@@ -64,13 +66,26 @@ namespace PepperDash.Essentials
if (PositionTimer == null)
{
PositionTimer = new CTimer((o) => PositionTimerExpired(), PositionTimeoutMs);
SetCurrentPosition();
}
else
{
PositionTimer.Reset(PositionTimeoutMs);
}
}
void PositionTimerExpired()
{
if (CurrentPositionIndex <= PositionJoins.Count)
IncrementPositionIndex();
SetCurrentPosition();
StartPositionTimer();
}
void IncrementPositionIndex()
{
if (CurrentPositionIndex < PositionJoins.Count - 1)
{
CurrentPositionIndex++;
}
@@ -78,6 +93,8 @@ namespace PepperDash.Essentials
{
CurrentPositionIndex = 0;
}
Debug.Console(1, "ScreenSaver Position Timer Expired: Setting new position: {0}", CurrentPositionIndex);
}
//

View File

@@ -194,28 +194,39 @@ namespace PepperDash.Essentials.UIDrivers.VC
{
string roomContactNumbers = "";
string roomPhoneNumber = "";
string roomVideoAddress = "";
Debug.Console(1,
@"
Codec.CodecInfo.SipUri: {0}
Codec.CodecInfo.SipPhoneNumber: {1}
Codec.CodecInfo.Ei64Alias: {2}
Codec.CodecInfo.H323Id: {3}
", Codec.CodecInfo.SipUri, Codec.CodecInfo.SipPhoneNumber, Codec.CodecInfo.E164Alias, Codec.CodecInfo.H323Id);
if (!string.IsNullOrEmpty(Codec.CodecInfo.SipUri)) // If both values are present, format the string with a pipe divider
{
roomContactNumbers = string.Format("{0} | {1}", GetFormattedPhoneNumber(Codec.CodecInfo.SipPhoneNumber), Codec.CodecInfo.SipUri);
roomPhoneNumber = GetFormattedPhoneNumber(Codec.CodecInfo.SipPhoneNumber);
roomPhoneNumber = Codec.CodecInfo.SipUri;
}
else // If only one value present, just show the phone number
else if(!string.IsNullOrEmpty(Codec.CodecInfo.SipPhoneNumber)) // If only one value present, just show the phone number
{
roomPhoneNumber = GetFormattedPhoneNumber(Codec.CodecInfo.SipPhoneNumber);
roomContactNumbers = Codec.CodecInfo.SipPhoneNumber;
}
if (string.IsNullOrEmpty(roomContactNumbers))
{
if(!string.IsNullOrEmpty(Codec.CodecInfo.E164Alias))
roomContactNumbers = string.Format("{0} | {1}", Codec.CodecInfo.E164Alias, Codec.CodecInfo.H323Id);
else
roomContactNumbers = Codec.CodecInfo.H323Id;
roomVideoAddress = Codec.CodecInfo.E164Alias;
else if (!string.IsNullOrEmpty(Codec.CodecInfo.H323Id))
roomVideoAddress = Codec.CodecInfo.H323Id;
}
roomContactNumbers = string.Format("{0} | {1}", roomPhoneNumber, roomVideoAddress);
TriList.SetString(UIStringJoin.RoomAddressPipeText, roomContactNumbers);
TriList.SetString(UIStringJoin.RoomPhoneText, roomPhoneNumber);
TriList.SetString(UIStringJoin.RoomVideoAddressText, Codec.CodecInfo.H323Id);
TriList.SetString(UIStringJoin.RoomVideoAddressText, roomVideoAddress);
if(HeaderDriver.HeaderButtonsAreSetUp)
HeaderDriver.ComputeHeaderCallStatus(Codec);