Skip to content

Commit

Permalink
- Updated project to Visual Studio 2022
Browse files Browse the repository at this point in the history
- Updated NI-VISA to v2023 Q2
- Refactoring
  • Loading branch information
fpgagp committed Apr 21, 2023
1 parent 96991a7 commit e59448b
Show file tree
Hide file tree
Showing 37 changed files with 184 additions and 14,645 deletions.
Binary file added Binaries/Oscilloscope_1_1.zip
Binary file not shown.
31 changes: 2 additions & 29 deletions Oscilloscope.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
# Visual Studio Version 17
VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OscilloscopeTest", "OscilloscopeTest\OscilloscopeTest.csproj", "{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}"
EndProject
Expand All @@ -18,53 +18,26 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CD_ROM|Any CPU = CD_ROM|Any CPU
Debug|Any CPU = Debug|Any CPU
DVD-5|Any CPU = DVD-5|Any CPU
Release|Any CPU = Release|Any CPU
SingleImage|Any CPU = SingleImage|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.Release|Any CPU.Build.0 = Release|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{38B8E55F-06FF-435F-8D4A-0967A9B94F4F}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.Release|Any CPU.Build.0 = Release|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{ADFC469D-78BB-415D-AE23-B6F5D5A5BDFC}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.Release|Any CPU.Build.0 = Release|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{6BEA399D-CD60-4AF9-8499-3F720A5EDE80}.SingleImage|Any CPU.Build.0 = Release|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.Release|Any CPU.Build.0 = Release|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
{ECE2AD33-6CA7-43CA-9066-E9049D5D6FB0}.SingleImage|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion Oscilloscope/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/></startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
Expand Down
15 changes: 2 additions & 13 deletions Oscilloscope/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,46 @@
/// </summary>
public class Channel
{
private uint _channelID;
private Oscilloscope _oscilloscope;
uint _channelID;
Oscilloscope _oscilloscope;

public Channel(uint channelID, Oscilloscope oscilloscope)
{
_channelID = channelID;
_oscilloscope = oscilloscope;
}

// --------- Channel commands

public OnOff GetBwLimit()
{
_oscilloscope.Write(":CHAN" + _channelID + ":BWLimit?");
return (OnOff)GetterSetterExtension.FromDescription<OnOff>(_oscilloscope.ReadString());
}

public void SetBwLimit(OnOff value)
{
_oscilloscope.Write(":CHAN" + _channelID + ":BWLimit " + value.SetterDescription());
}

// TODO: Coupling
// TODO: Display
// TODO: Invert

public double GetOffset()
{
_oscilloscope.Write(":CHAN" + _channelID + ":OFFS?");
return double.Parse(_oscilloscope.ReadString());
}

public void SetOffset(double value)
{
_oscilloscope.Write(":CHAN" + _channelID + ":OFFS " + value);
}

// TODO: Probe

public double GetScale()
{
_oscilloscope.Write(":CHAN" + _channelID + ":SCAL?");
return double.Parse(_oscilloscope.ReadString());
}

public void SetScale(double value)
{
_oscilloscope.Write(":CHAN" + _channelID + ":SCAL " + value);
}

public WaveForm GetWaveform()
{
_oscilloscope.Write(":WAVEFORM:DATA? CHAN" + _channelID);
Expand Down Expand Up @@ -157,5 +147,4 @@ public WaveForm GetWaveformString()

return new WaveForm(times, data);
}

}
2 changes: 1 addition & 1 deletion Oscilloscope/GetterSetterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ public static Enum FromDescription<T>(string description)
}
throw new Exception("Enum not found: [" + description + "]");
}
}
}
2 changes: 0 additions & 2 deletions Oscilloscope/GnuPlot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,4 @@ public void DrawGraph(string csvFileName, int numWaves, bool generatePngImage =
}
gnuPlot.Close();
}


}
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading

0 comments on commit e59448b

Please sign in to comment.