From 5c05466bc8892c1b03a909217a08e7d8da1681e7 Mon Sep 17 00:00:00 2001 From: Jens True Date: Tue, 19 Oct 2021 17:36:09 +0200 Subject: [PATCH 1/6] .NET6 and VS2022 --- .drone.yml | 4 +- Tidstagning.sln | 17 +- Tidstagning.suo | Bin 33792 -> 0 bytes Tidstagning/Deltager.txt | 16 -- Tidstagning/Procedure.cs | 7 +- Tidstagning/Properties/AssemblyInfo.cs | 35 ---- Tidstagning/Properties/Resources.Designer.cs | 63 ------ Tidstagning/Properties/Resources.resx | 117 ----------- Tidstagning/Properties/Settings.Designer.cs | 2 +- Tidstagning/Properties/app.manifest | 47 ----- Tidstagning/Relay.cs | 4 +- Tidstagning/Settings.Designer.cs | 62 ++++++ Tidstagning/Startprocedure.txt | 4 - Tidstagning/Tidstagning.csproj | 196 +++---------------- Tidstagning/Tidstagning.csproj.user | 27 ++- Tidstagning/app.config | 22 --- Tidstagning/icon.ico | Bin 104889 -> 0 bytes 17 files changed, 114 insertions(+), 509 deletions(-) delete mode 100644 Tidstagning.suo delete mode 100644 Tidstagning/Deltager.txt delete mode 100644 Tidstagning/Properties/AssemblyInfo.cs delete mode 100644 Tidstagning/Properties/Resources.Designer.cs delete mode 100644 Tidstagning/Properties/Resources.resx delete mode 100644 Tidstagning/Properties/app.manifest create mode 100644 Tidstagning/Settings.Designer.cs delete mode 100644 Tidstagning/Startprocedure.txt delete mode 100644 Tidstagning/app.config delete mode 100644 Tidstagning/icon.ico diff --git a/.drone.yml b/.drone.yml index a2db58e..a13720b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,6 @@ kind: pipeline name: default steps: - name: build - image: mono + image: mcr.microsoft.com/dotnet/sdk:6.0 commands: - - msbuild Tidstagning.sln \ No newline at end of file + - dotnet publish -c Debug -o out -r win-x86 --self-contained true \ No newline at end of file diff --git a/Tidstagning.sln b/Tidstagning.sln index 17b650b..3c05fae 100644 --- a/Tidstagning.sln +++ b/Tidstagning.sln @@ -1,22 +1,25 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30330.147 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31808.319 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tidstagning", "Tidstagning\Tidstagning.csproj", "{DFE0844B-9986-4623-8188-7F4A828FBB02}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tidstagning", "Tidstagning\Tidstagning.csproj", "{5AF4CA7E-39CF-4DB6-BED3-4FDB23BEDE86}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DFE0844B-9986-4623-8188-7F4A828FBB02}.Debug|x86.ActiveCfg = Debug|x86 - {DFE0844B-9986-4623-8188-7F4A828FBB02}.Debug|x86.Build.0 = Debug|x86 + {5AF4CA7E-39CF-4DB6-BED3-4FDB23BEDE86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5AF4CA7E-39CF-4DB6-BED3-4FDB23BEDE86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5AF4CA7E-39CF-4DB6-BED3-4FDB23BEDE86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5AF4CA7E-39CF-4DB6-BED3-4FDB23BEDE86}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {37B43424-1917-4948-A936-67BBE67DED35} + SolutionGuid = {FF5491E4-A9E1-4EA9-86F1-3CF119710682} EndGlobalSection EndGlobal diff --git a/Tidstagning.suo b/Tidstagning.suo deleted file mode 100644 index 25e86f0951c5bdbf5c0def0e48ff1ed5149f761c..0000000000000000000000000000000000000000 GIT binary patch liter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Z{@aoFNv%+R3v&SJ&jXm| zy5tTmeMpPHh?wgIJ}2CRG}ljG2CyCP2mBG>j{#o+d=>CDzykp4*?$7~Q^3~&4+CBR zJOX$W@D0FYfNug010Dzb8Q=*3>-ZGlTYzr^o(4Pvcoy&+;Lia^0M7&d0`QlB?*LfG z?;`#yz>9#F0N(?AAMgXfUju#!I0|?f@Cx7<;8nnDfY$*(0{j^869CKmTf}c@XJIIWVX7!(ndDd+HHLi;G z4Zr;8d;j5l@bS;xa`mA{hJJlU1C`bh!#S(`L^ZtvS$zS)*8_kyKz;e+Vs_I&`LhB~ zR{_}OrWth)4kB$`{yBATRwjvm0d9-_uFO$+=Vsgz_{-Pd#`daw*La8L{}K1c@qn@M zd9~{i+&oKrumgHVpQ3N*&jzsLYZRUY5`y&SsZ*h9#VGf1{^11eR`GAfn*&%VGL&>4 zD!zH>IzrE(MWI|P5;@2>B2fF;hl|$N_|&r{sQalY^&|^%J{3>GRKGtiOtcX7j`9`~ z?^-Fv*ov*ILzZ}`M8CQ=sN^A$!$|#XUo~)(z{o3=YYbznq-Md$QaNG1fqo;UnOQ(- zSXrCi0y#miMj=O+8Yri1;2KusGqyy27PN%^6g|pIp_7zkC+ExZ@nHUrv4!@`f)-NG zT^2k-3x0WPsLzd*4^BDdx}zkf*-hX2cV{5FET~(sT#c#WqN8^pK|Qh6U8Z9V`}s#g zJ>B>=X43wDrL&Ny%eE#spI>}urJE<@|3pm$kRlb%706IpE$4yQX?(X3TKnq}h384wS^w=Ai`jO%_~U+&r{~B+X5CMn-fb#*f z&RtUZYK>N(R{t80Rx>rseT~@wqSa$G zxNe|F&}5yV7fILSXygS_>*x(LGwd3bBUMUgxTN%;rc&5VA~te@T*^N|v}fx?DK>x{6_a942l>|Gcso4tD# zMoRyG>_r% signaler; uint signalLength = 500; - Timer timer; + System.Threading.Timer timer; Int16 idx = 0; public Procedure() diff --git a/Tidstagning/Properties/AssemblyInfo.cs b/Tidstagning/Properties/AssemblyInfo.cs deleted file mode 100644 index 154bc7e..0000000 --- a/Tidstagning/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tidstagning")] -[assembly: AssemblyDescription("Kontakt jens.chr.true@gmail.com - https://jcktrue.dk")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("LEAX")] -[assembly: AssemblyProduct("Tidstagning")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1f547dc7-1ba1-4877-9e70-dc09cc1d3f64")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.4.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tidstagning/Properties/Resources.Designer.cs b/Tidstagning/Properties/Resources.Designer.cs deleted file mode 100644 index 112f4b4..0000000 --- a/Tidstagning/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tidstagning.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tidstagning.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Tidstagning/Properties/Resources.resx b/Tidstagning/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/Tidstagning/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tidstagning/Properties/Settings.Designer.cs b/Tidstagning/Properties/Settings.Designer.cs index 98984e9..a2cc2f6 100644 --- a/Tidstagning/Properties/Settings.Designer.cs +++ b/Tidstagning/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace Tidstagning.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Tidstagning/Properties/app.manifest b/Tidstagning/Properties/app.manifest deleted file mode 100644 index 2856403..0000000 --- a/Tidstagning/Properties/app.manifest +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Tidstagning/Relay.cs b/Tidstagning/Relay.cs index 0972fd2..4486012 100644 --- a/Tidstagning/Relay.cs +++ b/Tidstagning/Relay.cs @@ -8,7 +8,7 @@ namespace Tidstagning class Relay { SerialPort com; - Timer cooldownTimer; + System.Threading.Timer cooldownTimer; struct SignalSpec { @@ -17,7 +17,7 @@ namespace Tidstagning }; Queue signals = new Queue(); bool processing_queue = false; - public Relay(string ComPort = null) + public Relay(string ComPort) { com = new SerialPort(); com.PortName = ComPort; diff --git a/Tidstagning/Settings.Designer.cs b/Tidstagning/Settings.Designer.cs new file mode 100644 index 0000000..ad5a00e --- /dev/null +++ b/Tidstagning/Settings.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tidstagning { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.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; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("N/A")] + public string ComPort { + get { + return ((string)(this["ComPort"])); + } + set { + this["ComPort"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool AutoStartProcedure { + get { + return ((bool)(this["AutoStartProcedure"])); + } + set { + this["AutoStartProcedure"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("500")] + public uint SignalLength { + get { + return ((uint)(this["SignalLength"])); + } + set { + this["SignalLength"] = value; + } + } + } +} diff --git a/Tidstagning/Startprocedure.txt b/Tidstagning/Startprocedure.txt deleted file mode 100644 index 0ca00d9..0000000 --- a/Tidstagning/Startprocedure.txt +++ /dev/null @@ -1,4 +0,0 @@ -18:00:00 -18:01:00 -18:04:00 -18:05:00 \ No newline at end of file diff --git a/Tidstagning/Tidstagning.csproj b/Tidstagning/Tidstagning.csproj index e9542fb..335db81 100644 --- a/Tidstagning/Tidstagning.csproj +++ b/Tidstagning/Tidstagning.csproj @@ -1,186 +1,36 @@ - - + + - Debug - x86 - 8.0.30703 - 2.0 - {DFE0844B-9986-4623-8188-7F4A828FBB02} WinExe - Properties - Tidstagning - Tidstagning - v4.7.2 - - - 512 - false - C:\Users\JCT\Documents\Tidstagning\ - true - Disk - false - Foreground - 7 - Days - false - false - false - Tidstagning - LEAX - false - 27 - 1.1.2.%2a - true - true - true - false + net6.0-windows + enable + true + enable + Tidstagning.Program - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - 86AFBD08924E61031114EAB5B6DF6585A43E2B5F - - - Tidstagning_TemporaryKey.pfx - - - true - - - false - - - icon.ico - - - - Custom - - - - + - - - - - - - - - - - - + + - - Form - - - AboutBox.cs - - - Form - - - ConfigUI.cs - - - - Form - - - MainUI.cs - - - - - - - - - AboutBox.cs - - - ConfigUI.cs - - - MainUI.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - + + True True - Resources.resx - True + Settings.settings - - - + + True + True + Settings.settings + + + + + SettingsSingleFileGenerator Settings.Designer.cs - - True - Settings.settings - True - - - - False - Microsoft .NET Framework 4 Client Profile %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - - - - + \ No newline at end of file diff --git a/Tidstagning/Tidstagning.csproj.user b/Tidstagning/Tidstagning.csproj.user index 96634b2..676249f 100644 --- a/Tidstagning/Tidstagning.csproj.user +++ b/Tidstagning/Tidstagning.csproj.user @@ -1,17 +1,14 @@  - - - C:\Users\JCT\Documents\Tidstagning\|G:\Tidstagning\|G:\|publish\ - - - - - - en-US - false - ProjectFiles - - - false - + + + + Form + + + Form + + + Form + + \ No newline at end of file diff --git a/Tidstagning/app.config b/Tidstagning/app.config deleted file mode 100644 index 99db4d3..0000000 --- a/Tidstagning/app.config +++ /dev/null @@ -1,22 +0,0 @@ - - - - -
- - - - - - - N/A - - - False - - - 500 - - - - diff --git a/Tidstagning/icon.ico b/Tidstagning/icon.ico deleted file mode 100644 index 01ff6d13813ac4b36605ad697fbc81704e22b86c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 104889 zcmeHP2|QHY`yW)=q(xd3NsAUmN}EuTc5NypiYTo}D>C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gn14qPI*+8Ab{Yb5We+s2a1c*5+b;oMzo2hy{DqKjVV Date: Wed, 15 Dec 2021 17:01:02 +0100 Subject: [PATCH 2/6] Clean up "Using" to remove implied includes. --- Tidstagning/AboutBox.cs | 2 +- Tidstagning/MainUI.cs | 4 ++-- Tidstagning/Procedure.cs | 10 ++++++---- Tidstagning/Relay.cs | 3 ++- Tidstagning/ResultList.cs | 2 +- Tidstagning/Tidstagning.csproj | 17 +++++++++++++++-- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Tidstagning/AboutBox.cs b/Tidstagning/AboutBox.cs index a004065..61ec8c4 100644 --- a/Tidstagning/AboutBox.cs +++ b/Tidstagning/AboutBox.cs @@ -32,7 +32,7 @@ namespace Tidstagning return titleAttribute.Title; } } - return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location); } } diff --git a/Tidstagning/MainUI.cs b/Tidstagning/MainUI.cs index 1e961b5..15a5e29 100644 --- a/Tidstagning/MainUI.cs +++ b/Tidstagning/MainUI.cs @@ -11,8 +11,8 @@ namespace Tidstagning { }; - ResultList liste; - Relay horn; + ResultList? liste; + Relay? horn; Procedure startprocedure = new Procedure(); public MainUI() diff --git a/Tidstagning/Procedure.cs b/Tidstagning/Procedure.cs index b922578..63de7ec 100644 --- a/Tidstagning/Procedure.cs +++ b/Tidstagning/Procedure.cs @@ -1,15 +1,17 @@ -using System.Diagnostics; +using System; +using System.Collections.Generic; +using System.Diagnostics; namespace Tidstagning { class Procedure { - Relay horn; - ResultList log; + Relay? horn; + ResultList? log; List signaler; uint signalLength = 500; - System.Threading.Timer timer; + System.Threading.Timer? timer; Int16 idx = 0; public Procedure() diff --git a/Tidstagning/Relay.cs b/Tidstagning/Relay.cs index 4486012..b6352c6 100644 --- a/Tidstagning/Relay.cs +++ b/Tidstagning/Relay.cs @@ -3,12 +3,13 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO.Ports; using System.Threading; + namespace Tidstagning { class Relay { SerialPort com; - System.Threading.Timer cooldownTimer; + System.Threading.Timer? cooldownTimer; struct SignalSpec { diff --git a/Tidstagning/ResultList.cs b/Tidstagning/ResultList.cs index 4f0dc6a..7299eaa 100644 --- a/Tidstagning/ResultList.cs +++ b/Tidstagning/ResultList.cs @@ -8,7 +8,7 @@ namespace Tidstagning System.IO.StreamWriter filehandle; System.IO.StreamWriter filehandle2; Tidstagning.MainUI parentForm; - string racenumber; + string racenumber = ""; public ResultList(string filename, Tidstagning.MainUI log_object) { filename = MakeSafeFilename(filename, '_'); diff --git a/Tidstagning/Tidstagning.csproj b/Tidstagning/Tidstagning.csproj index 335db81..5986309 100644 --- a/Tidstagning/Tidstagning.csproj +++ b/Tidstagning/Tidstagning.csproj @@ -4,9 +4,22 @@ WinExe net6.0-windows enable - true - enable + True + disable Tidstagning.Program + portable + False + none + + + + + True + + + + + True From dc3aedea1244750dd8926409e1ee8993cd08f959 Mon Sep 17 00:00:00 2001 From: Jens True Date: Wed, 15 Dec 2021 21:08:30 +0100 Subject: [PATCH 3/6] Remove warnings regarding possible references to NULL --- Tidstagning/AboutBox.cs | 9 ++++++++- Tidstagning/MainUI.cs | 2 +- Tidstagning/Procedure.cs | 28 ++++++++++++++++------------ Tidstagning/Relay.cs | 3 +-- Tidstagning/ResultList.cs | 21 ++++++++++----------- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/Tidstagning/AboutBox.cs b/Tidstagning/AboutBox.cs index 61ec8c4..b5faa79 100644 --- a/Tidstagning/AboutBox.cs +++ b/Tidstagning/AboutBox.cs @@ -40,7 +40,14 @@ namespace Tidstagning { get { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + if (Assembly.GetExecutingAssembly().GetName().Version != null) + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + else + { + return "N/A"; + } } } diff --git a/Tidstagning/MainUI.cs b/Tidstagning/MainUI.cs index 15a5e29..7268d5f 100644 --- a/Tidstagning/MainUI.cs +++ b/Tidstagning/MainUI.cs @@ -19,7 +19,7 @@ namespace Tidstagning { InitializeComponent(); System.IO.StreamReader deltager_handle = new System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + "Deltager.txt"); - string deltager; + string? deltager; while ((deltager = deltager_handle.ReadLine()) != null) { string[] dele = deltager.Split(','); diff --git a/Tidstagning/Procedure.cs b/Tidstagning/Procedure.cs index 63de7ec..f6ead64 100644 --- a/Tidstagning/Procedure.cs +++ b/Tidstagning/Procedure.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; - +using System.Threading; namespace Tidstagning { class Procedure @@ -11,7 +11,7 @@ namespace Tidstagning List signaler; uint signalLength = 500; - System.Threading.Timer? timer; + Timer? delayTimer; Int16 idx = 0; public Procedure() @@ -22,7 +22,7 @@ namespace Tidstagning public void ReadFile(string file) { System.IO.StreamReader procedure_handle = new System.IO.StreamReader(file); - string line; + string? line; while ((line = procedure_handle.ReadLine()) != null) { addEntry(line); @@ -76,8 +76,8 @@ namespace Tidstagning { signaler = new List(); idx = 0; - if (timer != null) - timer.Dispose(); + if (delayTimer != null) + delayTimer.Dispose(); } public void setObjects(Relay horn_obj, ResultList log_obj) @@ -114,18 +114,22 @@ namespace Tidstagning Run(); return;//time already passed } - log.Write("Næste signal: " + alertTime.ToString(@"HH\:mm\:ss") + " Om: " + timeToGo.ToString(@"hh\:mm\:ss")); - timer = new System.Threading.Timer(x => + if (log is not null) { - this.Alarm(); - }, null, timeToGo, new System.TimeSpan(0)); + log.Write("Næste signal: " + alertTime.ToString(@"HH\:mm\:ss") + " Om: " + timeToGo.ToString(@"hh\:mm\:ss")); + } + delayTimer = new Timer(x => + { + this.Alarm(); + }, null, timeToGo, new TimeSpan(0)); } private void Alarm() { - log.Write("HORN!"); - - horn.Sound(signalLength); + if(log is not null) + log.Write("HORN!"); + if(horn is not null) + horn.Sound(signalLength); next(); Run(); diff --git a/Tidstagning/Relay.cs b/Tidstagning/Relay.cs index b6352c6..a127454 100644 --- a/Tidstagning/Relay.cs +++ b/Tidstagning/Relay.cs @@ -9,7 +9,6 @@ namespace Tidstagning class Relay { SerialPort com; - System.Threading.Timer? cooldownTimer; struct SignalSpec { @@ -89,7 +88,7 @@ namespace Tidstagning Off(); } - cooldownTimer = new System.Threading.Timer(x => + System.Threading.Timer cooldownTimer = new System.Threading.Timer(x => { signals.Dequeue(); Run(); diff --git a/Tidstagning/ResultList.cs b/Tidstagning/ResultList.cs index 7299eaa..07cd4ef 100644 --- a/Tidstagning/ResultList.cs +++ b/Tidstagning/ResultList.cs @@ -4,16 +4,15 @@ namespace Tidstagning { class ResultList { - - System.IO.StreamWriter filehandle; - System.IO.StreamWriter filehandle2; + System.IO.StreamWriter filehandle_log; + System.IO.StreamWriter filehandle_results; Tidstagning.MainUI parentForm; string racenumber = ""; public ResultList(string filename, Tidstagning.MainUI log_object) { filename = MakeSafeFilename(filename, '_'); - filehandle = new System.IO.StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + filename + "_" + DateTime.Now.ToString(" dd-MM-yyyy HH-mm-ss") + ".txt"); - filehandle2 = new System.IO.StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + filename + "_" + DateTime.Now.ToString(" dd-MM-yyyy HH-mm-ss") + ".csv"); + filehandle_log = new System.IO.StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + filename + "_" + DateTime.Now.ToString(" dd-MM-yyyy HH-mm-ss") + ".txt"); + filehandle_results = new System.IO.StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + filename + "_" + DateTime.Now.ToString(" dd-MM-yyyy HH-mm-ss") + ".csv"); parentForm = log_object; } @@ -58,21 +57,21 @@ namespace Tidstagning public void Write(string textstring) { - filehandle.WriteLine(textstring); + filehandle_log.WriteLine(textstring); parentForm.LogAppend(textstring + "\r\n"); - filehandle.Flush(); + filehandle_log.Flush(); } public void WriteCSV(string textstring) { - filehandle2.WriteLine(textstring); - filehandle2.Flush(); + filehandle_results.WriteLine(textstring); + filehandle_results.Flush(); } public void Close() { - filehandle.Close(); - filehandle2.Close(); + filehandle_log.Close(); + filehandle_results.Close(); } } From 300377e7caead25e2a7f98b4d8d424a7e921d292 Mon Sep 17 00:00:00 2001 From: Jens True Date: Sun, 1 May 2022 13:50:42 +0200 Subject: [PATCH 4/6] Cleanup. Config parameter for configuration menu --- Tidstagning/AboutBox.Designer.cs | 60 +++++++------ Tidstagning/AboutBox.resx | 62 +------------ Tidstagning/ConfigUI.Designer.cs | 94 ++++++++++---------- Tidstagning/ConfigUI.cs | 14 +-- Tidstagning/ConfigUI.resx | 62 +------------ Tidstagning/MainUI.Designer.cs | 146 +++++++++++++++++-------------- Tidstagning/MainUI.cs | 5 +- Tidstagning/MainUI.resx | 62 +------------ Tidstagning/Program.cs | 30 +++++-- Tidstagning/Tidstagning.csproj | 3 +- 10 files changed, 198 insertions(+), 340 deletions(-) diff --git a/Tidstagning/AboutBox.Designer.cs b/Tidstagning/AboutBox.Designer.cs index a1b7ff8..6c14dbb 100644 --- a/Tidstagning/AboutBox.Designer.cs +++ b/Tidstagning/AboutBox.Designer.cs @@ -53,7 +53,8 @@ this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9); + this.tableLayoutPanel.Location = new System.Drawing.Point(10, 10); + this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.tableLayoutPanel.Name = "tableLayoutPanel"; this.tableLayoutPanel.RowCount = 6; this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); @@ -62,17 +63,18 @@ this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265); + this.tableLayoutPanel.Size = new System.Drawing.Size(487, 307); this.tableLayoutPanel.TabIndex = 0; // // logoPictureBox // this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image"))); - this.logoPictureBox.Location = new System.Drawing.Point(3, 3); + this.logoPictureBox.Location = new System.Drawing.Point(4, 3); + this.logoPictureBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.logoPictureBox.Name = "logoPictureBox"; this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); - this.logoPictureBox.Size = new System.Drawing.Size(131, 259); + this.logoPictureBox.Size = new System.Drawing.Size(152, 301); this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.logoPictureBox.TabIndex = 12; this.logoPictureBox.TabStop = false; @@ -80,11 +82,11 @@ // labelProductName // this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelProductName.Location = new System.Drawing.Point(143, 0); - this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17); + this.labelProductName.Location = new System.Drawing.Point(167, 0); + this.labelProductName.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + this.labelProductName.MaximumSize = new System.Drawing.Size(0, 20); this.labelProductName.Name = "labelProductName"; - this.labelProductName.Size = new System.Drawing.Size(271, 17); + this.labelProductName.Size = new System.Drawing.Size(316, 20); this.labelProductName.TabIndex = 19; this.labelProductName.Text = "Tidstagning"; this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -92,11 +94,11 @@ // labelVersion // this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelVersion.Location = new System.Drawing.Point(143, 26); - this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17); + this.labelVersion.Location = new System.Drawing.Point(167, 30); + this.labelVersion.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + this.labelVersion.MaximumSize = new System.Drawing.Size(0, 20); this.labelVersion.Name = "labelVersion"; - this.labelVersion.Size = new System.Drawing.Size(271, 17); + this.labelVersion.Size = new System.Drawing.Size(316, 20); this.labelVersion.TabIndex = 0; this.labelVersion.Text = "Version 1.0"; this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -104,11 +106,11 @@ // labelCopyright // this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCopyright.Location = new System.Drawing.Point(143, 52); - this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17); + this.labelCopyright.Location = new System.Drawing.Point(167, 60); + this.labelCopyright.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 20); this.labelCopyright.Name = "labelCopyright"; - this.labelCopyright.Size = new System.Drawing.Size(271, 17); + this.labelCopyright.Size = new System.Drawing.Size(316, 20); this.labelCopyright.TabIndex = 21; this.labelCopyright.Text = "Copyright © 2021"; this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -116,11 +118,11 @@ // labelCompanyName // this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCompanyName.Location = new System.Drawing.Point(143, 78); - this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); - this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17); + this.labelCompanyName.Location = new System.Drawing.Point(167, 90); + this.labelCompanyName.Margin = new System.Windows.Forms.Padding(7, 0, 4, 0); + this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 20); this.labelCompanyName.Name = "labelCompanyName"; - this.labelCompanyName.Size = new System.Drawing.Size(271, 17); + this.labelCompanyName.Size = new System.Drawing.Size(316, 20); this.labelCompanyName.TabIndex = 22; this.labelCompanyName.Text = "LEAX A/S"; this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -128,13 +130,13 @@ // textBoxDescription // this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxDescription.Location = new System.Drawing.Point(143, 107); - this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); + this.textBoxDescription.Location = new System.Drawing.Point(167, 123); + this.textBoxDescription.Margin = new System.Windows.Forms.Padding(7, 3, 4, 3); this.textBoxDescription.Multiline = true; this.textBoxDescription.Name = "textBoxDescription"; this.textBoxDescription.ReadOnly = true; this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBoxDescription.Size = new System.Drawing.Size(271, 126); + this.textBoxDescription.Size = new System.Drawing.Size(316, 147); this.textBoxDescription.TabIndex = 23; this.textBoxDescription.TabStop = false; this.textBoxDescription.Text = "Kontakt jens.chr.true@gmail.com\r\nhttps://jcktrue.dk"; @@ -143,9 +145,10 @@ // this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.okButton.Location = new System.Drawing.Point(339, 239); + this.okButton.Location = new System.Drawing.Point(395, 277); + this.okButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 23); + this.okButton.Size = new System.Drawing.Size(88, 27); this.okButton.TabIndex = 24; this.okButton.Text = "&OK"; this.okButton.Click += new System.EventHandler(this.okButton_Click); @@ -153,15 +156,16 @@ // AboutBox // this.AcceptButton = this.okButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(435, 283); + this.ClientSize = new System.Drawing.Size(507, 327); this.Controls.Add(this.tableLayoutPanel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "AboutBox"; - this.Padding = new System.Windows.Forms.Padding(9); + this.Padding = new System.Windows.Forms.Padding(10); this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; diff --git a/Tidstagning/AboutBox.resx b/Tidstagning/AboutBox.resx index 76cc9af..119d188 100644 --- a/Tidstagning/AboutBox.resx +++ b/Tidstagning/AboutBox.resx @@ -1,64 +1,4 @@ - - - + diff --git a/Tidstagning/ConfigUI.Designer.cs b/Tidstagning/ConfigUI.Designer.cs index 2b0dc4b..4777e9a 100644 --- a/Tidstagning/ConfigUI.Designer.cs +++ b/Tidstagning/ConfigUI.Designer.cs @@ -48,25 +48,26 @@ namespace Tidstagning this.label3 = new System.Windows.Forms.Label(); this.comboBoxBaudRate = new System.Windows.Forms.ComboBox(); this.panelRelaySettings = new System.Windows.Forms.Panel(); - this.textBox3 = new System.Windows.Forms.TextBox(); this.panelRelaySettings.SuspendLayout(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(4, 12); + this.label1.Location = new System.Drawing.Point(5, 14); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(131, 13); + this.label1.Size = new System.Drawing.Size(148, 15); this.label1.TabIndex = 0; this.label1.Text = "Select folder for input files."; // // checkBoxRelay // this.checkBoxRelay.AutoSize = true; - this.checkBoxRelay.Location = new System.Drawing.Point(7, 98); + this.checkBoxRelay.Location = new System.Drawing.Point(8, 113); + this.checkBoxRelay.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.checkBoxRelay.Name = "checkBoxRelay"; - this.checkBoxRelay.Size = new System.Drawing.Size(95, 17); + this.checkBoxRelay.Size = new System.Drawing.Size(97, 19); this.checkBoxRelay.TabIndex = 2; this.checkBoxRelay.Text = "Enable Relay?"; this.checkBoxRelay.UseVisualStyleBackColor = true; @@ -78,9 +79,10 @@ namespace Tidstagning // // buttonFolderOutput // - this.buttonFolderOutput.Location = new System.Drawing.Point(314, 72); + this.buttonFolderOutput.Location = new System.Drawing.Point(366, 83); + this.buttonFolderOutput.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.buttonFolderOutput.Name = "buttonFolderOutput"; - this.buttonFolderOutput.Size = new System.Drawing.Size(75, 23); + this.buttonFolderOutput.Size = new System.Drawing.Size(88, 27); this.buttonFolderOutput.TabIndex = 3; this.buttonFolderOutput.Text = "Pick output folder"; this.buttonFolderOutput.UseVisualStyleBackColor = true; @@ -92,9 +94,10 @@ namespace Tidstagning // // buttonFolderInput // - this.buttonFolderInput.Location = new System.Drawing.Point(314, 28); + this.buttonFolderInput.Location = new System.Drawing.Point(366, 32); + this.buttonFolderInput.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.buttonFolderInput.Name = "buttonFolderInput"; - this.buttonFolderInput.Size = new System.Drawing.Size(75, 23); + this.buttonFolderInput.Size = new System.Drawing.Size(88, 27); this.buttonFolderInput.TabIndex = 4; this.buttonFolderInput.Text = "Pick input folder"; this.buttonFolderInput.UseVisualStyleBackColor = true; @@ -102,24 +105,27 @@ namespace Tidstagning // // textPathInput // - this.textPathInput.Location = new System.Drawing.Point(7, 28); + this.textPathInput.Location = new System.Drawing.Point(8, 32); + this.textPathInput.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.textPathInput.Name = "textPathInput"; - this.textPathInput.Size = new System.Drawing.Size(301, 20); + this.textPathInput.Size = new System.Drawing.Size(350, 23); this.textPathInput.TabIndex = 5; // // textPathOutput // - this.textPathOutput.Location = new System.Drawing.Point(7, 72); + this.textPathOutput.Location = new System.Drawing.Point(8, 83); + this.textPathOutput.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.textPathOutput.Name = "textPathOutput"; - this.textPathOutput.Size = new System.Drawing.Size(301, 20); + this.textPathOutput.Size = new System.Drawing.Size(350, 23); this.textPathOutput.TabIndex = 6; // // buttonSave // this.buttonSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonSave.Location = new System.Drawing.Point(318, 280); + this.buttonSave.Location = new System.Drawing.Point(371, 323); + this.buttonSave.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.buttonSave.Name = "buttonSave"; - this.buttonSave.Size = new System.Drawing.Size(75, 23); + this.buttonSave.Size = new System.Drawing.Size(88, 27); this.buttonSave.TabIndex = 7; this.buttonSave.Text = "Save"; this.buttonSave.UseVisualStyleBackColor = true; @@ -129,9 +135,10 @@ namespace Tidstagning // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(13, 280); + this.buttonCancel.Location = new System.Drawing.Point(15, 323); + this.buttonCancel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.Size = new System.Drawing.Size(88, 27); this.buttonCancel.TabIndex = 8; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; @@ -140,42 +147,46 @@ namespace Tidstagning // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(4, 56); + this.label2.Location = new System.Drawing.Point(5, 65); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(138, 13); + this.label2.Size = new System.Drawing.Size(156, 15); this.label2.TabIndex = 9; this.label2.Text = "Select folder for output files."; // // textBox2 // - this.textBox2.Location = new System.Drawing.Point(259, 17); + this.textBox2.Location = new System.Drawing.Point(299, 18); + this.textBox2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(100, 20); + this.textBox2.Size = new System.Drawing.Size(116, 23); this.textBox2.TabIndex = 5; // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(141, 17); + this.textBox1.Location = new System.Drawing.Point(161, 18); + this.textBox1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.Size = new System.Drawing.Size(116, 23); this.textBox1.TabIndex = 4; - this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); // // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(256, 0); + this.label5.Location = new System.Drawing.Point(299, 0); + this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(71, 13); + this.label5.Size = new System.Drawing.Size(84, 15); this.label5.TabIndex = 3; this.label5.Text = "Off Command"; // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(138, 0); + this.label4.Location = new System.Drawing.Point(161, 0); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(71, 13); + this.label4.Size = new System.Drawing.Size(83, 15); this.label4.TabIndex = 2; this.label4.Text = "On Command"; // @@ -183,8 +194,9 @@ namespace Tidstagning // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(2, 0); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(50, 13); + this.label3.Size = new System.Drawing.Size(54, 15); this.label3.TabIndex = 1; this.label3.Text = "Baudrate"; // @@ -206,14 +218,14 @@ namespace Tidstagning "230400", "460800", "921600"}); - this.comboBoxBaudRate.Location = new System.Drawing.Point(0, 16); + this.comboBoxBaudRate.Location = new System.Drawing.Point(0, 18); + this.comboBoxBaudRate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.comboBoxBaudRate.Name = "comboBoxBaudRate"; - this.comboBoxBaudRate.Size = new System.Drawing.Size(121, 21); + this.comboBoxBaudRate.Size = new System.Drawing.Size(140, 23); this.comboBoxBaudRate.TabIndex = 0; // // panelRelaySettings // - this.panelRelaySettings.Controls.Add(this.textBox3); this.panelRelaySettings.Controls.Add(this.textBox2); this.panelRelaySettings.Controls.Add(this.label5); this.panelRelaySettings.Controls.Add(this.textBox1); @@ -221,25 +233,19 @@ namespace Tidstagning this.panelRelaySettings.Controls.Add(this.label3); this.panelRelaySettings.Controls.Add(this.label4); this.panelRelaySettings.Enabled = false; - this.panelRelaySettings.Location = new System.Drawing.Point(7, 121); + this.panelRelaySettings.Location = new System.Drawing.Point(8, 140); + this.panelRelaySettings.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.panelRelaySettings.Name = "panelRelaySettings"; - this.panelRelaySettings.Size = new System.Drawing.Size(386, 68); + this.panelRelaySettings.Size = new System.Drawing.Size(450, 60); this.panelRelaySettings.TabIndex = 11; // - // textBox3 - // - this.textBox3.Location = new System.Drawing.Point(20, 44); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(100, 20); - this.textBox3.TabIndex = 6; - // // ConfigUI // this.AcceptButton = this.buttonSave; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(405, 315); + this.ClientSize = new System.Drawing.Size(472, 363); this.Controls.Add(this.panelRelaySettings); this.Controls.Add(this.label2); this.Controls.Add(this.buttonCancel); @@ -252,6 +258,7 @@ namespace Tidstagning this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ConfigUI"; @@ -284,6 +291,5 @@ namespace Tidstagning private System.Windows.Forms.Label label3; private System.Windows.Forms.ComboBox comboBoxBaudRate; private System.Windows.Forms.Panel panelRelaySettings; - private System.Windows.Forms.TextBox textBox3; } } \ No newline at end of file diff --git a/Tidstagning/ConfigUI.cs b/Tidstagning/ConfigUI.cs index 89a112b..fc42f85 100644 --- a/Tidstagning/ConfigUI.cs +++ b/Tidstagning/ConfigUI.cs @@ -46,19 +46,7 @@ namespace Tidstagning private void checkBoxRelay_CheckedChanged(object sender, EventArgs e) { - panelRelaySettings.Enabled = checkBoxRelay.Enabled; - } - - private void textBox1_TextChanged(object sender, EventArgs e) - { - try - { - textBox3.Text = Regex.Unescape(textBox1.Text); - } - catch - { - textBox3.Text = ""; - } + panelRelaySettings.Enabled = checkBoxRelay.Checked; } } } diff --git a/Tidstagning/ConfigUI.resx b/Tidstagning/ConfigUI.resx index 2ea699c..4592154 100644 --- a/Tidstagning/ConfigUI.resx +++ b/Tidstagning/ConfigUI.resx @@ -1,64 +1,4 @@ - - - + diff --git a/Tidstagning/MainUI.Designer.cs b/Tidstagning/MainUI.Designer.cs index d3adb85..0d722f4 100644 --- a/Tidstagning/MainUI.Designer.cs +++ b/Tidstagning/MainUI.Designer.cs @@ -41,7 +41,9 @@ this.txtHeader = new System.Windows.Forms.TextBox(); this.grid = new System.Windows.Forms.DataGridView(); this.Complete = new System.Windows.Forms.DataGridViewButtonColumn(); + this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.DNF = new System.Windows.Forms.DataGridViewButtonColumn(); + this.entryBindingSource = new System.Windows.Forms.BindingSource(this.components); this.txtLog = new System.Windows.Forms.TableLayoutPanel(); this.lblClock = new System.Windows.Forms.Label(); this.flowLayoutPanelConfiguration = new System.Windows.Forms.FlowLayoutPanel(); @@ -51,23 +53,22 @@ this.label2 = new System.Windows.Forms.Label(); this.buttonConfig = new System.Windows.Forms.Button(); this.Clock = new System.Windows.Forms.Timer(this.components); - this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.entryBindingSource = new System.Windows.Forms.BindingSource(this.components); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).BeginInit(); this.txtLog.SuspendLayout(); this.flowLayoutPanelConfiguration.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericSignalLength)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).BeginInit(); this.SuspendLayout(); // // btnTest // this.btnTest.Dock = System.Windows.Forms.DockStyle.Bottom; - this.btnTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); - this.btnTest.Location = new System.Drawing.Point(0, 464); + this.btnTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnTest.Location = new System.Drawing.Point(0, 542); + this.btnTest.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.btnTest.Name = "btnTest"; - this.btnTest.Size = new System.Drawing.Size(264, 37); + this.btnTest.Size = new System.Drawing.Size(307, 43); this.btnTest.TabIndex = 3; this.btnTest.Text = "HORN 🔊"; this.btnTest.UseVisualStyleBackColor = true; @@ -75,9 +76,10 @@ // // buttonHelp // - this.buttonHelp.Location = new System.Drawing.Point(3, 56); + this.buttonHelp.Location = new System.Drawing.Point(4, 61); + this.buttonHelp.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.buttonHelp.Name = "buttonHelp"; - this.buttonHelp.Size = new System.Drawing.Size(75, 23); + this.buttonHelp.Size = new System.Drawing.Size(88, 27); this.buttonHelp.TabIndex = 14; this.buttonHelp.Text = "Hjælp mm."; this.buttonHelp.UseVisualStyleBackColor = true; @@ -86,13 +88,14 @@ // txtDebug // this.txtDebug.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtDebug.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F); - this.txtDebug.Location = new System.Drawing.Point(273, 551); + this.txtDebug.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtDebug.Location = new System.Drawing.Point(319, 635); + this.txtDebug.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.txtDebug.Multiline = true; this.txtDebug.Name = "txtDebug"; this.txtDebug.ReadOnly = true; this.txtDebug.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txtDebug.Size = new System.Drawing.Size(489, 140); + this.txtDebug.Size = new System.Drawing.Size(569, 163); this.txtDebug.TabIndex = 10; // // panel1 @@ -103,31 +106,34 @@ this.panel1.Controls.Add(this.btnStart); this.panel1.Controls.Add(this.btnStop); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(3, 44); + this.panel1.Location = new System.Drawing.Point(4, 44); + this.panel1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(264, 501); + this.panel1.Size = new System.Drawing.Size(307, 585); this.panel1.TabIndex = 8; // // textStartProcedure // this.textStartProcedure.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.textStartProcedure.Font = new System.Drawing.Font("Lucida Sans Typewriter", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.textStartProcedure.Location = new System.Drawing.Point(3, 137); + this.textStartProcedure.Font = new System.Drawing.Font("Lucida Sans Typewriter", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.textStartProcedure.Location = new System.Drawing.Point(4, 158); + this.textStartProcedure.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.textStartProcedure.Multiline = true; this.textStartProcedure.Name = "textStartProcedure"; this.textStartProcedure.ReadOnly = true; this.textStartProcedure.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textStartProcedure.Size = new System.Drawing.Size(258, 321); + this.textStartProcedure.Size = new System.Drawing.Size(300, 377); this.textStartProcedure.TabIndex = 10; this.textStartProcedure.WordWrap = false; // // checkStartProcedure // this.checkStartProcedure.AutoSize = true; - this.checkStartProcedure.Location = new System.Drawing.Point(7, 114); + this.checkStartProcedure.Location = new System.Drawing.Point(8, 132); + this.checkStartProcedure.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.checkStartProcedure.Name = "checkStartProcedure"; - this.checkStartProcedure.Size = new System.Drawing.Size(155, 17); + this.checkStartProcedure.Size = new System.Drawing.Size(171, 19); this.checkStartProcedure.TabIndex = 8; this.checkStartProcedure.Text = "Automatisk Start Procedure"; this.checkStartProcedure.UseVisualStyleBackColor = true; @@ -135,10 +141,11 @@ // // btnStart // - this.btnStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); - this.btnStart.Location = new System.Drawing.Point(3, 3); + this.btnStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnStart.Location = new System.Drawing.Point(4, 3); + this.btnStart.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.btnStart.Name = "btnStart"; - this.btnStart.Size = new System.Drawing.Size(258, 37); + this.btnStart.Size = new System.Drawing.Size(301, 43); this.btnStart.TabIndex = 4; this.btnStart.Text = "Start ▶"; this.btnStart.UseVisualStyleBackColor = true; @@ -147,10 +154,11 @@ // btnStop // this.btnStop.Enabled = false; - this.btnStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); - this.btnStop.Location = new System.Drawing.Point(3, 46); + this.btnStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.btnStop.Location = new System.Drawing.Point(4, 53); + this.btnStop.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.btnStop.Name = "btnStop"; - this.btnStop.Size = new System.Drawing.Size(258, 40); + this.btnStop.Size = new System.Drawing.Size(301, 46); this.btnStop.TabIndex = 6; this.btnStop.Text = "Stop ■"; this.btnStop.UseVisualStyleBackColor = true; @@ -159,10 +167,11 @@ // txtHeader // this.txtHeader.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); - this.txtHeader.Location = new System.Drawing.Point(3, 3); + this.txtHeader.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.txtHeader.Location = new System.Drawing.Point(4, 3); + this.txtHeader.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.txtHeader.Name = "txtHeader"; - this.txtHeader.Size = new System.Drawing.Size(264, 35); + this.txtHeader.Size = new System.Drawing.Size(307, 35); this.txtHeader.TabIndex = 3; // // grid @@ -183,17 +192,18 @@ this.grid.DataSource = this.entryBindingSource; this.grid.Dock = System.Windows.Forms.DockStyle.Fill; this.grid.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.grid.Location = new System.Drawing.Point(273, 3); + this.grid.Location = new System.Drawing.Point(319, 3); + this.grid.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.grid.MultiSelect = false; this.grid.Name = "grid"; this.grid.ReadOnly = true; this.grid.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; this.txtLog.SetRowSpan(this.grid, 2); - this.grid.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.grid.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.grid.RowTemplate.Height = 30; this.grid.RowTemplate.ReadOnly = true; this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.grid.Size = new System.Drawing.Size(1039, 542); + this.grid.Size = new System.Drawing.Size(1211, 626); this.grid.TabIndex = 0; this.grid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grid_Click); this.grid.CellMouseEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.grid_CellMouseEnter); @@ -208,6 +218,13 @@ this.Complete.ReadOnly = true; this.Complete.Text = "Mål"; // + // nameDataGridViewTextBoxColumn + // + this.nameDataGridViewTextBoxColumn.DataPropertyName = "SailNumber"; + this.nameDataGridViewTextBoxColumn.HeaderText = "Sejlnummer"; + this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn"; + this.nameDataGridViewTextBoxColumn.ReadOnly = true; + // // DNF // this.DNF.HeaderText = "DNF"; @@ -216,12 +233,16 @@ this.DNF.Text = "Udgået"; this.DNF.UseColumnTextForButtonValue = true; // + // entryBindingSource + // + this.entryBindingSource.DataSource = typeof(Tidstagning.Entry); + // // txtLog // this.txtLog.ColumnCount = 3; - this.txtLog.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 270F)); + this.txtLog.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 315F)); this.txtLog.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.txtLog.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 550F)); + this.txtLog.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 642F)); this.txtLog.Controls.Add(this.grid, 1, 0); this.txtLog.Controls.Add(this.txtHeader, 0, 0); this.txtLog.Controls.Add(this.txtDebug, 1, 2); @@ -230,13 +251,14 @@ this.txtLog.Controls.Add(this.flowLayoutPanelConfiguration, 0, 2); this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill; this.txtLog.Location = new System.Drawing.Point(0, 0); + this.txtLog.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.txtLog.Name = "txtLog"; this.txtLog.RowCount = 3; this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 77.77778F)); this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 22.22222F)); - this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.txtLog.Size = new System.Drawing.Size(1315, 694); + this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 23F)); + this.txtLog.Size = new System.Drawing.Size(1534, 801); this.txtLog.TabIndex = 8; // // lblClock @@ -245,10 +267,11 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblClock.AutoSize = true; - this.lblClock.Font = new System.Drawing.Font("Lucida Sans Typewriter", 72F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblClock.Location = new System.Drawing.Point(768, 548); + this.lblClock.Font = new System.Drawing.Font("Lucida Sans Typewriter", 72F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.lblClock.Location = new System.Drawing.Point(896, 632); + this.lblClock.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblClock.Name = "lblClock"; - this.lblClock.Size = new System.Drawing.Size(544, 146); + this.lblClock.Size = new System.Drawing.Size(634, 169); this.lblClock.TabIndex = 16; this.lblClock.Text = "--:--:--"; this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -262,9 +285,10 @@ this.flowLayoutPanelConfiguration.Controls.Add(this.buttonHelp); this.flowLayoutPanelConfiguration.Controls.Add(this.buttonConfig); this.flowLayoutPanelConfiguration.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanelConfiguration.Location = new System.Drawing.Point(3, 551); + this.flowLayoutPanelConfiguration.Location = new System.Drawing.Point(4, 635); + this.flowLayoutPanelConfiguration.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.flowLayoutPanelConfiguration.Name = "flowLayoutPanelConfiguration"; - this.flowLayoutPanelConfiguration.Size = new System.Drawing.Size(264, 140); + this.flowLayoutPanelConfiguration.Size = new System.Drawing.Size(307, 163); this.flowLayoutPanelConfiguration.TabIndex = 15; // // numericSignalLength @@ -274,7 +298,8 @@ 0, 0, 0}); - this.numericSignalLength.Location = new System.Drawing.Point(3, 3); + this.numericSignalLength.Location = new System.Drawing.Point(4, 3); + this.numericSignalLength.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.numericSignalLength.Maximum = new decimal(new int[] { 5000, 0, @@ -286,7 +311,7 @@ 0, 0}); this.numericSignalLength.Name = "numericSignalLength"; - this.numericSignalLength.Size = new System.Drawing.Size(121, 20); + this.numericSignalLength.Size = new System.Drawing.Size(141, 23); this.numericSignalLength.TabIndex = 30; this.numericSignalLength.Value = new decimal(new int[] { 500, @@ -298,8 +323,9 @@ // label1 // this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(130, 0); + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label1.Location = new System.Drawing.Point(153, 0); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(121, 24); this.label1.TabIndex = 27; @@ -309,17 +335,19 @@ // this.comboComport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboComport.FormattingEnabled = true; - this.comboComport.Location = new System.Drawing.Point(3, 29); + this.comboComport.Location = new System.Drawing.Point(4, 32); + this.comboComport.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.comboComport.Name = "comboComport"; - this.comboComport.Size = new System.Drawing.Size(121, 21); + this.comboComport.Size = new System.Drawing.Size(140, 23); this.comboComport.TabIndex = 28; this.comboComport.SelectedIndexChanged += new System.EventHandler(this.comboComport_SelectedIndexChanged); // // label2 // this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(130, 26); + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.label2.Location = new System.Drawing.Point(152, 29); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(88, 24); this.label2.TabIndex = 31; @@ -327,13 +355,13 @@ // // buttonConfig // - this.buttonConfig.Location = new System.Drawing.Point(84, 56); + this.buttonConfig.Location = new System.Drawing.Point(100, 61); + this.buttonConfig.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.buttonConfig.Name = "buttonConfig"; - this.buttonConfig.Size = new System.Drawing.Size(90, 23); + this.buttonConfig.Size = new System.Drawing.Size(105, 27); this.buttonConfig.TabIndex = 29; this.buttonConfig.Text = "Konfiguration"; this.buttonConfig.UseVisualStyleBackColor = true; - this.buttonConfig.Visible = false; this.buttonConfig.Click += new System.EventHandler(this.buttonConfig_Click); // // Clock @@ -341,27 +369,17 @@ this.Clock.Enabled = true; this.Clock.Tick += new System.EventHandler(this.Clock_Tick); // - // nameDataGridViewTextBoxColumn - // - this.nameDataGridViewTextBoxColumn.DataPropertyName = "SailNumber"; - this.nameDataGridViewTextBoxColumn.HeaderText = "Sejlnummer"; - this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn"; - this.nameDataGridViewTextBoxColumn.ReadOnly = true; - // - // entryBindingSource - // - this.entryBindingSource.DataSource = typeof(Tidstagning.Entry); - // // MainUI // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ClientSize = new System.Drawing.Size(1315, 694); + this.ClientSize = new System.Drawing.Size(1534, 801); this.Controls.Add(this.txtLog); this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Name = "MainUI"; this.Text = "Tidstagning"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; @@ -369,12 +387,12 @@ this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).EndInit(); this.txtLog.ResumeLayout(false); this.txtLog.PerformLayout(); this.flowLayoutPanelConfiguration.ResumeLayout(false); this.flowLayoutPanelConfiguration.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericSignalLength)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).EndInit(); this.ResumeLayout(false); } diff --git a/Tidstagning/MainUI.cs b/Tidstagning/MainUI.cs index 7268d5f..de9d867 100644 --- a/Tidstagning/MainUI.cs +++ b/Tidstagning/MainUI.cs @@ -15,7 +15,7 @@ namespace Tidstagning Relay? horn; Procedure startprocedure = new Procedure(); - public MainUI() + public MainUI(bool ShowConfig = false) { InitializeComponent(); System.IO.StreamReader deltager_handle = new System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + "Deltager.txt"); @@ -45,6 +45,9 @@ namespace Tidstagning { comboComport.SelectedIndex = index; } + + buttonConfig.Visible = ShowConfig; + } diff --git a/Tidstagning/MainUI.resx b/Tidstagning/MainUI.resx index 570edf9..bff6362 100644 --- a/Tidstagning/MainUI.resx +++ b/Tidstagning/MainUI.resx @@ -1,64 +1,4 @@ - - - + diff --git a/Tidstagning/Program.cs b/Tidstagning/Program.cs index 813bdbc..3431f90 100644 --- a/Tidstagning/Program.cs +++ b/Tidstagning/Program.cs @@ -1,19 +1,37 @@ -using System; +using CommandLine; +using System; +using System.Collections.Generic; using System.Windows.Forms; namespace Tidstagning { static class Program { - /// - /// The main entry point for the application. - /// + + public class Options + { + [Option('c', "config", Required = false, HelpText = "Enable configuration menu.")] + public bool Config { get; set; } + } + [STAThread] - static void Main() + static void Main(string[] args) + { + CommandLine.Parser.Default.ParseArguments(args) + .WithParsed(RunOptions) + .WithNotParsed(HandleParseError); + + } + static void RunOptions(Options opts) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainUI()); + Application.Run(new MainUI(opts.Config)); } + static void HandleParseError(IEnumerable errs) + { + MessageBox.Show("Failed to start\n" + errs.ToString()); + } + } } diff --git a/Tidstagning/Tidstagning.csproj b/Tidstagning/Tidstagning.csproj index 5986309..d2b19d9 100644 --- a/Tidstagning/Tidstagning.csproj +++ b/Tidstagning/Tidstagning.csproj @@ -23,7 +23,8 @@ - + + From 660b5a8e49c379e8dedb0f04523a728a2ecde2ee Mon Sep 17 00:00:00 2001 From: Jens True Date: Sun, 1 May 2022 22:29:00 +0200 Subject: [PATCH 5/6] Clear out nullable warnings --- Tidstagning/AboutBox.cs | 6 ++++-- Tidstagning/ConfigUI.cs | 4 ---- Tidstagning/MainUI.cs | 24 ++++++++++++++++-------- Tidstagning/Program.cs | 4 +--- Tidstagning/Tidstagning.csproj | 4 ++++ 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Tidstagning/AboutBox.cs b/Tidstagning/AboutBox.cs index b5faa79..a1e3da3 100644 --- a/Tidstagning/AboutBox.cs +++ b/Tidstagning/AboutBox.cs @@ -40,9 +40,11 @@ namespace Tidstagning { get { - if (Assembly.GetExecutingAssembly().GetName().Version != null) + Version? version = Assembly.GetExecutingAssembly().GetName().Version; + if (version is not null) { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + return version.ToString(); + } else { diff --git a/Tidstagning/ConfigUI.cs b/Tidstagning/ConfigUI.cs index fc42f85..d493d94 100644 --- a/Tidstagning/ConfigUI.cs +++ b/Tidstagning/ConfigUI.cs @@ -12,10 +12,6 @@ namespace Tidstagning { public partial class ConfigUI : Form { - - private String OnCommand = ""; - private String OffCommand = ""; - public ConfigUI() { InitializeComponent(); diff --git a/Tidstagning/MainUI.cs b/Tidstagning/MainUI.cs index de9d867..94fa9b2 100644 --- a/Tidstagning/MainUI.cs +++ b/Tidstagning/MainUI.cs @@ -77,7 +77,8 @@ namespace Tidstagning if (e.RowIndex >= 0 && e.ColumnIndex == grid.Columns["DNF"].Index) { entries[e.RowIndex].DNF(); - liste.WriteDNF(entries[e.RowIndex]); + if(liste is not null) + liste.WriteDNF(entries[e.RowIndex]); grid.ClearSelection(); grid.CurrentCell = null; @@ -86,13 +87,15 @@ namespace Tidstagning if (e.RowIndex >= 0 && e.ColumnIndex == grid.Columns["Complete"].Index) { entries[e.RowIndex].Complete(); - liste.WriteComplete(entries[e.RowIndex]); + if(liste is not null) + liste.WriteComplete(entries[e.RowIndex]); grid.ClearSelection(); grid.CurrentCell = null; entries.RemoveAt(e.RowIndex); - horn.Sound((uint)numericSignalLength.Value); + if(horn is not null) + horn.Sound((uint)numericSignalLength.Value); } grid.Refresh(); } @@ -113,7 +116,8 @@ namespace Tidstagning if (checkStartProcedure.Checked) { liste.Write("Automatisk Start Procedure er aktiv."); - startprocedure.setObjects(horn, liste); + if(horn is not null) + startprocedure.setObjects(horn, liste); } else { @@ -126,8 +130,11 @@ namespace Tidstagning { btnStop.Enabled = false; btnStart.Enabled = true; - liste.WriteFooter(); - liste.Close(); + if (liste is not null) + { + liste.WriteFooter(); + liste.Close(); + } checkStartProcedure.Enabled = true; flowLayoutPanelConfiguration.Enabled = true; } @@ -140,7 +147,8 @@ namespace Tidstagning private void btnTest_Click(object sender, EventArgs e) { - horn.Sound((uint)numericSignalLength.Value); + if(horn is not null) + horn.Sound((uint)numericSignalLength.Value); } private void Clock_Tick(object sender, EventArgs e) @@ -154,7 +162,7 @@ namespace Tidstagning private void comboComport_SelectedIndexChanged(object sender, EventArgs e) { - if (comboComport.Items.Count != 0) + if (comboComport is not null && comboComport.Items.Count != 0 && comboComport.SelectedItem is not null) { horn = new Relay(comboComport.SelectedItem.ToString()); Properties.Settings.Default.ComPort = comboComport.SelectedItem.ToString(); diff --git a/Tidstagning/Program.cs b/Tidstagning/Program.cs index 3431f90..2dd5882 100644 --- a/Tidstagning/Program.cs +++ b/Tidstagning/Program.cs @@ -5,9 +5,8 @@ using System.Windows.Forms; namespace Tidstagning { - static class Program + class Program { - public class Options { [Option('c', "config", Required = false, HelpText = "Enable configuration menu.")] @@ -20,7 +19,6 @@ namespace Tidstagning CommandLine.Parser.Default.ParseArguments(args) .WithParsed(RunOptions) .WithNotParsed(HandleParseError); - } static void RunOptions(Options opts) { diff --git a/Tidstagning/Tidstagning.csproj b/Tidstagning/Tidstagning.csproj index d2b19d9..55b9fb8 100644 --- a/Tidstagning/Tidstagning.csproj +++ b/Tidstagning/Tidstagning.csproj @@ -24,6 +24,10 @@ + + + + From 1782e15fd7d500752bb27a399c1e9f96aa08ee71 Mon Sep 17 00:00:00 2001 From: Jens Christian True Date: Mon, 2 May 2022 10:24:02 +0200 Subject: [PATCH 6/6] WinForms builds are not supported on linux hosts --- .drone.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index a13720b..0000000 --- a/.drone.yml +++ /dev/null @@ -1,7 +0,0 @@ -kind: pipeline -name: default -steps: -- name: build - image: mcr.microsoft.com/dotnet/sdk:6.0 - commands: - - dotnet publish -c Debug -o out -r win-x86 --self-contained true \ No newline at end of file