test commit

This commit is contained in:
Wesley Hofman
2025-09-11 09:17:50 +02:00
parent a0d5f3b21b
commit 9292dcfad5
6 changed files with 268 additions and 85 deletions

View File

@@ -13,11 +13,91 @@ namespace HTOLHAST
{
public partial class Form1 : Form
{
HMP4040 PSU1;
HMP4040 PSU2;
Keithley6485 PAM;
Agilent34970a DAQ;
public Form1()
{
InitializeComponent();
}
public void InitializeInstruments()
{
// Mandatory instruments:
InitializePSU1(tbResourceStringPSU1.Text);
InitializeDAQ(tbResourceStringDAQ.Text);
// Optional Instruments check if to be used
if (cbPSU1Enabled.Checked)
{
InitializePSU2(tbResourceStringPSU2.Text);
}
if (cbPAMEnabled.Checked)
{
InitializePAM(tbResourceStringPAM.Text);
}
}
public void InitializePSU1(string resourceString)
{
try
{
PSU1 = new HMP4040(resourceString);
}
catch (Exception)
{
throw;
}
}
public void InitializePSU2(string resourceString)
{
try
{
PSU2 = new HMP4040(resourceString);
}
catch (Exception)
{
throw;
}
}
public void InitializePAM(string resourceString)
{
try
{
PAM = new Keithley6485(resourceString);
}
catch (Exception)
{
throw;
}
}
public void InitializeDAQ(string resourceString)
{
try
{
DAQ = new Agilent34970a(resourceString);
}
catch (Exception)
{
throw;
}
}
public void HamegValidationOfMethods()
{
string resourceString = "ASRL4::INSTR"; // Replace with your instrument's resource string
@@ -58,6 +138,11 @@ namespace HTOLHAST
// Close the instrument connection
keithley.Close();
}
}
private void btnInitializeInstruments_Click(object sender, EventArgs e)
{
InitializeInstruments();
}
}
}