From 3f2b5b684cfdfcab0648fa66d113f31dca96c76b Mon Sep 17 00:00:00 2001
From: Lorenz Stechauner <lorenz.stechauner@necronda.net>
Date: Wed, 21 Feb 2024 11:00:30 +0100
Subject: [PATCH] Weighing: Remove unused scales

---
 Elwig/Helpers/Weighing/GassnerScale.cs       | 64 --------------------
 Elwig/Helpers/Weighing/SchemberScale.cs      | 19 ------
 Tests/WeighingTests/ScaleTestGrInzersdorf.cs |  6 ++
 3 files changed, 6 insertions(+), 83 deletions(-)
 delete mode 100644 Elwig/Helpers/Weighing/GassnerScale.cs
 delete mode 100644 Elwig/Helpers/Weighing/SchemberScale.cs
 create mode 100644 Tests/WeighingTests/ScaleTestGrInzersdorf.cs

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<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() { }
-    }
-}
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
+    }
+}