From dd404ae3370070d035f05ff8ba6ae1cb722907b0 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:27:17 -0500 Subject: [PATCH 1/3] monitoringBus, types - add monitoringBus for convenience for Bus[i].Monitor since only one will be true - cast getters to [int] for type consistency --- lib/option.ps1 | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/option.ps1 b/lib/option.ps1 index cae66f2..cf60f55 100644 --- a/lib/option.ps1 +++ b/lib/option.ps1 @@ -24,7 +24,7 @@ class Option : IRemote { hidden $_sr = $($this | Add-Member ScriptProperty 'sr' ` { - $this.Getter('sr') + [int]$this.Getter('sr') } ` { param([int]$arg) @@ -37,6 +37,28 @@ class Option : IRemote { } } ) + + hidden $_monitoringBus = $($this | Add-Member ScriptProperty 'monitoringBus' ` + { + foreach ($bus in 0..$($this.remote.kind.p_out + $this.remote.kind.v_out - 1)) { + if ($this.remote.Getter("Bus[$bus].Monitor")) { + break + } + } + return $bus + } ` + { + param([int]$arg) + $busMax = $this.remote.kind.p_out + $this.remote.kind.v_out - 1 + if ($arg -ge 0 -and $arg -le $busMax) { + $this._monitoringBus = $this.remote.Setter("Bus[$arg].Monitor", $arg) + } + else { + Write-Warning ("Expected a bus index between 0 and $busMax") + } + } + ) + } class OptionBuffer : IRemote { @@ -48,7 +70,7 @@ class OptionBuffer : IRemote { hidden $_mme = $($this | Add-Member ScriptProperty 'mme' ` { - $this.Getter('mme') + [int]$this.Getter('mme') } ` { param([int]$arg) @@ -64,7 +86,7 @@ class OptionBuffer : IRemote { hidden $_wdm = $($this | Add-Member ScriptProperty 'wdm' ` { - $this.Getter('wdm') + [int]$this.Getter('wdm') } ` { param([int]$arg) @@ -80,7 +102,7 @@ class OptionBuffer : IRemote { hidden $_ks = $($this | Add-Member ScriptProperty 'ks' ` { - $this.Getter('ks') + [int]$this.Getter('ks') } ` { param([int]$arg) @@ -96,7 +118,7 @@ class OptionBuffer : IRemote { hidden $_asio = $($this | Add-Member ScriptProperty 'asio' ` { - $this.Getter('asio') + [int]$this.Getter('asio') } ` { param([int]$arg) From 5f064de01097d28abdfe7bd2b9283b560ec2668f Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 16:41:36 -0500 Subject: [PATCH 2/3] Update higher.Tests.ps1 pester tests pass for all types manual tests for safety pass - buffer.asio --- tests/higher.Tests.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index de9825f..4c94b5c 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -573,6 +573,13 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' { Start-Sleep -Milliseconds 500 $vmr.option.sr | Should -Be $value } + + It 'Should set and get Option.MonitoringBus' -Skip:$ifNotPotato -ForEach @( + @{ Value = $phys_out }, @{ Value = $virt_out } + ) { + $vmr.option.monitoringbus = $value + $vmr.option.monitoringbus | Should -Be $value + } Context 'Option.buffer' -ForEach @( @{ Value = 1024 }, @{ Value = 512 } From 6e74db2751a8822c61a5eb9e18ac5174f8f0e7f0 Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Mon, 1 Dec 2025 17:19:50 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index aa4707e..e395a47 100644 --- a/README.md +++ b/README.md @@ -491,6 +491,7 @@ The following Option commands are available: - asiosr: bool - monitorOnSel: bool - sliderMode: bool +- monitoringBus: int, from 0 to bus index The following Option.delay[i] methods are available: