2022-10-27 21:20:03 +01:00
|
|
|
function AddBoolMembers () {
|
2022-01-19 21:52:59 +00:00
|
|
|
param(
|
|
|
|
[String[]]$PARAMS
|
|
|
|
)
|
2022-10-27 21:20:03 +01:00
|
|
|
[hashtable]$Signatures = @{}
|
|
|
|
foreach ($param in $PARAMS) {
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define getter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Getter"] = "[bool]`$this.Getter('{0}')" -f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define setter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Setter"] = "param ( [Single]`$arg )`n`$this.Setter('{0}', `$arg)" `
|
2022-06-25 15:20:36 +01:00
|
|
|
-f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
|
|
|
|
Addmember
|
|
|
|
}
|
2022-01-19 21:52:59 +00:00
|
|
|
}
|
2022-01-06 15:26:01 +00:00
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function AddFloatMembers () {
|
2022-01-19 21:52:59 +00:00
|
|
|
param(
|
|
|
|
[String[]]$PARAMS
|
|
|
|
)
|
2022-10-27 21:20:03 +01:00
|
|
|
[hashtable]$Signatures = @{}
|
|
|
|
foreach ($param in $PARAMS) {
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define getter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Getter"] = "[math]::Round(`$this.Getter('{0}'), 1)" -f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define setter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Setter"] = "param ( [Single]`$arg )`n`$this.Setter('{0}', `$arg)" `
|
2022-06-25 15:20:36 +01:00
|
|
|
-f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
|
|
|
|
Addmember
|
|
|
|
}
|
2022-01-19 21:52:59 +00:00
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function AddIntMembers () {
|
2022-01-19 21:52:59 +00:00
|
|
|
param(
|
|
|
|
[String[]]$PARAMS
|
|
|
|
)
|
2022-10-27 21:20:03 +01:00
|
|
|
[hashtable]$Signatures = @{}
|
|
|
|
foreach ($param in $PARAMS) {
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define getter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Getter"] = "[Int]`$this.Getter('{0}')" -f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define setter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Setter"] = "param ( [Single]`$arg )`n`$this.Setter('{0}', `$arg)" `
|
2022-06-25 15:20:36 +01:00
|
|
|
-f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
|
|
|
|
Addmember
|
|
|
|
}
|
2022-01-19 21:52:59 +00:00
|
|
|
}
|
2022-01-06 15:26:01 +00:00
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function AddStringMembers () {
|
2022-01-19 21:52:59 +00:00
|
|
|
param(
|
|
|
|
[String[]]$PARAMS
|
|
|
|
)
|
2022-10-27 21:20:03 +01:00
|
|
|
[hashtable]$Signatures = @{}
|
|
|
|
foreach ($param in $PARAMS) {
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define getter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Getter"] = "[String]`$this.Getter_String('{0}')" -f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
# Define setter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Setter"] = "param ( [String]`$arg )`n`$this.Setter('{0}', `$arg)" `
|
2022-06-25 15:20:36 +01:00
|
|
|
-f $param
|
2022-01-06 15:26:01 +00:00
|
|
|
|
2022-01-19 21:52:59 +00:00
|
|
|
Addmember
|
2022-10-27 21:20:03 +01:00
|
|
|
}
|
2022-01-19 21:52:59 +00:00
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function AddActionMembers () {
|
2022-01-19 21:52:59 +00:00
|
|
|
param(
|
|
|
|
[String[]]$PARAMS
|
|
|
|
)
|
2022-10-27 21:20:03 +01:00
|
|
|
[hashtable]$Signatures = @{}
|
|
|
|
foreach ($param in $PARAMS) {
|
2022-01-19 21:52:59 +00:00
|
|
|
# Define getter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Getter"] = "`$this.Setter('{0}', `$true)" -f $param
|
2022-01-19 21:52:59 +00:00
|
|
|
# Define setter
|
2022-03-08 22:55:11 +00:00
|
|
|
$Signatures["Setter"] = ""
|
2022-01-19 21:52:59 +00:00
|
|
|
|
2022-01-06 15:26:01 +00:00
|
|
|
Addmember
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function AddChannelMembers () {
|
2022-06-25 23:12:02 +01:00
|
|
|
$num_A = $this.remote.kind.p_out
|
|
|
|
$num_B = $this.remote.kind.v_out
|
2022-01-19 21:52:59 +00:00
|
|
|
|
|
|
|
[System.Collections.ArrayList]$channels = @()
|
|
|
|
1..$($num_A + $num_B) | ForEach-Object {
|
2022-06-25 15:20:36 +01:00
|
|
|
if ($_ -le $num_A) { $channels.Add("A{0}" -f $_) } else { $channels.Add("B{0}" -f $($_ - $num_A)) }
|
2022-01-19 21:52:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AddBoolMembers -PARAMS $channels
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function AddGainlayerMembers () {
|
|
|
|
[hashtable]$Signatures = @{}
|
2022-03-08 22:55:11 +00:00
|
|
|
0..7 | ForEach-Object {
|
|
|
|
# Define getter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Getter"] = "`$this.Getter('gainlayer[{0}]')" -f $_
|
2022-03-08 22:55:11 +00:00
|
|
|
# Define setter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Setter"] = "param ( [Single]`$arg )`n`$this.Setter('gainlayer[{0}]', `$arg)" `
|
2022-06-25 15:20:36 +01:00
|
|
|
-f $_
|
2022-03-08 22:55:11 +00:00
|
|
|
$param = "gainlayer{0}" -f $_
|
2022-10-27 21:20:03 +01:00
|
|
|
$null = $param
|
2022-03-08 22:55:11 +00:00
|
|
|
|
|
|
|
Addmember
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function AddBusModeMembers () {
|
2022-03-08 22:55:11 +00:00
|
|
|
param(
|
|
|
|
[String[]]$PARAMS
|
|
|
|
)
|
2022-10-27 21:20:03 +01:00
|
|
|
[hashtable]$Signatures = @{}
|
|
|
|
foreach ($param in $PARAMS) {
|
2022-03-08 22:55:11 +00:00
|
|
|
# Define getter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Getter"] = "[bool]`$this.Getter('mode.{0}')" -f $param
|
2022-03-08 22:55:11 +00:00
|
|
|
# Define setter
|
2022-12-16 17:40:47 +00:00
|
|
|
$Signatures["Setter"] = "param ( [Single]`$arg )`n`$this.Setter('mode.{0}', `$arg)" `
|
2022-06-25 15:20:36 +01:00
|
|
|
-f $param
|
2022-03-08 22:55:11 +00:00
|
|
|
$param = "mode_{0}" -f $param
|
|
|
|
|
|
|
|
Addmember
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-27 21:20:03 +01:00
|
|
|
function Addmember {
|
2022-01-06 15:26:01 +00:00
|
|
|
$AddMemberParams = @{
|
2022-06-25 15:20:36 +01:00
|
|
|
Name = $param
|
|
|
|
MemberType = 'ScriptProperty'
|
2022-10-27 21:20:03 +01:00
|
|
|
Value = [scriptblock]::Create($Signatures["Getter"])
|
|
|
|
SecondValue = [scriptblock]::Create($Signatures["Setter"])
|
2022-01-06 15:26:01 +00:00
|
|
|
}
|
2022-01-19 21:52:59 +00:00
|
|
|
$this | Add-Member @AddMemberParams
|
2022-01-06 15:26:01 +00:00
|
|
|
}
|