diff --git a/Elwig/Helpers/Weighing/GassnerScale.cs b/Elwig/Helpers/Weighing/GassnerScale.cs deleted file mode 100644 index 95b1961..0000000 --- a/Elwig/Helpers/Weighing/GassnerScale.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.IO; -using System.IO.Ports; -using System.Text; -using System.Threading.Tasks; - -namespace Elwig.Helpers.Weighing { - public class GassnerScale : IScale { - - protected SerialPort Serial = null; - protected StreamReader Reader; - protected StreamWriter Writer; - - public string Manufacturer => "Gassner"; - public int InternalScaleNr => 1; - public string Model { get; private set; } - public string ScaleId { get; private set; } - public bool IsReady { get; private set; } - public bool HasFillingClearance { get; private set; } - public int? WeightLimit { get; private set; } - public string? LogPath { get; private set; } - - public GassnerScale(string id, string model, string connection) { - ScaleId = id; - Model = model; - IsReady = true; - HasFillingClearance = false; - - if (!connection.StartsWith("serial:")) - throw new ArgumentException("Unsupported scheme"); - - Serial = Utils.OpenSerialConnection(connection); - Writer = new(Serial.BaseStream, Encoding.ASCII, -1, true); - Reader = new(Serial.BaseStream, Encoding.ASCII, false, -1, true); - } - - public void Dispose() { - Writer.Close(); - Reader.Close(); - Serial.Close(); - GC.SuppressFinalize(this); - } - - public async Task Weigh(bool incIdentNr) { - await Writer.WriteAsync(incIdentNr ? "\x05" : "?"); - // TODO receive response - return new(); - } - - public async Task GetCurrentWeight() { - return await Weigh(false); - } - - public async Task Weigh() { - return await Weigh(true); - } - - public async Task Empty() { } - - public async Task GrantFillingClearance() { } - - public async Task RevokeFillingClearance() { } - } -} diff --git a/Elwig/Helpers/Weighing/SchemberScale.cs b/Elwig/Helpers/Weighing/SchemberScale.cs deleted file mode 100644 index 329e117..0000000 --- a/Elwig/Helpers/Weighing/SchemberScale.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace Elwig.Helpers.Weighing { - public class SchemberScale : IEventScale { - - public string Manufacturer => "Schember"; - public string Model => throw new NotImplementedException(); - public string ScaleId => throw new NotImplementedException(); - public int InternalScaleNr => throw new NotImplementedException(); - public bool IsReady => throw new NotImplementedException(); - public bool HasFillingClearance => throw new NotImplementedException(); - public int? WeightLimit => throw new NotImplementedException(); - public string? LogPath => throw new NotImplementedException(); - - public void Dispose() { - GC.SuppressFinalize(this); - } - } -} diff --git a/Tests/WeighingTests/ScaleTestGrInzersdorf.cs b/Tests/WeighingTests/ScaleTestGrInzersdorf.cs new file mode 100644 index 0000000..f96fc27 --- /dev/null +++ b/Tests/WeighingTests/ScaleTestGrInzersdorf.cs @@ -0,0 +1,6 @@ +namespace Tests.WeighingTests { + [TestFixture] + public class ScaleTestGrInzersdorf { + // TODO + } +}