Skip to content

Commit

Permalink
Added three new math waveforms, minor fixes.
Browse files Browse the repository at this point in the history
dB, dBm, and % Error math waveforms have been added. Graph library updated.
  • Loading branch information
Niravk1997 committed May 25, 2021
1 parent ced4e5c commit 6dddf56
Show file tree
Hide file tree
Showing 10 changed files with 1,162 additions and 373 deletions.
Binary file modified src/.vs/HP 3478A/v16/.suo
Binary file not shown.
3 changes: 1 addition & 2 deletions src/COM_Select_Window.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ private void Connect_Click(object sender, RoutedEventArgs e)
Info_Log.Text = String.Empty;
Info_Log.Inlines.Clear();
Data_Updater();
(Owner as MainWindow).Serial_COM_Selected();
this.Close();
}
}
Expand Down Expand Up @@ -566,7 +565,7 @@ private void Data_Updater()
Serial_COM_Info.COM_RtsEnable = COM_RtsEnable;
Serial_COM_Info.GPIB_Address = COM_GPIB_Address_Value;
Serial_COM_Info.folder_Directory = folder_Directory;
Serial_COM_Info.isChanged = true;
Serial_COM_Info.isConnected = true;
}

private void Info_Clear_Click(object sender, RoutedEventArgs e)
Expand Down
336 changes: 197 additions & 139 deletions src/Graphing_Window.xaml

Large diffs are not rendered by default.

339 changes: 339 additions & 0 deletions src/Graphing_Window.xaml.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/HP 3478A.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
<Reference Include="Ookii.Dialogs.Wpf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=66aa232afad40158, processorArchitecture=MSIL">
<HintPath>packages\Ookii.Dialogs.Wpf.3.1.0\lib\net45\Ookii.Dialogs.Wpf.dll</HintPath>
</Reference>
<Reference Include="ScottPlot, Version=4.1.13.0, Culture=neutral, PublicKeyToken=86698dc10387c39e, processorArchitecture=MSIL">
<HintPath>packages\ScottPlot.4.1.13-beta\lib\net461\ScottPlot.dll</HintPath>
<Reference Include="ScottPlot, Version=4.1.14.0, Culture=neutral, PublicKeyToken=86698dc10387c39e, processorArchitecture=MSIL">
<HintPath>packages\ScottPlot.4.1.14\lib\net461\ScottPlot.dll</HintPath>
</Reference>
<Reference Include="ScottPlot.WPF, Version=4.1.13.0, Culture=neutral, PublicKeyToken=e53b06131e34a3aa, processorArchitecture=MSIL">
<HintPath>packages\ScottPlot.WPF.4.1.13-beta\lib\net472\ScottPlot.WPF.dll</HintPath>
<Reference Include="ScottPlot.WPF, Version=4.1.14.0, Culture=neutral, PublicKeyToken=e53b06131e34a3aa, processorArchitecture=MSIL">
<HintPath>packages\ScottPlot.WPF.4.1.14\lib\net472\ScottPlot.WPF.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
104 changes: 52 additions & 52 deletions src/MainWindow.xaml

Large diffs are not rendered by default.

68 changes: 33 additions & 35 deletions src/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace HP_3478A
{
public static class Serial_COM_Info
{
public static bool isChanged = false;
public static bool isConnected = false;

//HP3478A COM Device Info
public static string COM_Port;
Expand Down Expand Up @@ -337,25 +337,23 @@ private void General_Timer()

public void Serial_COM_Selected()
{
Connect.IsEnabled = false;
unlockControls();
Serial_Connect();
this.Title = "HP 3478A " + Serial_COM_Info.COM_Port;
DataSampling = true;
saveOutputLog = true;
saveMeasurements = true;
Stop_Sampling.IsEnabled = true;
VDC_Border.BorderBrush = Selected;
VDC_Auto_Border.BorderBrush = Selected;
Digit_Five_Border.BorderBrush = Selected;
Trigger_Internal_Border.BorderBrush = Selected;
UpdateSpeed_Default_Set_Border.BorderBrush = Selected;
DataTimer.Enabled = true;
StartDateTime = DateTime.Now;
Data_process();
saveMeasurements_Timer.Enabled = true;
Sampling_Only.IsEnabled = true;
DataLogger.IsEnabled = true;
if (Serial_COM_Info.isConnected == true)
{
Connect.IsEnabled = false;
unlockControls();
Serial_Connect();
this.Title = "HP 3478A " + Serial_COM_Info.COM_Port;
DataSampling = true;
saveOutputLog = true;
saveMeasurements = true;
Stop_Sampling.IsEnabled = true;
DataTimer.Enabled = true;
StartDateTime = DateTime.Now;
Data_process();
saveMeasurements_Timer.Enabled = true;
Sampling_Only.IsEnabled = true;
DataLogger.IsEnabled = true;
}
}

private void runtime_Update(object sender, EventArgs e)
Expand Down Expand Up @@ -938,7 +936,7 @@ private void Process_Measurement_Data(string data)
catch (Exception)
{
insert_Log("Could not add data to Table Window.", 2);
insert_Log("This could happen if the table window was opened or closed recently.", 1);
insert_Log("This could happen if the table window was opened or closed recently.", 2);
}
}

Expand All @@ -951,7 +949,7 @@ private void Process_Measurement_Data(string data)
catch (Exception)
{
insert_Log("Could not add data to Graph Window.", 2);
insert_Log("This could happen if the graph window was opened or closed recently.", 1);
insert_Log("This could happen if the graph window was opened or closed recently.", 2);
}
}
}
Expand Down Expand Up @@ -1135,7 +1133,7 @@ private void Connect_Click(object sender, RoutedEventArgs e)
if (COM_Select == null)
{
COM_Select = new COM_Select_Window();
COM_Select.Closed += (a, b) => COM_Select = null;
COM_Select.Closed += (a, b) => { COM_Select = null; Serial_COM_Selected(); };
COM_Select.Owner = this;
COM_Select.Show();
}
Expand Down Expand Up @@ -2343,7 +2341,7 @@ private void Ohms_Auto_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to Auto.", 5);
insert_Log("Ohms Range set to Auto.", 5);
}
else
{
Expand All @@ -2359,7 +2357,7 @@ private void Ohms_30_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to 30Ω.", 5);
insert_Log("Ohms Range set to 30Ω.", 5);
}
else
{
Expand All @@ -2375,7 +2373,7 @@ private void Ohms_300_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to 300Ω.", 5);
insert_Log("Ohms Range set to 300Ω.", 5);
}
else
{
Expand All @@ -2391,7 +2389,7 @@ private void Ohms_3K_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to 3KΩ.", 5);
insert_Log("Ohms Range set to 3KΩ.", 5);
}
else
{
Expand All @@ -2407,7 +2405,7 @@ private void Ohms_30K_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to 30KΩ.", 5);
insert_Log("Ohms Range set to 30KΩ.", 5);
}
else
{
Expand All @@ -2423,7 +2421,7 @@ private void Ohms_300K_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to 300KΩ.", 5);
insert_Log("Ohms Range set to 300KΩ.", 5);
}
else
{
Expand All @@ -2439,7 +2437,7 @@ private void Ohms_3M_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to 3MΩ.", 5);
insert_Log("Ohms Range set to 3MΩ.", 5);
}
else
{
Expand All @@ -2455,7 +2453,7 @@ private void Ohms_30M_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("VAC Range set to 30MΩ.", 5);
insert_Log("Ohms Range set to 30MΩ.", 5);
}
else
{
Expand Down Expand Up @@ -2867,7 +2865,7 @@ private void Trigger_Single_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("Single Trigger Selected.", 3);
insert_Log("Single Trigger Selected. This trigger won't work with this software.", 3);
}

private void Trigger_Hold_Button_Click(object sender, RoutedEventArgs e)
Expand All @@ -2876,7 +2874,7 @@ private void Trigger_Hold_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("Hold Trigger Selected.", 3);
insert_Log("Hold Trigger Selected. This trigger won't work with this software.", 3);
}

private void Trigger_Fast_Button_Click(object sender, RoutedEventArgs e)
Expand All @@ -2885,7 +2883,7 @@ private void Trigger_Fast_Button_Click(object sender, RoutedEventArgs e)
lockControls();
isUserSendCommand = true;
Speedup_Interval();
insert_Log("Fast Trigger Selected.", 3);
insert_Log("Fast Trigger Selected. This trigger won't work with this software.", 3);
}

private string Trigger_Selector(int Trigger)
Expand Down Expand Up @@ -3812,7 +3810,7 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
{
DataTimer.Stop();
DataTimer.Dispose();
if (Serial_COM_Info.isChanged == true)
if (Serial_COM_Info.isConnected == true)
{
HP3478A.Close();
HP3478A.Dispose();
Expand Down
Loading

0 comments on commit 6dddf56

Please sign in to comment.