Weighing: Remove unused scales

This commit is contained in:
2024-02-21 11:00:30 +01:00
parent 5db14c09ad
commit 3f2b5b684c
3 changed files with 6 additions and 83 deletions

View File

@ -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<WeighingResult> Weigh(bool incIdentNr) {
await Writer.WriteAsync(incIdentNr ? "\x05" : "?");
// TODO receive response
return new();
}
public async Task<WeighingResult> GetCurrentWeight() {
return await Weigh(false);
}
public async Task<WeighingResult> Weigh() {
return await Weigh(true);
}
public async Task Empty() { }
public async Task GrantFillingClearance() { }
public async Task RevokeFillingClearance() { }
}
}

View File

@ -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);
}
}
}

View File

@ -0,0 +1,6 @@
namespace Tests.WeighingTests {
[TestFixture]
public class ScaleTestGrInzersdorf {
// TODO
}
}