Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 9.0.x

- name: Build
id: build
Expand Down
2 changes: 1 addition & 1 deletion .gitversion
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# This is the version number that will be used. Prerelease numbers are calculated by
# counting git commits since the last change in this value.
version = 0.7.5
version = 1.0.0

# A version is determined to be a "beta" prerelease if it originates from the default branch
# The default branch is the first branch that matches the following regular expession.
Expand Down
4 changes: 1 addition & 3 deletions OpenTap.Plugins.PNAX/Acquisition/StoreSnp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ public override void Run()

public string AssemblyDirectory()
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
string path = Assembly.GetExecutingAssembly().Location;
return Path.GetDirectoryName(path);
}
}
Expand Down
1 change: 0 additions & 1 deletion OpenTap.Plugins.PNAX/BaseSteps/SingleTraceBaseStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Text;

namespace OpenTap.Plugins.PNAX
Expand Down
3 changes: 1 addition & 2 deletions OpenTap.Plugins.PNAX/Calibration/CalAll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ private void QueryChannels()

PNAX.Close();
}
catch (Exception ex)
catch (Exception)
{
if (PNAX.IsConnected)
{
Expand All @@ -519,7 +519,6 @@ private void QueryChannels()
Log.Error("Cannot query channels!");
return;
}

}

public CalAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ public override void Run()

public string AssemblyDirectory()
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
string path = Assembly.GetExecutingAssembly().Location;
return Path.GetDirectoryName(path);
}
}
Expand Down
2 changes: 1 addition & 1 deletion OpenTap.Plugins.PNAX/General/Spectrum Analyzer/SASource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public bool PortPowersCoupled
[Output]
[Browsable(true)]
[Display("MetaData", Groups: new[] { "MetaData" }, Order: 1000.0)]
public List<(string, object)> MetaData { get; private set; }
public new List<(string, object)> MetaData { get; private set; }
#endregion

public SASource()
Expand Down
2 changes: 1 addition & 1 deletion OpenTap.Plugins.PNAX/Instrument/PNACal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public void CalAllSetProperty(string prop, string value)
// Error 342, may need error 341 also
if (!ex.Message.StartsWith("Error: 342"))
{
throw ex;
throw;
}

}
Expand Down
4 changes: 2 additions & 2 deletions OpenTap.Plugins.PNAX/Instrument/PNALoadMeasStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,9 @@ private void ChangeFolder(string folder)

// We now have switched to the folder
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw;
}

}
Expand Down
1 change: 0 additions & 1 deletion OpenTap.Plugins.PNAX/Instrument/PNAMath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Text;

//Note this template assumes that you have a SCPI based instrument, and accordingly
Expand Down
1 change: 0 additions & 1 deletion OpenTap.Plugins.PNAX/Instrument/PNAModulationDistortion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Text;

//Note this template assumes that you have a SCPI based instrument, and accordingly
Expand Down
1 change: 0 additions & 1 deletion OpenTap.Plugins.PNAX/Instrument/PNAReceiverLeveling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Text;

//Note this template assumes that you have a SCPI based instrument, and accordingly
Expand Down
1 change: 0 additions & 1 deletion OpenTap.Plugins.PNAX/Instrument/PNAStandard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Remoting.Channels;
using System.Text;

//Note this template assumes that you have a SCPI based instrument, and accordingly
Expand Down
8 changes: 4 additions & 4 deletions OpenTap.Plugins.PNAX/LMS/LoadFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public override void Run()
PNAX.LoadState(absolutePath, overwrite);
PNAX.WaitForOperationComplete();
}
catch(FileNotFoundException ex)
catch (FileNotFoundException)
{
throw ex;
throw;
}
catch(Exception ex)
catch (Exception)
{
throw ex;
throw;
}

UpgradeVerdict(Verdict.Pass);
Expand Down
8 changes: 4 additions & 4 deletions OpenTap.Plugins.PNAX/LMS/Measure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public override void Run()
}
PNAX.WaitForOperationComplete();
}
catch (IndexOutOfRangeException ex)
catch (IndexOutOfRangeException)
{
throw ex;
throw;
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw;
}

UpgradeVerdict(Verdict.Pass);
Expand Down
8 changes: 4 additions & 4 deletions OpenTap.Plugins.PNAX/LMS/SaveState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public override void Run()
Log.Info("---Save State Completed---");
PNAX.WaitForOperationComplete();
}
catch (FileNotFoundException ex)
catch (FileNotFoundException)
{
throw ex;
throw;
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw;
}

UpgradeVerdict(Verdict.Pass);
Expand Down
12 changes: 4 additions & 8 deletions OpenTap.Plugins.PNAX/LMS/StoreData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ public override void Run()

// append xaxisvalues
resultColumn = new ResultColumn($"{TraceName}_XAxis", x1[i].Select(double.Parse).Select(x => Math.Round(x, 2)).ToArray());
if (false)
{
resultColumns.Add(resultColumn);
}

// append pf
List<string> pfByRow = new List<string>();
Expand Down Expand Up @@ -376,13 +372,13 @@ public override void Run()
}

}
catch (IndexOutOfRangeException ex)
catch (IndexOutOfRangeException)
{
throw ex;
throw;
}
catch(Exception ex)
catch(Exception)
{
throw ex;
throw;
}

UpgradeVerdict(Verdict.Pass);
Expand Down
4 changes: 1 addition & 3 deletions OpenTap.Plugins.PNAX/LMS/StoreDispTraceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ public override void Run()

public string AssemblyDirectory()
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
string path = Assembly.GetExecutingAssembly().Location;
return Path.GetDirectoryName(path);
}
}
Expand Down
6 changes: 2 additions & 4 deletions OpenTap.Plugins.PNAX/LMS/StoreScreenShot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ public override void Run()

public string AssemblyDirectory()
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
return Path.GetDirectoryName(path);
string location = Assembly.GetExecutingAssembly().Location;
return Path.GetDirectoryName(location);
}
}
}
6 changes: 2 additions & 4 deletions OpenTap.Plugins.PNAX/LMS/StoreSnp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ public override void Run()

public string AssemblyDirectory()
{
string codeBase = Assembly.GetExecutingAssembly().CodeBase;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
return Path.GetDirectoryName(path);
string location = Assembly.GetExecutingAssembly().Location;
return Path.GetDirectoryName(location);
}
}
}
8 changes: 4 additions & 4 deletions OpenTap.Plugins.PNAX/Network Analyzer Steps/AutoScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public override void Run()
PNAX.AutoScaleWindow(window);
}
}
catch (IndexOutOfRangeException ex)
catch (IndexOutOfRangeException)
{
throw ex;
throw; // Preserve the original stack trace
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw; // Preserve the original stack trace
}

UpgradeVerdict(Verdict.Pass);
Expand Down
6 changes: 3 additions & 3 deletions OpenTap.Plugins.PNAX/OpenTap.Plugins.PNAX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<!-- We are debugging using NET Framework, but builds to Netstandard in release mode to ensure cross platform compatibility -->
<!-- If your plugin is Windows only and you use Windows specific API's, feel free to change "netstandard2.0" below to "net462" and everything will work as when you are debugging. In this case, remember to change "OS" in package.xml to only "windows" -->
<!-- If your plugin should be cross platform but does not build in release mode, please verify that all API's you used are available. You might need references or nuget packages for API's that are available in NET framework, but not in NetStandard -->
<TargetFramework>net472</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OpenTapPackageDefinitionPath>package.xml</OpenTapPackageDefinitionPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<!-- We are setting TargetFramework in debug configuration, otherwise Visual Studio tries to attach a .NET Core debugger. That will not work, because the program we open is a .NET Framework executable -->
<TargetFramework>net472</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<CreateOpenTapPackage>false</CreateOpenTapPackage>
</PropertyGroup>

Expand All @@ -36,7 +36,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OpenTAP" Version="9.27.1" />
<PackageReference Include="OpenTAP" Version="9.32.1" />
<OpenTapPackageReference Include="OpenTAP" />
</ItemGroup>

Expand Down
15 changes: 12 additions & 3 deletions TestPlanGenerator/OpenTapTestGenMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,22 @@ public void Initialize(GuiContext context)

protected string GetTheme()
{
if (Keysight.OpenTap.Wpf.EditorSettings.Current.ColorTheme == Keysight.OpenTap.Wpf.Themes.TapSkins.Theme.Light)
// Check if the platform supports the EditorSettings API
if (OperatingSystem.IsWindowsVersionAtLeast(7))
{
return "Light";
if (Keysight.OpenTap.Wpf.EditorSettings.Current.ColorTheme == Keysight.OpenTap.Wpf.Themes.TapSkins.Theme.Light)
{
return "Light";
}
else
{
return "Dark";
}
}
else
{
return "Dark";
// Default to "Light" theme for unsupported platforms
return "Light";
}
}

Expand Down
19 changes: 18 additions & 1 deletion TestPlanGenerator/TestGen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using OpenTap;
using System.IO;
using Microsoft.Win32;
using System.Runtime.Versioning;

namespace TestPlanGenerator
{
Expand Down Expand Up @@ -119,13 +120,23 @@ private void BrowseDialogInputFileButton_Click(object sender, RoutedEventArgs e)
}


// ...

private void SetTestPlan(TestPlan testPlan)
{
Application.Current.Dispatcher.Invoke(() =>
{
try
{
this.uiContext.Plan = testPlan;
if (OperatingSystem.IsWindowsVersionAtLeast(7))
{
// Marking the following line with the SupportedOSPlatform attribute to suppress CA1416 warning
SetPlanForWindows(testPlan);
}
else
{
throw new PlatformNotSupportedException("This functionality is only supported on Windows 7.0 and later.");
}
}
catch (Exception e)
{
Expand All @@ -134,6 +145,12 @@ private void SetTestPlan(TestPlan testPlan)
});
}

[SupportedOSPlatform("windows7.0")]
private void SetPlanForWindows(TestPlan testPlan)
{
this.uiContext.Plan = testPlan;
}

private void BrowseInputFileButton_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
Expand Down
10 changes: 5 additions & 5 deletions TestPlanGenerator/TestGenModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ public void ParseExcelFile(String filename)
// Parse Channels
int sheetIndex = 1;
Worksheet sheet = (Worksheet)wb.Sheets.Item[sheetIndex];
Range excelRange = sheet.UsedRange;
foreach (Range row in excelRange.Rows)
Microsoft.Office.Interop.Excel.Range excelRange = sheet.UsedRange;
foreach (Microsoft.Office.Interop.Excel.Range row in excelRange.Rows)
{
int rowNumber = row.Row;

Expand Down Expand Up @@ -291,7 +291,7 @@ public void ParseExcelFile(String filename)
sheetIndex = 2;
sheet = (Worksheet)wb.Sheets.Item[sheetIndex];
excelRange = sheet.UsedRange;
foreach (Range row in excelRange.Rows)
foreach (Microsoft.Office.Interop.Excel.Range row in excelRange.Rows)
{
int rowNumber = row.Row;

Expand Down Expand Up @@ -526,8 +526,8 @@ public void ParseDialogExcelFile(String filename)
// Parse Channels
int sheetIndex = 1;
Worksheet sheet = (Worksheet)wb.Sheets.Item[sheetIndex];
Range excelRange = sheet.UsedRange;
foreach (Range row in excelRange.Rows)
Microsoft.Office.Interop.Excel.Range excelRange = sheet.UsedRange;
foreach (Microsoft.Office.Interop.Excel.Range row in excelRange.Rows)
{
int rowNumber = row.Row;

Expand Down
Loading