From d41e905ab01a3ff8170474c429be68a66e56be7d Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 2 Sep 2022 10:30:45 -0600 Subject: [PATCH] Release 1.101 Signed-off-by: matt --- .../Distortion/ImdA01.cs | 6 +-- .../Distortion/ImdA03.cs | 6 +-- .../Distortion/ThdA01.cs | 6 +-- .../Distortion/ThdA03.cs | 6 +-- .../Distortion/ThdB03.cs | 6 +-- .../Distortion/ThdNA01.cs | 6 +-- .../GainLevel/FreqResponseA01.cs | 12 ++--- .../GainLevel/FreqResponseA03.cs | 6 +-- .../GainLevel/GainA01.cs | 9 ++-- .../GainLevel/GainA03.cs | 6 +-- .../GainLevel/GainSorted3A01.cs | 6 +-- .../GainLevel/GainSorted5A01.cs | 6 +-- .../GainLevel/RmsLevelA01.cs | 6 +-- .../GainLevel/RmsLevelA03.cs | 6 +-- .../ObjectEditorUiBuilder.cs | 48 +++++++++++++++++-- .../Other/EfficiencyA07.cs | 6 +-- .../Other/ImpedanceA03.cs | 6 +-- .../Other/MicCompareA01.cs | 7 ++- Tractor/Constants.cs | 2 +- Tractor/Releases.txt | 5 +- 20 files changed, 104 insertions(+), 63 deletions(-) diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA01.cs index 3cb72cb..f4d0ae3 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA01.cs @@ -23,8 +23,8 @@ public class ImdA01 : AudioTestBase [ObjectEditorAttribute(Index = 210, DisplayText = "Analyzer Output Level (dBV)", MinValue = -50, MaxValue = 6)] public float AnalyzerOutputLevel = -10; - [ObjectEditorAttribute(Index = 215, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 215, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public ImdA01() : base() { @@ -41,7 +41,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); // The RMS of two distinct but equal tones is 3 dBV above level of the tones diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA03.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA03.cs index 92bc478..92ddcce 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA03.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ImdA03.cs @@ -35,8 +35,8 @@ public class ImdA03 : AudioTestBase [ObjectEditorAttribute(Index = 215, DisplayText = "Load Impedance", ValidInts = new int[] { 8, 4 })] public int ProgrammableLoadImpedance = 8; - [ObjectEditorAttribute(Index = 220, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 220, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public ImdA03() : base() @@ -54,7 +54,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IProgrammableLoad)Tm.TestClass).SetImpedance(ProgrammableLoadImpedance); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA01.cs index 1f9f3c3..4fbfbb8 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA01.cs @@ -25,8 +25,8 @@ public class ThdA01 : AudioTestBase [ObjectEditorAttribute(Index = 240, DisplayText = "Maximum THD to Pass (dB)", MinValue = -150, MaxValue = 10, MustBeGreaterThanIndex = 230)] public float MaximumOKTHD = -100; - [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int InputRange = 6; + [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public ThdA01() : base() { @@ -43,7 +43,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(InputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen1(true, OutputLevel, Freq); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen2(false, OutputLevel, Freq); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA03.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA03.cs index f0166c5..62c2596 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA03.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdA03.cs @@ -28,8 +28,8 @@ public class ThdA03 : AudioTestBase [ObjectEditorAttribute(Index = 250, DisplayText = "Load Impedance (ohms)", ValidInts = new int[] { 8, 4 })] public int ProgrammableLoadImpedance = 8; - [ObjectEditorAttribute(Index = 260, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int InputRange = 6; + [ObjectEditorAttribute(Index = 260, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public ThdA03() : base() { @@ -46,7 +46,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(InputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IProgrammableLoad)Tm.TestClass).SetImpedance(ProgrammableLoadImpedance); if (LeftChannel == true && RightChannel == false) diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdB03.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdB03.cs index 6afe847..ca1ce0d 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdB03.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdB03.cs @@ -28,8 +28,8 @@ public class ThdB03 : AudioTestBase [ObjectEditorAttribute(Index = 250, DisplayText = "Load Impedance (ohms)", ValidInts = new int[] { 8, 4 })] public int LoadImpedance = 8; - [ObjectEditorAttribute(Index = 260, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int InputRange = 6; + [ObjectEditorAttribute(Index = 260, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public ThdB03() : base() { @@ -46,7 +46,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(InputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IProgrammableLoad)Tm.TestClass).SetImpedance(LoadImpedance); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen1(true, OutputLevel, Freq); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdNA01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdNA01.cs index 56aaa98..a683e01 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdNA01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Distortion/ThdNA01.cs @@ -31,8 +31,8 @@ public class ThdNA01 : AudioTestBase [ObjectEditorAttribute(Index = 240, DisplayText = "Maximum THD+N to Pass (dB)", MinValue = -130, MaxValue = 100, MustBeGreaterThanIndex = 230)] public float MaximumOkThdN = -100; - [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int InputRange = 6; + [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public ThdNA01() : base() { @@ -49,7 +49,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(InputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen1(true, OutputLevel, Freq); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen2(false, OutputLevel, Freq); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA01.cs index 04d4843..9b28df6 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA01.cs @@ -20,14 +20,8 @@ public class FreqResponseA01 : AudioTestBase [ObjectEditorAttribute(Index = 215, DisplayText = "Mask File Name", IsFileName = true, MaxLength = 512)] public string MaskFileName = ""; - [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; - - //[ObjectEditorAttribute(Index = 270, DisplayText = "Display Y Max)", MinValue = -200, MaxValue = 200, MustBeGreaterThanIndex = 280)] - //public int YMax = 10; - - //[ObjectEditorAttribute(Index = 280, DisplayText = "Display Y Min)", MinValue = -200, MaxValue = 200)] - //public int YMin = -20; + [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public FreqResponseA01() : base() { @@ -45,7 +39,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).DoFrAquisition(AnalyzerOutputLevel, 0, SmoothingDenominator); ((IAudioAnalyzer)Tm.TestClass).TestMask(MaskFileName, LeftChannel, RightChannel, false, out bool passLeft, out bool passRight, out _); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA03.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA03.cs index d341acd..21afa65 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA03.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/FreqResponseA03.cs @@ -20,8 +20,8 @@ public class FreqResponseA03 : AudioTestBase [ObjectEditorAttribute(Index = 215, DisplayText = "Mask File Name", IsFileName = true, MaxLength = 512)] public string MaskFileName = ""; - [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; [ObjectEditorAttribute(Index = 260, DisplayText = "Load Impedance (ohms)", ValidInts = new int[] { 8, 4 })] public int ProgrammableLoadImpedance = 8; @@ -43,7 +43,7 @@ public override void DoTest(string title, out TestResult tr) ((IProgrammableLoad)Tm.TestClass).SetImpedance(ProgrammableLoadImpedance); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).DoFrAquisition(AnalyzerOutputLevel, 0, SmoothingDenominator); ((IAudioAnalyzer)Tm.TestClass).TestMask(MaskFileName, LeftChannel, RightChannel, false, out bool passLeft, out bool passRight, out _); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA01.cs index ce1d879..5ae0486 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA01.cs @@ -1,5 +1,6 @@ using Com.QuantAsylum.Tractor.TestManagers; using System; +using Tractor; using Tractor.Com.QuantAsylum.Tractor.Tests; namespace Com.QuantAsylum.Tractor.Tests.GainTests @@ -25,8 +26,8 @@ public class GainA01 : AudioTestBase [ObjectEditorAttribute(Index = 240, DisplayText = "Maximum Gain to Pass (dB)", MinValue = -100, MaxValue = 100, MustBeGreaterThanIndex = 230)] public float MaximumPassGain = -9.5f; - [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public GainA01() : base() { @@ -34,6 +35,8 @@ public GainA01() : base() _TestType = TestTypeEnum.LevelGain; } + + public override void DoTest(string title, out TestResult tr) { // Two channels @@ -42,7 +45,7 @@ public override void DoTest(string title, out TestResult tr) Tm.SetToDefaults(); SetupBaseTests(); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen1(true, AnalyzerOutputLevel, TestFrequency); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA03.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA03.cs index 81e461c..c9715eb 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA03.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainA03.cs @@ -29,8 +29,8 @@ public class GainA03 : AudioTestBase [ObjectEditorAttribute(Index = 250, DisplayText = "Load Impedance (ohms)", ValidInts = new int[] { 8, 4 })] public int ProgrammableLoadImpedance = 8; - [ObjectEditorAttribute(Index = 260, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 260, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public GainA03() : base() { @@ -46,7 +46,7 @@ public override void DoTest(string title, out TestResult tr) Tm.SetToDefaults(); SetupBaseTests(); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); ((IProgrammableLoad)Tm.TestClass).SetImpedance(ProgrammableLoadImpedance); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted3A01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted3A01.cs index 3641cbb..f0b0d38 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted3A01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted3A01.cs @@ -20,8 +20,8 @@ public class GainSorted3A01N : AudioTestBase //[ObjectEditorAttribute(Index = 220, DisplayText = "Pre-analyzer Input Gain (dB)", MinValue = -100, MaxValue = 100)] //public float ExternalAnalyzerInputGain = 0; - [ObjectEditorAttribute(Index = 225, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 225, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; //--------------- @@ -83,7 +83,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen1(true, AnalyzerOutputLevel, TestFrequency); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen2(false, AnalyzerOutputLevel, TestFrequency); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted5A01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted5A01.cs index df43e20..7704440 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted5A01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/GainSorted5A01.cs @@ -20,8 +20,8 @@ public class GainSorted5A01N : AudioTestBase //[ObjectEditorAttribute(Index = 220, DisplayText = "Pre-analyzer Input Gain (dB)", MinValue = -100, MaxValue = 100)] //public float ExternalAnalyzerInputGain = 0; - [ObjectEditorAttribute(Index = 225, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 225, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; //--------------- @@ -111,7 +111,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen1(true, AnalyzerOutputLevel, TestFrequency); ((IAudioAnalyzer)Tm.TestClass).AudioGenSetGen2(false, AnalyzerOutputLevel, TestFrequency); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA01.cs index 56cadcf..89e1f10 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA01.cs @@ -16,8 +16,8 @@ public class RmsLevelA01 : AudioTestBase [ObjectEditorAttribute(Index = 240, DisplayText = "Minimum Level to Pass (dBV)", MinValue = -150, MaxValue = 0)] public float MinimumPassLevel = -10.5f; - [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; [ObjectEditorAttribute(Index = 260, DisplayText = "RMS Measurement Start (Hz)", MinValue = 10, MaxValue = 20000)] public float StartFreq = 20; @@ -39,7 +39,7 @@ public override void DoTest(string title, out TestResult tr) Tm.SetToDefaults(); SetupBaseTests(); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); // Disable generators diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA03.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA03.cs index 19acb45..b8bc36d 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA03.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/GainLevel/RmsLevelA03.cs @@ -20,8 +20,8 @@ public class RmsLevelA03 : AudioTestBase [ObjectEditorAttribute(Index = 250, DisplayText = "Load Impedance (ohms)", ValidInts = new int[] { 8, 4 })] public int ProgrammableLoadImpedance = 8; - [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 250, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; [ObjectEditorAttribute(Index = 260, DisplayText = "RMS Measurement Start (Hz)", MinValue = 10, MaxValue = 20000)] public float StartFreq = 20; @@ -44,7 +44,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IProgrammableLoad)Tm.TestClass).SetImpedance(ProgrammableLoadImpedance); // Disable generators diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/ObjectEditorUiBuilder.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/ObjectEditorUiBuilder.cs index d953399..34a7496 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/ObjectEditorUiBuilder.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/ObjectEditorUiBuilder.cs @@ -1,4 +1,5 @@ -using Com.QuantAsylum.Tractor.Tests; +using Com.QuantAsylum.Tractor.TestManagers; +using Com.QuantAsylum.Tractor.Tests; using System; using System.Collections.Generic; using System.Diagnostics; @@ -43,6 +44,11 @@ public class ObjectEditorSpacer } + public class AudioAnalyzerInputRanges + { + public int InputRange; + } + class FileLoadButton : Button { public TextBox FileNameTextBox; @@ -117,7 +123,14 @@ private void PopulateUi() tb.TextChanged += ValueChanged; Tlp.Controls.Add(tb, 1, row); } - if (o is uint) + else if (o is AudioAnalyzerInputRanges) + { + AudioAnalyzerInputRanges value = (AudioAnalyzerInputRanges)fi.GetValue(ObjectToEdit); + TextBox tb = new TextBox() { Text = value.InputRange.ToString(), Anchor = AnchorStyles.Left, AutoSize = true }; + tb.TextChanged += ValueChanged; + Tlp.Controls.Add(tb, 1, row); + } + else if (o is uint) { uint value = (uint)fi.GetValue(ObjectToEdit); TextBox tb = new TextBox() { Text = value.ToString(), Anchor = AnchorStyles.Left, AutoSize = true }; @@ -326,7 +339,6 @@ public bool VerifyChanges(bool commit = false) { valueOk = false; errMsg = "Value is not an integer"; - } else if (f[i].GetCustomAttribute().MustBePowerOfTwo ? !IsPowerOfTwo(result) : false) { @@ -382,6 +394,35 @@ public bool VerifyChanges(bool commit = false) retVal = false; } } + else if (f[i].GetValue(ObjectToEdit) is AudioAnalyzerInputRanges) + { + bool valueOk = true; + string errMsg = ""; + //int[] ValidInputLevels = t ((f[i].GetCustomAttribute().ValidInts; + + if (int.TryParse(Tlp.GetControlFromPosition(1, i).Text, out int result) == false || + ((IAudioAnalyzer)ObjectToEdit.Tm.TestClass).GetInputRanges().Contains(result) == false) + { + valueOk = false; + string validRange = string.Join(", ", ((IAudioAnalyzer)ObjectToEdit.Tm.TestClass).GetInputRanges()); + errMsg = $"Value isn't a valid input range ({validRange} dBV)"; + } + + if (valueOk) + { + if (commit) + f[i].SetValue(ObjectToEdit, new AudioAnalyzerInputRanges() { InputRange = result }); + + Tlp.GetControlFromPosition(3, i).Text = errMsg; + Tlp.GetControlFromPosition(0, i).ForeColor = Color.Black; + } + else + { + Tlp.GetControlFromPosition(3, i).Text = errMsg; + Tlp.GetControlFromPosition(0, i).ForeColor = Color.Red; + retVal = false; + } + } else if (f[i].GetValue(ObjectToEdit) is uint) { bool valueOk = true; @@ -484,6 +525,7 @@ public bool VerifyChanges(bool commit = false) Tlp.GetControlFromPosition(3, i).Text = ""; } + } } catch (Exception ex) diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Other/EfficiencyA07.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Other/EfficiencyA07.cs index 3e282e8..94c8a62 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Other/EfficiencyA07.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Other/EfficiencyA07.cs @@ -33,8 +33,8 @@ public class EfficiencyA07 : AudioTestBase [ObjectEditorAttribute(Index = 260, DisplayText = "Load Impedance (ohms)", ValidInts = new int[] { 8, 4 })] public int ProgrammableLoadImpedance = 8; - [ObjectEditorAttribute(Index = 270, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 26; + [ObjectEditorAttribute(Index = 270, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public EfficiencyA07() : base() { @@ -53,7 +53,7 @@ public override void DoTest(string title, out TestResult tr) ((IProgrammableLoad)Tm.TestClass).SetImpedance(ProgrammableLoadImpedance); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); if (LeftChannel == true && RightChannel == false) { diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Other/ImpedanceA03.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Other/ImpedanceA03.cs index f124b77..7bd59c5 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Other/ImpedanceA03.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Other/ImpedanceA03.cs @@ -22,8 +22,8 @@ public class ImpedanceA03 : AudioTestBase [ObjectEditorAttribute(Index = 230, DisplayText = "Maximum Impedance to Pass (Ω)", MinValue = 0, MaxValue = 100, MustBeGreaterThanIndex = 220)] public float MaximumPassImpedance = 0.2f; - [ObjectEditorAttribute(Index = 240, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 240, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; public ImpedanceA03() : base() { @@ -43,7 +43,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); // First, we make 8 ohm measurement ((IProgrammableLoad)Tm.TestClass).SetImpedance(8); diff --git a/Tractor/Com.QuantAsylum.Tractor.Tests/Other/MicCompareA01.cs b/Tractor/Com.QuantAsylum.Tractor.Tests/Other/MicCompareA01.cs index 7e14125..07fdb7e 100644 --- a/Tractor/Com.QuantAsylum.Tractor.Tests/Other/MicCompareA01.cs +++ b/Tractor/Com.QuantAsylum.Tractor.Tests/Other/MicCompareA01.cs @@ -23,8 +23,8 @@ public class MicCompareA01 : AudioTestBase [ObjectEditorAttribute(Index = 230, DisplayText = "Mask File Name", IsFileName = true, MaxLength = 512)] public string MaskFileName = ""; - [ObjectEditorAttribute(Index = 240, DisplayText = "Analyzer Input Range", ValidInts = new int[] { 6, 26 })] - public int AnalyzerInputRange = 6; + [ObjectEditorAttribute(Index = 240, DisplayText = "Analyzer Input Range")] + public AudioAnalyzerInputRanges AnalyzerInputRange = new AudioAnalyzerInputRanges() { InputRange = 6 }; [ObjectEditorAttribute(Index = 250, DisplayText = "Check Phase")] public bool CheckPhase = false; @@ -44,7 +44,7 @@ public override void DoTest(string title, out TestResult tr) SetupBaseTests(); ((IAudioAnalyzer)Tm.TestClass).AudioAnalyzerSetTitle(title); - ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange); + ((IAudioAnalyzer)Tm.TestClass).SetInputRange(AnalyzerInputRange.InputRange); ((IAudioAnalyzer)Tm.TestClass).DoFrAquisition(AnalyzerOutputLevel, WindowingMs/1000, SmoothingDenominator); ((IAudioAnalyzer)Tm.TestClass).TestMask(MaskFileName, false, false, true, out bool passLeft, out bool passRight, out bool passMath); @@ -62,7 +62,6 @@ public override void DoTest(string title, out TestResult tr) passPhase = false; } - tr.Pass = passMath && passPhase; if (passPhase == false) diff --git a/Tractor/Constants.cs b/Tractor/Constants.cs index a70111c..c4c3ecc 100644 --- a/Tractor/Constants.cs +++ b/Tractor/Constants.cs @@ -10,7 +10,7 @@ namespace Tractor static class Constants { public static string TitleBarText = "QuantAsylum TRACTOR"; - public static readonly double Version = 1.1; + public static readonly double Version = 1.101; public static string VersionSuffix = ""; public static double RequiredWebserviceVersion = 0.5; diff --git a/Tractor/Releases.txt b/Tractor/Releases.txt index a1cf9f1..7398635 100644 --- a/Tractor/Releases.txt +++ b/Tractor/Releases.txt @@ -1,4 +1,7 @@ -1.1 +1.101 +- Fixed bug where QA40x supported input levels weren't being correctly used + +1.1 - Added support for QA40x - Disabled support for cloud audit database in new projects - Simplified and clarified error reporting for tests not available. That is, if you try to make a voltage measurement