mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-29 12:24:59 +00:00
Updates to finesse screen saver and get phone/video number display working correclty
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user