From 840fb21e153923a07811f35d4f2c446d458a889e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 18 Mar 2021 12:42:29 -0600 Subject: [PATCH 1/9] Added console command to list events for a group --- .../Global/Scheduler.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs index fb305172..e07ef496 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs @@ -24,6 +24,10 @@ namespace PepperDash.Essentials.Core CrestronConsole.AddNewConsoleCommand(ClearEventsFromGroup, "ClearAllEvents", "Clears all scheduled events for this group", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(ListAllEventGroups, "ListAllEventGroups", "Lists all the event groups by key", ConsoleAccessLevelEnum.AccessOperator); + + CrestronConsole.AddNewConsoleCommand(ListAllEventsForGroup, "ListEventsForGroup", + "Lists all events for the given group", ConsoleAccessLevelEnum.AccessOperator); + } /// @@ -49,6 +53,33 @@ namespace PepperDash.Essentials.Core } } + static void ListAllEventsForGroup(string args) + { + Debug.Console(0, "Getting events for group {0}...", args); + + ScheduledEventGroup group; + + if (!EventGroups.TryGetValue(args, out group)) + { + Debug.Console(0, "Unabled to get event group for key {0}", args); + return; + } + + foreach (var evt in group.ScheduledEvents) + { + Debug.Console(0, + @" +****Event key {0}**** +Event date/time: {1} +Persistent: {2} +Acknowlegable: {3} +Recurrence: {4} +Recurrence Days: {5} +********************", evt.Key, evt.Value.DateAndTime, evt.Value.Persistent, evt.Value.Acknowledgeable, + evt.Value.Recurrence.Recurrence, evt.Value.Recurrence.RecurrenceDays); + } + } + /// /// Adds the event group to the global list /// From a9fce3237cb2db50cb4b2c73b758f3aedf45a712 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 18 Mar 2021 12:43:29 -0600 Subject: [PATCH 2/9] Added check for key to Clear command If the key was wrong or wasn't in the group, a `KeyNotFoundException` was thrown. Also added acknowledgment of a successful deletion --- .../PepperDashEssentialsBase/Global/Scheduler.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs index e07ef496..928f5557 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs @@ -36,12 +36,26 @@ namespace PepperDash.Essentials.Core /// static void ClearEventsFromGroup(string groupName) { + if (!EventGroups.ContainsKey(groupName)) + { + Debug.Console(0, + "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", + groupName); + return + } + var group = EventGroups[groupName]; if (group != null) + { group.ClearAllEvents(); + + Debug.Console(0, "[Scheduler]: All events deleted from group '{0}'", groupName); + } else - Debug.Console(0, "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", groupName); + Debug.Console(0, + "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", + groupName); } static void ListAllEventGroups(string command) From 085ba134c46109b8d737008d5976f13a2a28397c Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 18 Mar 2021 12:44:20 -0600 Subject: [PATCH 3/9] Set event to not be acknowledgable Added logic to acknowledge event Added debug statement to show that event was being fired --- .../Behaviours/RoomOnToDefaultSourceWhenOccupied.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs index 11debb03..f24daf82 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Room/Behaviours/RoomOnToDefaultSourceWhenOccupied.cs @@ -169,10 +169,15 @@ namespace PepperDash.Essentials.Core void FeatureEventGroup_UserGroupCallBack(ScheduledEvent SchEvent, ScheduledEventCommon.eCallbackReason type) { + Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "{0}:{1} @ {2}", SchEvent.Name, type, DateTime.Now); + if (type == ScheduledEventCommon.eCallbackReason.NormalExpiration) { + SchEvent.Acknowledge(); + if (SchEvent.Name == FeatureEnableEventName) { + if (PropertiesConfig.EnableRoomOnWhenOccupied) FeatureEnabled = true; @@ -248,9 +253,8 @@ namespace PepperDash.Essentials.Core schEvent = new ScheduledEvent(name, FeatureEventGroup); // Set up its initial properties - - if(!schEvent.Acknowledgeable) - schEvent.Acknowledgeable = true; + + schEvent.Acknowledgeable = false; if(!schEvent.Persistent) schEvent.Persistent = true; @@ -287,7 +291,7 @@ namespace PepperDash.Essentials.Core Debug.Console(1, this, "Event '{0}' Absolute time set to {1}", schEvent.Name, schEvent.DateAndTime.ToString()); - CalculateAndSetAcknowledgeExpirationTimeout(schEvent, FeatureEnabledTime, FeatureDisabledTime); + //CalculateAndSetAcknowledgeExpirationTimeout(schEvent, FeatureEnabledTime, FeatureDisabledTime); schEvent.Recurrence.Weekly(eventRecurrennce); From 0228fd1c0f857406c1d4249d36446ece0281d506 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 18 Mar 2021 16:27:08 -0600 Subject: [PATCH 4/9] fix a ; --- .../PepperDashEssentialsBase/Global/Scheduler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs index 928f5557..960a56ef 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs @@ -41,7 +41,7 @@ namespace PepperDash.Essentials.Core Debug.Console(0, "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", groupName); - return + return; } var group = EventGroups[groupName]; From da63d0917ea6a3592ccb148efb1f6d2c06d3646e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 19 Mar 2021 09:03:05 -0600 Subject: [PATCH 5/9] Updates to test new builder image this build WILL fail --- .github/workflows/docker.yml | 2 +- .../PepperDashEssentialsBase/Global/Scheduler.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d429cdc0..1700b2e3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,7 +58,7 @@ jobs: - name: Build Solution shell: powershell run: | - Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder:dev c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" # Zip up the output files as needed - name: Zip Build Output shell: powershell diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs index 960a56ef..928f5557 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs @@ -41,7 +41,7 @@ namespace PepperDash.Essentials.Core Debug.Console(0, "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", groupName); - return; + return } var group = EventGroups[groupName]; From 61b4002e5ad5f2f1add9790de0b5685fa700fe33 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 19 Mar 2021 09:22:21 -0600 Subject: [PATCH 6/9] Fix to test build image again --- .../PepperDashEssentialsBase/Global/Scheduler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs index 928f5557..960a56ef 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Global/Scheduler.cs @@ -41,7 +41,7 @@ namespace PepperDash.Essentials.Core Debug.Console(0, "[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", groupName); - return + return; } var group = EventGroups[groupName]; From c4a6d20791149d4171447499cc814dd0fd052818 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 22 Mar 2021 09:23:07 -0600 Subject: [PATCH 7/9] fixing a nullref issue with cisco spark --- .../VideoCodec/CiscoCodec/CiscoSparkCodec.cs | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs index af7233fb..21e5bd3a 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoSparkCodec.cs @@ -368,21 +368,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco CodecSchedule = new CodecScheduleAwareness(); //Set Feedback Actions - CodecStatus.Status.Audio.Volume.ValueChangedAction = VolumeLevelFeedback.FireUpdate; - CodecStatus.Status.Audio.VolumeMute.ValueChangedAction = MuteFeedback.FireUpdate; - CodecStatus.Status.Audio.Microphones.Mute.ValueChangedAction = PrivacyModeIsOnFeedback.FireUpdate; - CodecStatus.Status.Standby.State.ValueChangedAction = StandbyIsOnFeedback.FireUpdate; - CodecStatus.Status.RoomAnalytics.PeoplePresence.ValueChangedAction = RoomIsOccupiedFeedback.FireUpdate; - CodecStatus.Status.RoomAnalytics.PeopleCount.Current.ValueChangedAction = PeopleCountFeedback.FireUpdate; - CodecStatus.Status.Cameras.SpeakerTrack.Status.ValueChangedAction = CameraAutoModeIsOnFeedback.FireUpdate; - CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate; - CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus; - CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout; - CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = SharingContentIsOnFeedback.FireUpdate; - CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = FarEndIsSharingContentFeedback.FireUpdate; - CodecStatus.Status.Video.Input.MainVideoMute.ValueChangedAction = CameraIsOffFeedback.FireUpdate; + SetFeedbackActions(); - CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.Audio | eRoutingSignalType.Video, + CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, new Action(StopSharing), this); HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this); @@ -418,7 +406,36 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco _brandingUrl = props.UiBranding.BrandingUrl; } - /// + private void SetFeedbackActions() + { + CodecStatus.Status.Audio.Volume.ValueChangedAction = VolumeLevelFeedback.FireUpdate; + CodecStatus.Status.Audio.VolumeMute.ValueChangedAction = MuteFeedback.FireUpdate; + CodecStatus.Status.Audio.Microphones.Mute.ValueChangedAction = PrivacyModeIsOnFeedback.FireUpdate; + CodecStatus.Status.Standby.State.ValueChangedAction = StandbyIsOnFeedback.FireUpdate; + CodecStatus.Status.RoomAnalytics.PeoplePresence.ValueChangedAction = RoomIsOccupiedFeedback.FireUpdate; + CodecStatus.Status.RoomAnalytics.PeopleCount.Current.ValueChangedAction = PeopleCountFeedback.FireUpdate; + CodecStatus.Status.Cameras.SpeakerTrack.Status.ValueChangedAction = CameraAutoModeIsOnFeedback.FireUpdate; + CodecStatus.Status.Video.Selfview.Mode.ValueChangedAction = SelfviewIsOnFeedback.FireUpdate; + CodecStatus.Status.Video.Selfview.PIPPosition.ValueChangedAction = ComputeSelfviewPipStatus; + CodecStatus.Status.Video.Layout.LayoutFamily.Local.ValueChangedAction = ComputeLocalLayout; + CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = SharingContentIsOnFeedback.FireUpdate; + CodecStatus.Status.Conference.Presentation.Mode.ValueChangedAction = FarEndIsSharingContentFeedback.FireUpdate; + try + { + CodecStatus.Status.Video.Input.MainVideoMute.ValueChangedAction = CameraIsOffFeedback.FireUpdate; + } + catch (Exception ex) + { + Debug.Console(0, this, "Error setting MainVideuMute Action: {0}", ex); + + if (ex.InnerException != null) + { + Debug.Console(0, this, "Error setting MainVideuMute Action: {0}", ex); + } + } + } + + /// /// Creates the fake OSD source, and connects it's AudioVideo output to the CodecOsdIn input /// to enable routing /// From 008279e8677abe120824062f4204fa8fb3cbef6e Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 22 Mar 2021 09:39:08 -0600 Subject: [PATCH 8/9] Initialize some properties that were causing a nullRef --- .../VideoCodec/CiscoCodec/xStatus.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs index 7fa4e655..676737c4 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs @@ -8,6 +8,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using PepperDash.Core; +using PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodec; namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { @@ -1680,6 +1681,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco public MainVideoSource MainVideoSource { get; set; } public MainVideoMute MainVideoMute { get; set; } public List Source { get; set; } + + public Input2() + { + MainVideoMute = new MainVideoMute(); + } } public class Local : ValueProperty @@ -1875,6 +1881,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco { Selfview = new Selfview(); Layout = new Layout(); + Input = new Input2(); } } From 6443e004282a0662cc4604186c35c638332217af Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 22 Mar 2021 09:48:23 -0600 Subject: [PATCH 9/9] update back to latest builder image --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1700b2e3..d429cdc0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -58,7 +58,7 @@ jobs: - name: Build Solution shell: powershell run: | - Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder:dev c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" + Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" # Zip up the output files as needed - name: Zip Build Output shell: powershell