mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +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)
|
void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
|
||||||
{
|
{
|
||||||
|
var timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000;
|
||||||
|
|
||||||
if (args.Sig.BoolValue)
|
if (args.Sig.BoolValue)
|
||||||
{
|
{
|
||||||
if (InactivityTimer != null)
|
if (InactivityTimer != null)
|
||||||
{
|
{
|
||||||
InactivityTimer.Reset();
|
InactivityTimer.Reset(timeoutMs);
|
||||||
}
|
}
|
||||||
else
|
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;
|
List<uint> PositionJoins;
|
||||||
|
|
||||||
int CurrentPositionIndex;
|
int CurrentPositionIndex = 0;
|
||||||
|
|
||||||
public ScreenSaverController(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
|
public ScreenSaverController(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
|
||||||
: base(parent.TriList)
|
: base(parent.TriList)
|
||||||
@@ -39,6 +39,8 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
TriList.SetBool(UIBoolJoin.MCScreenSaverVisible, true);
|
TriList.SetBool(UIBoolJoin.MCScreenSaverVisible, true);
|
||||||
|
|
||||||
|
CurrentPositionIndex = 0;
|
||||||
|
SetCurrentPosition();
|
||||||
StartPositionTimer();
|
StartPositionTimer();
|
||||||
|
|
||||||
base.Show();
|
base.Show();
|
||||||
@@ -64,13 +66,26 @@ namespace PepperDash.Essentials
|
|||||||
if (PositionTimer == null)
|
if (PositionTimer == null)
|
||||||
{
|
{
|
||||||
PositionTimer = new CTimer((o) => PositionTimerExpired(), PositionTimeoutMs);
|
PositionTimer = new CTimer((o) => PositionTimerExpired(), PositionTimeoutMs);
|
||||||
SetCurrentPosition();
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PositionTimer.Reset(PositionTimeoutMs);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PositionTimerExpired()
|
void PositionTimerExpired()
|
||||||
{
|
{
|
||||||
if (CurrentPositionIndex <= PositionJoins.Count)
|
IncrementPositionIndex();
|
||||||
|
|
||||||
|
SetCurrentPosition();
|
||||||
|
|
||||||
|
StartPositionTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IncrementPositionIndex()
|
||||||
|
{
|
||||||
|
if (CurrentPositionIndex < PositionJoins.Count - 1)
|
||||||
{
|
{
|
||||||
CurrentPositionIndex++;
|
CurrentPositionIndex++;
|
||||||
}
|
}
|
||||||
@@ -78,6 +93,8 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
CurrentPositionIndex = 0;
|
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 roomContactNumbers = "";
|
||||||
string roomPhoneNumber = "";
|
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
|
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 = Codec.CodecInfo.SipUri;
|
||||||
roomPhoneNumber = GetFormattedPhoneNumber(Codec.CodecInfo.SipPhoneNumber);
|
|
||||||
}
|
}
|
||||||
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);
|
roomPhoneNumber = GetFormattedPhoneNumber(Codec.CodecInfo.SipPhoneNumber);
|
||||||
roomContactNumbers = Codec.CodecInfo.SipPhoneNumber;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(roomContactNumbers))
|
if (string.IsNullOrEmpty(roomContactNumbers))
|
||||||
{
|
{
|
||||||
if(!string.IsNullOrEmpty(Codec.CodecInfo.E164Alias))
|
if(!string.IsNullOrEmpty(Codec.CodecInfo.E164Alias))
|
||||||
roomContactNumbers = string.Format("{0} | {1}", Codec.CodecInfo.E164Alias, Codec.CodecInfo.H323Id);
|
roomVideoAddress = Codec.CodecInfo.E164Alias;
|
||||||
else
|
else if (!string.IsNullOrEmpty(Codec.CodecInfo.H323Id))
|
||||||
roomContactNumbers = Codec.CodecInfo.H323Id;
|
roomVideoAddress = Codec.CodecInfo.H323Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roomContactNumbers = string.Format("{0} | {1}", roomPhoneNumber, roomVideoAddress);
|
||||||
|
|
||||||
TriList.SetString(UIStringJoin.RoomAddressPipeText, roomContactNumbers);
|
TriList.SetString(UIStringJoin.RoomAddressPipeText, roomContactNumbers);
|
||||||
TriList.SetString(UIStringJoin.RoomPhoneText, roomPhoneNumber);
|
TriList.SetString(UIStringJoin.RoomPhoneText, roomPhoneNumber);
|
||||||
TriList.SetString(UIStringJoin.RoomVideoAddressText, Codec.CodecInfo.H323Id);
|
TriList.SetString(UIStringJoin.RoomVideoAddressText, roomVideoAddress);
|
||||||
|
|
||||||
if(HeaderDriver.HeaderButtonsAreSetUp)
|
if(HeaderDriver.HeaderButtonsAreSetUp)
|
||||||
HeaderDriver.ComputeHeaderCallStatus(Codec);
|
HeaderDriver.ComputeHeaderCallStatus(Codec);
|
||||||
|
|||||||
Reference in New Issue
Block a user