From b457886ee32306f45f47b6c63c8b7a7bb187109b Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Mon, 2 Nov 2020 12:38:23 -0700 Subject: [PATCH 1/9] Update to route correctly for DMPS3-4K --- .../Chassis/DmpsRoutingController.cs | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs index adf73bde..9970be5c 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs @@ -813,36 +813,42 @@ namespace PepperDash.Essentials.DM } } - DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; - DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput; - + DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; + DMOutput dmOutputCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput; + //if (inCard != null) //{ // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES - if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video) + if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) { - //SystemControl.VideoEnter.BoolValue = true; - if (outCard != null) - outCard.VideoOut = inCard; + if (dmOutputCard != null) + dmOutputCard.VideoOut = dmInputCard; } - if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio) + if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio) { - if (outCard != null) - outCard.AudioOut = inCard; + if (dmOutputCard != null) + try + { + dmOutputCard.AudioOut = dmInputCard; + } + catch (NotSupportedException) + { + dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input; + } } - if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) + if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) { - if (outCard != null) - outCard.USBRoutedTo = inCard; + if (dmOutputCard != null) + dmOutputCard.USBRoutedTo = dmInputCard; } - if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) + if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) { - if (inCard != null) - inCard.USBRoutedTo = outCard; + if (dmInputCard != null) + dmInputCard.USBRoutedTo = dmOutputCard; } //} //else From 3cd8a1f310ad635c94aba3c2c06deac82ffec3f8 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 3 Nov 2020 08:30:13 -0700 Subject: [PATCH 2/9] update output change event & feedbacks --- .../Chassis/DmpsRoutingController.cs | 51 ++++++++++++++----- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs index 9970be5c..06d9d7b6 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs @@ -351,10 +351,19 @@ namespace PepperDash.Essentials.DM ; }); AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() => - { - if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; } - return 0; - ; + { + try + { + if (outputCard.AudioOutFeedback != null) + { + return (ushort) outputCard.AudioOutFeedback.Number; + } + return 0; + } + catch (NotSupportedException) + { + return (ushort) outputCard.AudioOutSourceFeedback; + } }); OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() => @@ -753,15 +762,31 @@ namespace PepperDash.Essentials.DM } } else if (args.EventId == DMOutputEventIds.AudioOutEventId) - { - if (outputCard != null && outputCard.AudioOutFeedback != null) - { - Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, outputCard.AudioOutFeedback.Number, output); - } - if (AudioOutputFeedbacks.ContainsKey(output)) - { - AudioOutputFeedbacks[output].FireUpdate(); - } + { + try + { + if (outputCard != null && outputCard.AudioOutFeedback != null) + { + Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", this.Name, + outputCard.AudioOutFeedback.Number, output); + } + if (AudioOutputFeedbacks.ContainsKey(output)) + { + AudioOutputFeedbacks[output].FireUpdate(); + } + } + catch (NotSupportedException) + { + if (outputCard != null) + { + Debug.Console(2, this, "DMSwitchAudio:{0} Routed Input:{1} Output:{2}'", Name, + outputCard.AudioOutSourceFeedback, output); + } + if (AudioOutputFeedbacks.ContainsKey(output)) + { + AudioOutputFeedbacks[output].FireUpdate(); + } + } } else if (args.EventId == DMOutputEventIds.OutputNameEventId && OutputNameFeedbacks.ContainsKey(output)) From 88f1230620999dd555967435b4d99eee72ade9a1 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 4 Nov 2020 14:43:17 -0600 Subject: [PATCH 3/9] got it all working --- .../Chassis/DmpsRoutingController.cs | 152 ++++++++++-------- 1 file changed, 86 insertions(+), 66 deletions(-) diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs index 06d9d7b6..051ef88e 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmpsRoutingController.cs @@ -818,74 +818,94 @@ namespace PepperDash.Essentials.DM Debug.Console(2, this, "Attempting a DM route from input {0} to output {1} {2}", inputSelector, outputSelector, sigType); var input = Convert.ToUInt32(inputSelector); // Cast can sometimes fail - var output = Convert.ToUInt32(outputSelector); - - if (input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs) - { - // Check to see if there's an off timer waiting on this and if so, cancel - var key = new PortNumberType(output, sigType); - if (input == 0) - { - StartOffTimer(key); - } - else if (key.Number > 0) - { - if (RouteOffTimers.ContainsKey(key)) - { - Debug.Console(2, this, "{0} cancelling route off due to new source", output); - RouteOffTimers[key].Stop(); - RouteOffTimers.Remove(key); - } - } - - DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; + var output = Convert.ToUInt32(outputSelector); + + var sigTypeIsUsbOrVideo = ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) || + ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) || + ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput); + + if ((input <= Dmps.NumberOfSwitcherInputs && output <= Dmps.NumberOfSwitcherOutputs && + sigTypeIsUsbOrVideo) || + (input <= Dmps.NumberOfSwitcherInputs + 5 && output <= Dmps.NumberOfSwitcherOutputs && + (sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)) + { + // Check to see if there's an off timer waiting on this and if so, cancel + var key = new PortNumberType(output, sigType); + if (input == 0) + { + StartOffTimer(key); + } + else if (key.Number > 0) + { + if (RouteOffTimers.ContainsKey(key)) + { + Debug.Console(2, this, "{0} cancelling route off due to new source", output); + RouteOffTimers[key].Stop(); + RouteOffTimers.Remove(key); + } + } + + DMOutput dmOutputCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput; - //if (inCard != null) - //{ - // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES - if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) - { - //SystemControl.VideoEnter.BoolValue = true; - if (dmOutputCard != null) - dmOutputCard.VideoOut = dmInputCard; - } - - if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio) - { - if (dmOutputCard != null) - try - { - dmOutputCard.AudioOut = dmInputCard; - } - catch (NotSupportedException) - { - dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input; - } - } - - if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) - { - if (dmOutputCard != null) - dmOutputCard.USBRoutedTo = dmInputCard; - } - - if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) - { - if (dmInputCard != null) - dmInputCard.USBRoutedTo = dmOutputCard; - } - //} - //else - //{ - // Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector); - //} - - } - else - { - Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector, outputSelector); - } + //if (inCard != null) + //{ + // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES + if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video) + { + DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; + //SystemControl.VideoEnter.BoolValue = true; + if (dmOutputCard != null) + dmOutputCard.VideoOut = dmInputCard; + } + + if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio) + { + DMInput dmInputCard = null; + if (input <= Dmps.NumberOfSwitcherInputs) + { + dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; + } + + if (dmOutputCard != null) + try + { + dmOutputCard.AudioOut = dmInputCard; + } + catch (NotSupportedException) + { + Debug.Console(1, this, "Routing input {0} audio to output {1}", + (eDmps34KAudioOutSource) input, (CrestronControlSystem.eDmps34K350COutputs) output); + + dmOutputCard.AudioOutSource = (eDmps34KAudioOutSource) input; + } + } + + if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) + { + DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; + if (dmOutputCard != null) + dmOutputCard.USBRoutedTo = dmInputCard; + } + + if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) + { + DMInput dmInputCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; + if (dmInputCard != null) + dmInputCard.USBRoutedTo = dmOutputCard; + } + //} + //else + //{ + // Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector); + //} + + } + else + { + Debug.Console(1, this, "Unable to execute route from input {0} to output {1}", inputSelector, + outputSelector); + } } catch (Exception e) { From 38ab6626fc4264ded1d6d9c5fee315080371a3eb Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 12:30:15 -0700 Subject: [PATCH 4/9] update PD Core to 1.0.43 --- packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.config b/packages.config index 296413b6..c138dd1b 100644 --- a/packages.config +++ b/packages.config @@ -1,3 +1,3 @@ - + \ No newline at end of file From 4903b99eb5dfdaf20a83f2d23d175f60aabda0af Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 12:38:50 -0700 Subject: [PATCH 5/9] fix main workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 72720299..4fc492bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: shell: powershell env: TAG_NAME: ${{ github.event.release.tag_name }} - run: echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + run: echo "VERSION=$($Env:TAG_NAME)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append # Use the version number to set the version of the assemblies - name: Update AssemblyInfo.cs shell: powershell From 6557d21aa8c7c2b5c44dda831f1b311f6fea5c76 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 14:41:58 -0700 Subject: [PATCH 6/9] change action to use master instead of v1 --- .github/workflows/docker.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 89e463ec..69ff9160 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -140,7 +140,7 @@ jobs: Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ Remove-Item -Path .\output -Recurse - name: Add nuget.exe - uses: nuget/setup-nuget@v1 + uses: nuget/setup-nuget@master - name: Add Github Packages source run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} - name: Add nuget.org API Key diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4fc492bf..9197437e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ Remove-Item -Path .\output -Recurse - name: Add nuget.exe - uses: nuget/setup-nuget@v1 + uses: nuget/setup-nuget@master - name: Add Github Packages source run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} - name: Add nuget.org API Key From faa6e20034f098a148a158ad8dfc0c8e620aaea7 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 15:45:50 -0700 Subject: [PATCH 7/9] specifying version for nuget action --- .github/workflows/docker.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 69ff9160..f97d642f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -140,7 +140,7 @@ jobs: Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ Remove-Item -Path .\output -Recurse - name: Add nuget.exe - uses: nuget/setup-nuget@master + uses: nuget/setup-nuget@v1.0.2 - name: Add Github Packages source run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} - name: Add nuget.org API Key diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9197437e..c68425b8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ Remove-Item -Path .\output -Recurse - name: Add nuget.exe - uses: nuget/setup-nuget@master + uses: nuget/setup-nuget@v1.0.2 - name: Add Github Packages source run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} - name: Add nuget.org API Key From 5b889ea59c2e2913c795c92beffea92902691fda Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 11 Nov 2020 16:36:56 -0700 Subject: [PATCH 8/9] back to original version --- .github/workflows/docker.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f97d642f..89e463ec 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -140,7 +140,7 @@ jobs: Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ Remove-Item -Path .\output -Recurse - name: Add nuget.exe - uses: nuget/setup-nuget@v1.0.2 + uses: nuget/setup-nuget@v1 - name: Add Github Packages source run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} - name: Add nuget.org API Key diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c68425b8..4fc492bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ Remove-Item -Path .\output -Recurse - name: Add nuget.exe - uses: nuget/setup-nuget@v1.0.2 + uses: nuget/setup-nuget@v1 - name: Add Github Packages source run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} - name: Add nuget.org API Key From 5a3597f2a73efbebc012dcd98b827aa5a494f8b2 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Thu, 12 Nov 2020 08:28:19 -0700 Subject: [PATCH 9/9] minor change to generate new build number --- .github/workflows/docker.yml | 1 - .github/workflows/main.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 89e463ec..003b1f66 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -45,7 +45,6 @@ jobs: - name: Update AssemblyInfo.cs shell: powershell run: | - Write-Output ${{ env.VERSION }} ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} - name: restore Nuget Packages run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4fc492bf..f1a6a278 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,6 @@ jobs: - name: Update AssemblyInfo.cs shell: powershell run: | - Write-Output ${{ env.VERSION }} ./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }} - name: restore Nuget Packages run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion