From 28ae6635aa3f9fdbb79f4fbc93bfa0d1d3194b13 Mon Sep 17 00:00:00 2001 From: Henning von Kielpinski Date: Tue, 28 Nov 2023 13:14:03 +0100 Subject: [PATCH] Minor Adjustments Enmhaced readabilityy --- CGATest.csproj | 15 ++++++ Form1.cs | 83 --------------------------------- Form1.resx | 2 +- Properties/Settings.Designer.cs | 26 +++++++++++ Properties/Settings.settings | 6 +++ 5 files changed, 48 insertions(+), 84 deletions(-) create mode 100644 Properties/Settings.Designer.cs create mode 100644 Properties/Settings.settings diff --git a/CGATest.csproj b/CGATest.csproj index 3f794e3..194d26c 100644 --- a/CGATest.csproj +++ b/CGATest.csproj @@ -10,4 +10,19 @@ true + + + True + True + Settings.settings + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + \ No newline at end of file diff --git a/Form1.cs b/Form1.cs index bedbf9f..81a2f2f 100644 --- a/Form1.cs +++ b/Form1.cs @@ -177,52 +177,6 @@ private async void Form1_Shown(object sender, EventArgs e) public async Task Main(object sender, EventArgs e) { - /* - * - * Probably better placed where the data is actuall read - * - * - * - Process sigrok = null; - // readm cmd - string[] args = Environment.GetCommandLineArgs(); - if (args.Length == 1) // do we start sigrok on our own? - { - - Console.WriteLine("Starting Sigrok"); - - // Sigrok process start - var startSigrok = new ProcessStartInfo - { - FileName = @"C:\Program Files\sigrok\sigrok-cli\sigrok-cli", - UseShellExecute = false, - RedirectStandardOutput = true, - WorkingDirectory = @"C:\Program Files\sigrok\sigrok-cli\", - Arguments = @"-d fx2lafw -O binary --config ""samplerate=16 MHz"" --continuous", - StandardOutputEncoding = Encoding.Latin1 - }; - - sigrok = Process.Start(startSigrok); - - sigrok.PriorityClass = ProcessPriorityClass.High; - processIds.Enqueue(sigrok.Id); - - // Attach stdout - vIn = sigrok.StandardOutput; - - } - else - if (args[1] == "-") - { - vIn = new StreamReader(Console.OpenStandardInput(), System.Text.Encoding.Latin1, bufferSize: 131072); // or is there a pipe? - } - else - { - Console.WriteLine("Only \"-\" is allowed for standard-in. Exiting."); - Application.Exit(); - } - */ - Bitmap newpic = null; radioButton1.ForeColor = Color.Green; @@ -356,43 +310,6 @@ await Task.Run(() => else color = (int)rawdata & 0x3F; - /* - // Generic bit shifting to extract color bits - blue = (byte)(127 * (byte)(color & 1)); - color = color >> 1; - green = (byte)(127 * (byte)(color & 1)); - color = color >> 1; - red = (byte)(127 * (byte)(color & 1)); - - switch (colorMode) - { - case 0: //RGB is just one intensity level - red = (byte)(red * 2); - green = (byte)(green * 2); - blue = (byte)(blue * 2); - break; - case 1: // MDA relies on green and intensity on green - color = color >> 1; - green = (byte)(green * ((byte)(color & 1) + 1)); - blue = green; - red = green; - break; - case 2: // CGA has intensity as well (on green) - color = color >> 1; - blue = (byte)(blue * ((byte)(color & 1) + 1)); - green = (byte)(green * ((byte)(color & 1) + 1)); - red = (byte)(red * ((byte)(color & 1) + 1)); - break; - case 3: // For EGA - color = color >> 1; - green = (byte)(green * ((byte)(color & 1) + 1)); - color = color >> 1; - red = (byte)(red * ((byte)(color & 1) + 1)); - color = color >> 1; - blue = (byte)(blue * ((byte)(color & 1) + 1)); - break; - }*/ - //Low bits blueL = (byte)(color & 1); color = color >> 1; diff --git a/Form1.resx b/Form1.resx index 0b1f46f..8a3086c 100644 --- a/Form1.resx +++ b/Form1.resx @@ -121,6 +121,6 @@ 17, 17 - 85 + 25 \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a4ca7df --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace CGATest.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..049245f --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,6 @@ + + + + + +