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 25e86f0..0000000 Binary files a/Tidstagning.suo and /dev/null differ 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.cs b/Tidstagning/AboutBox.cs index a004065..a1e3da3 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); } } @@ -40,7 +40,16 @@ namespace Tidstagning { get { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + Version? version = Assembly.GetExecutingAssembly().GetName().Version; + if (version is not null) + { + return version.ToString(); + + } + else + { + return "N/A"; + } } } 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..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(); @@ -46,19 +42,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/Deltager.txt b/Tidstagning/Deltager.txt deleted file mode 100644 index a9babac..0000000 --- a/Tidstagning/Deltager.txt +++ /dev/null @@ -1,16 +0,0 @@ -Opus,1 -Cartan,13 -Dixi,26 -Grace,28 -Sanus,19 -Blup,12 -Fønix,16 -Krone 2,99 -Den sorte enke,38 -Havfruen,18 -Nicoline,66 -Mamse,99 -Mallue,11 -Buggabo,9 -Marie,2 -Splinten,11 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 1e961b5..94fa9b2 100644 --- a/Tidstagning/MainUI.cs +++ b/Tidstagning/MainUI.cs @@ -11,15 +11,15 @@ namespace Tidstagning { }; - ResultList liste; - Relay horn; + ResultList? liste; + 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"); - string deltager; + string? deltager; while ((deltager = deltager_handle.ReadLine()) != null) { string[] dele = deltager.Split(','); @@ -45,6 +45,9 @@ namespace Tidstagning { comboComport.SelectedIndex = index; } + + buttonConfig.Visible = ShowConfig; + } @@ -74,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; @@ -83,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(); } @@ -110,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 { @@ -123,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; } @@ -137,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) @@ -151,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/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/Procedure.cs b/Tidstagning/Procedure.cs index 9429cbf..f6ead64 100644 --- a/Tidstagning/Procedure.cs +++ b/Tidstagning/Procedure.cs @@ -2,17 +2,16 @@ using System.Collections.Generic; using System.Diagnostics; using System.Threading; - namespace Tidstagning { class Procedure { - Relay horn; - ResultList log; + Relay? horn; + ResultList? log; List signaler; uint signalLength = 500; - Timer timer; + Timer? delayTimer; Int16 idx = 0; public Procedure() @@ -23,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); @@ -77,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) @@ -115,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/Program.cs b/Tidstagning/Program.cs index 813bdbc..2dd5882 100644 --- a/Tidstagning/Program.cs +++ b/Tidstagning/Program.cs @@ -1,19 +1,35 @@ -using System; +using CommandLine; +using System; +using System.Collections.Generic; using System.Windows.Forms; namespace Tidstagning { - static class Program + 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/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..a127454 100644 --- a/Tidstagning/Relay.cs +++ b/Tidstagning/Relay.cs @@ -3,12 +3,12 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO.Ports; using System.Threading; + namespace Tidstagning { class Relay { SerialPort com; - 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; @@ -88,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 4f0dc6a..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; + 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(); } } 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..55b9fb8 100644 --- a/Tidstagning/Tidstagning.csproj +++ b/Tidstagning/Tidstagning.csproj @@ -1,186 +1,54 @@ - - + + - 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 + disable + Tidstagning.Program + portable + False + none - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false + + + + True - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + + + + True - - 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 01ff6d1..0000000 Binary files a/Tidstagning/icon.ico and /dev/null differ