33 lines
1008 B
C#
33 lines
1008 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HTOLHAST
|
|
{
|
|
public class Agilent34970a : SCPIInstrument
|
|
{
|
|
public Agilent34970a(string resourceString) : base(resourceString) { }
|
|
|
|
public override Sample CreateSample(string response)
|
|
{
|
|
string Response = response;
|
|
|
|
// Parse the Keithley output
|
|
string[] parts = Response.Split(',');
|
|
|
|
if (parts.Length >= 1 && double.TryParse(parts[0].Replace("V", ""), out double current))
|
|
{
|
|
Agilent34970aSample sample = new Agilent34970aSample(DateTime.Now, current, "V");
|
|
|
|
// Optionally, store or process the sample here
|
|
Console.WriteLine($"[Agilent34970] Sample Created, Value: {sample.Value} {sample.Unit}");
|
|
return sample;
|
|
}
|
|
|
|
throw new InvalidOperationException("Unsupported instrument type.");
|
|
}
|
|
}
|
|
}
|