Very elusive null ref in routing/usage tracking; adding bits and pieces to codecs

This commit is contained in:
Heath Volmer
2017-09-15 10:01:18 -06:00
parent dc3cc1d4eb
commit 16e1185fdf
8 changed files with 139 additions and 122 deletions

View File

@@ -14,7 +14,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public MockVC(string key, string name) public MockVC(string key, string name)
: base(key, name) : base(key, name)
{ {
MuteFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
VolumeLevelFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);
InCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "InCall={0}", _InCall);
IncomingCallFeedback.OutputChange += (o, a) => Debug.Console(1, this, "IncomingCall={0}", _IncomingCall);
TransmitLevelFeedback.OutputChange += (o,a)=> Debug.Console(1, this, "TransmitLevel={0}", _tra
} }
protected override Func<bool> InCallFeedbackFunc protected override Func<bool> InCallFeedbackFunc
@@ -29,6 +33,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
} }
bool _IncomingCall; bool _IncomingCall;
protected override Func<bool> TransmitMuteFeedbackFunc protected override Func<bool> TransmitMuteFeedbackFunc
{ {
get { return () => _TransmitMute; } get { return () => _TransmitMute; }

View File

@@ -32,6 +32,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
abstract protected Func<bool> ReceiveMuteFeedbackFunc { get; } abstract protected Func<bool> ReceiveMuteFeedbackFunc { get; }
abstract protected Func<bool> PrivacyModeFeedbackFunc { get; } abstract protected Func<bool> PrivacyModeFeedbackFunc { get; }
#warning WILL ADD TRANSMIT AND REVEICE LEVEL FUNCS AFTER MERGE
abstract protected Func<int> VolumeLevelFeedbackFunc { get; } abstract protected Func<int> VolumeLevelFeedbackFunc { get; }
abstract protected Func<bool> MuteFeedbackFunc { get; } abstract protected Func<bool> MuteFeedbackFunc { get; }
@@ -43,6 +44,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
ReceiveMuteIsOnFeedback = new BoolFeedback(ReceiveMuteFeedbackFunc); ReceiveMuteIsOnFeedback = new BoolFeedback(ReceiveMuteFeedbackFunc);
TransmitMuteIsOnFeedback = new BoolFeedback(TransmitMuteFeedbackFunc); TransmitMuteIsOnFeedback = new BoolFeedback(TransmitMuteFeedbackFunc);
PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeFeedbackFunc); PrivacyModeIsOnFeedback = new BoolFeedback(PrivacyModeFeedbackFunc);
#warning ADDING TX/RX FEEDBACKS HERE
VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc); VolumeLevelFeedback = new IntFeedback(VolumeLevelFeedbackFunc);
MuteFeedback = new BoolFeedback(MuteFeedbackFunc); MuteFeedback = new BoolFeedback(MuteFeedbackFunc);

View File

@@ -128,12 +128,12 @@ namespace PepperDash.Essentials
} }
// CODEC TESTING // CODEC TESTING
GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6"); //GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6");
PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec TestCodec = //PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec TestCodec =
new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080); // new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080);
TestCodec.CustomActivate(); //TestCodec.CustomActivate();
// CODEC TESTING // CODEC TESTING
} }

View File

@@ -235,8 +235,8 @@ namespace PepperDash.Essentials
public void RunRouteAction(string routeKey, Action successCallback) public void RunRouteAction(string routeKey, Action successCallback)
{ {
// Run this on a separate thread // Run this on a separate thread
//new CTimer(o => new CTimer(o =>
// { {
try try
{ {
@@ -259,18 +259,20 @@ namespace PepperDash.Essentials
// End usage timer on last source // End usage timer on last source
if (!string.IsNullOrEmpty(LastSourceKey)) if (!string.IsNullOrEmpty(LastSourceKey))
{ {
var lastSource = dict[LastSourceKey].SourceDevice; var usageLastSource = dict[LastSourceKey].SourceDevice as IUsageTracking;
if (usageLastSource != null && usageLastSource.UsageTracker != null)
{
try try
{ {
if (lastSource != null && lastSource is IUsageTracking) // There MAY have been failures in here. Protect
(lastSource as IUsageTracking).UsageTracker.EndDeviceUsage(); usageLastSource.UsageTracker.EndDeviceUsage();
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e); Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e);
} }
} }
}
// Let's run it // Let's run it
var item = dict[routeKey]; var item = dict[routeKey];
@@ -284,8 +286,11 @@ namespace PepperDash.Essentials
DoRouteItem(route); DoRouteItem(route);
// Start usage timer on routed source // Start usage timer on routed source
if (item.SourceDevice is IUsageTracking) var usageNewSource = item.SourceDevice as IUsageTracking;
if (usageNewSource != null && usageNewSource.UsageTracker != null) // Have to make sure there is a usage tracker!
{
(item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage(); (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
}
// store the name and UI info for routes // store the name and UI info for routes
if (item.SourceKey == "$off") if (item.SourceKey == "$off")
@@ -310,7 +315,7 @@ namespace PepperDash.Essentials
Debug.Console(1, this, "ERROR in routing: {0}", e); Debug.Console(1, this, "ERROR in routing: {0}", e);
} }
//}, 0); // end of CTimer }, 0); // end of CTimer
} }
/// <summary> /// <summary>

View File

@@ -388,7 +388,7 @@ namespace PepperDash.Essentials
b => { if (!b) ActivityShareButtonPressed(); })); b => { if (!b) ActivityShareButtonPressed(); }));
ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(3, ActivityFooterSrl, ActivityFooterSrl.AddItem(new SubpageReferenceListActivityItem(3, ActivityFooterSrl,
3, b => { if (!b) PowerButtonPressed(); })); 3, b => { if (!b) PowerButtonPressed(); }));
ActivityFooterSrl.Count = 2; ActivityFooterSrl.Count = 3;
TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 1; TriList.UShortInput[UIUshortJoin.PresentationListCaretMode].UShortValue = 1;
EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1); EndMeetingButtonSig = ActivityFooterSrl.BoolInputSig(3, 1);
@@ -757,7 +757,11 @@ namespace PepperDash.Essentials
} }
} }
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void IsCoolingDownFeedback_OutputChange(object sender, EventArgs e) void IsCoolingDownFeedback_OutputChange(object sender, EventArgs e)
{ {
var value = CurrentRoom.IsCoolingDownFeedback.BoolValue; var value = CurrentRoom.IsCoolingDownFeedback.BoolValue;