Compare commits

..

49 Commits

Author SHA1 Message Date
dac937873e Build enabled 2022-05-02 17:36:09 +02:00
Jens Christian True
369f1934d3 Start of gentle refactoring. 2022-05-02 16:41:16 +02:00
jct
44c3d9d4f5 Merge pull request 'Port to VS2022+.NET6' (#14) from VS2022 into master
Reviewed-on: #14
2022-05-02 08:35:32 +00:00
Jens Christian True
b99ec7a29c Merge branch 'master' of https://code.jcktrue.dk/jct/tidstagning into VS2022 2022-05-02 10:33:03 +02:00
Jens Christian True
1782e15fd7 WinForms builds are not supported on linux hosts 2022-05-02 10:24:02 +02:00
Jens Christian True
af0bd10ce7 WinForm Apps can not be built under linux 2022-05-02 10:20:08 +02:00
660b5a8e49 Clear out nullable warnings 2022-05-01 22:29:00 +02:00
300377e7ca Cleanup. Config parameter for configuration menu 2022-05-01 13:50:42 +02:00
dc3aedea12 Remove warnings regarding possible references to NULL
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2021-12-15 21:08:30 +01:00
86cfc546ac Clean up "Using" to remove implied includes.
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2021-12-15 17:01:02 +01:00
5c05466bc8 .NET6 and VS2022
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-19 17:36:09 +02:00
jct
bc9a13f69f Debug build and x86
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-19 08:58:19 +00:00
jct
b7b1cab39c Change to .NET6
Some checks failed
continuous-integration/drone/push Build is failing
2021-10-19 08:55:02 +00:00
7eeb0e102a Release 0.1.0
Some checks failed
continuous-integration/drone/push Build is failing
2021-07-17 15:06:25 +02:00
d0e29cda57 Disable configuration menu not yet working. Queue sound signals (Currently grace period is same as on period
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-05 19:54:27 +02:00
3a2e6d305d Numeric counter used for signal length. uint representation for signallength. Initial work on configuration window
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-04 21:52:24 +02:00
f1009662a5 Initial work creating configuration UI
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-04 00:04:53 +02:00
8d10da3cc6 Code formatting. Remove traces of static analysis in drone build
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-03 23:12:20 +02:00
15bedb0c31 Lenght of sound signal is now stored
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-03 23:01:07 +02:00
d8c8fca8dd Trying to remove manifest
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-03 22:19:16 +02:00
a021e8829b Various combinations of manifests
Some checks failed
continuous-integration/drone/push Build is failing
2021-07-03 22:11:25 +02:00
ee225e2c6b Remove manifest
Some checks failed
continuous-integration/drone/push Build is failing
2021-07-03 22:05:09 +02:00
fa523702d3 Manifest issues
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-21 20:15:01 +02:00
c1fa09aa0b Horn signal will now be extended on multiple requests...
Some checks failed
continuous-integration/drone Build is failing
continuous-integration/drone/push Build is failing
2021-06-21 19:53:42 +02:00
e05155376e Formatting time used in start procedure log output 2021-06-20 19:27:48 +02:00
4a8b7bf3b7 Focus on mouseover so spacebar may be used for pressing complete
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 19:42:33 +02:00
d099322b66 Better mouse over performance 2021-06-12 19:01:41 +02:00
c797cc5754 Now handles empty start list. Even more readable clock
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 17:48:08 +02:00
72a4b215ff Bigger time. Consolas font for time 2021-06-12 17:38:36 +02:00
ca4c088c3d Bigger ui elements
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 17:35:38 +02:00
47f22ce8b8 Persistent setting of comport and autostartprocedure
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 17:12:28 +02:00
a1436f1dae Large refactoring of Start procedure handling + horn signaling.
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 16:55:43 +02:00
8256d1bd67 Redraw gui
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 13:25:07 +02:00
dd53acc6f5 Removed up/down sorting feature
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 13:24:13 +02:00
3a50cf3c38 Resize clock. Move comport selector
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 13:16:16 +02:00
8befd8a567 Pre-select 500ms sound. Remove shorter options
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-12 13:03:41 +02:00
5f6014b20f Typo in stage name
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-30 16:24:38 +02:00
17fa883fc9 Static code analysis currently broken
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2021-05-30 16:23:33 +02:00
6b5ee02f26 Update to work without any comports on the system
Some checks failed
continuous-integration/drone/push Build is failing
2021-05-30 15:37:02 +02:00
ace6790c9c Sonarqube analysis
Some checks failed
continuous-integration/drone/push Build is failing
2020-09-19 14:23:53 +02:00
2a1dc58b91 Full path to dotnet tool
Some checks failed
continuous-integration/drone/push Build is failing
2020-09-15 22:48:44 +02:00
7fd393b1db Drone docker mono attempts
Some checks failed
continuous-integration/drone/push Build is failing
2020-09-15 22:46:47 +02:00
dcdbfedb12 Sonarqube scan on push
Some checks failed
continuous-integration/drone/push Build is failing
2020-09-14 21:16:28 +02:00
5cd1382558 Update contact information. Less requirements
All checks were successful
continuous-integration/drone/push Build is passing
2020-09-11 21:18:45 +02:00
d348cdd484 Removed Release to simplify build 2020-08-22 14:06:18 +02:00
23e5216042 Disabled signing of executable
All checks were successful
continuous-integration/drone/push Build is passing
2020-08-22 14:03:59 +02:00
734aa61456 Build script
Some checks failed
continuous-integration/drone/push Build is failing
2020-08-22 13:52:54 +02:00
36e6129bf7 More cleanup 2020-08-06 21:39:34 +02:00
49a0604aef Cleanup and .NET framework upgrade 2020-08-06 17:31:10 +02:00
32 changed files with 3879 additions and 1880 deletions

View File

@ -1,20 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tidstagning", "Tidstagning\Tidstagning.csproj", "{DFE0844B-9986-4623-8188-7F4A828FBB02}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31808.319
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tidstagning", "Tidstagning\Tidstagning.csproj", "{5AF4CA7E-39CF-4DB6-BED3-4FDB23BEDE86}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|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
{DFE0844B-9986-4623-8188-7F4A828FBB02}.Release|x86.ActiveCfg = Release|x86
{DFE0844B-9986-4623-8188-7F4A828FBB02}.Release|x86.Build.0 = Release|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 = {FF5491E4-A9E1-4EA9-86F1-3CF119710682}
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@ -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,23 +82,23 @@
// 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 - Lemvig Sejlklub";
this.labelProductName.Text = "Tidstagning";
this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// 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,23 +106,23 @@
// 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 © 2014";
this.labelCopyright.Text = "Copyright © 2021";
this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// 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,24 +130,25 @@
// 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 jct@leax.dk";
this.textBoxDescription.Text = "Kontakt jens.chr.true@gmail.com\r\nhttps://jcktrue.dk";
//
// okButton
//
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;

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
@ -36,7 +32,7 @@ namespace Tidstagning
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location);
}
}
@ -44,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";
}
}
}

File diff suppressed because it is too large Load Diff

295
Tidstagning/ConfigUI.Designer.cs generated Normal file
View File

@ -0,0 +1,295 @@

namespace Tidstagning
{
partial class ConfigUI
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigUI));
this.label1 = new System.Windows.Forms.Label();
this.checkBoxRelay = new System.Windows.Forms.CheckBox();
this.folderBrowserOutput = new System.Windows.Forms.FolderBrowserDialog();
this.buttonFolderOutput = new System.Windows.Forms.Button();
this.folderBrowserInput = new System.Windows.Forms.FolderBrowserDialog();
this.buttonFolderInput = new System.Windows.Forms.Button();
this.textPathInput = new System.Windows.Forms.TextBox();
this.textPathOutput = new System.Windows.Forms.TextBox();
this.buttonSave = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.comboBoxBaudRate = new System.Windows.Forms.ComboBox();
this.panelRelaySettings = new System.Windows.Forms.Panel();
this.panelRelaySettings.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
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(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(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(97, 19);
this.checkBoxRelay.TabIndex = 2;
this.checkBoxRelay.Text = "Enable Relay?";
this.checkBoxRelay.UseVisualStyleBackColor = true;
this.checkBoxRelay.CheckedChanged += new System.EventHandler(this.checkBoxRelay_CheckedChanged);
//
// folderBrowserOutput
//
this.folderBrowserOutput.Description = "Pick output folder";
//
// buttonFolderOutput
//
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(88, 27);
this.buttonFolderOutput.TabIndex = 3;
this.buttonFolderOutput.Text = "Pick output folder";
this.buttonFolderOutput.UseVisualStyleBackColor = true;
this.buttonFolderOutput.Click += new System.EventHandler(this.buttonFolderOutput_Click);
//
// folderBrowserInput
//
this.folderBrowserInput.Description = "Pick input folder";
//
// buttonFolderInput
//
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(88, 27);
this.buttonFolderInput.TabIndex = 4;
this.buttonFolderInput.Text = "Pick input folder";
this.buttonFolderInput.UseVisualStyleBackColor = true;
this.buttonFolderInput.Click += new System.EventHandler(this.buttonFolderInput_Click);
//
// textPathInput
//
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(350, 23);
this.textPathInput.TabIndex = 5;
//
// textPathOutput
//
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(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(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(88, 27);
this.buttonSave.TabIndex = 7;
this.buttonSave.Text = "Save";
this.buttonSave.UseVisualStyleBackColor = true;
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
//
// buttonCancel
//
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(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(88, 27);
this.buttonCancel.TabIndex = 8;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// label2
//
this.label2.AutoSize = true;
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(156, 15);
this.label2.TabIndex = 9;
this.label2.Text = "Select folder for output files.";
//
// textBox2
//
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(116, 23);
this.textBox2.TabIndex = 5;
//
// textBox1
//
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(116, 23);
this.textBox1.TabIndex = 4;
//
// label5
//
this.label5.AutoSize = true;
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(84, 15);
this.label5.TabIndex = 3;
this.label5.Text = "Off Command";
//
// label4
//
this.label4.AutoSize = true;
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(83, 15);
this.label4.TabIndex = 2;
this.label4.Text = "On Command";
//
// label3
//
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(54, 15);
this.label3.TabIndex = 1;
this.label3.Text = "Baudrate";
//
// comboBoxBaudRate
//
this.comboBoxBaudRate.FormattingEnabled = true;
this.comboBoxBaudRate.Items.AddRange(new object[] {
"110",
"150",
"300",
"1200",
"2400",
"4800",
"9600",
"19200",
"38400",
"57600",
"115200",
"230400",
"460800",
"921600"});
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(140, 23);
this.comboBoxBaudRate.TabIndex = 0;
//
// panelRelaySettings
//
this.panelRelaySettings.Controls.Add(this.textBox2);
this.panelRelaySettings.Controls.Add(this.label5);
this.panelRelaySettings.Controls.Add(this.textBox1);
this.panelRelaySettings.Controls.Add(this.comboBoxBaudRate);
this.panelRelaySettings.Controls.Add(this.label3);
this.panelRelaySettings.Controls.Add(this.label4);
this.panelRelaySettings.Enabled = false;
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(450, 60);
this.panelRelaySettings.TabIndex = 11;
//
// ConfigUI
//
this.AcceptButton = this.buttonSave;
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(472, 363);
this.Controls.Add(this.panelRelaySettings);
this.Controls.Add(this.label2);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonSave);
this.Controls.Add(this.textPathOutput);
this.Controls.Add(this.textPathInput);
this.Controls.Add(this.buttonFolderInput);
this.Controls.Add(this.buttonFolderOutput);
this.Controls.Add(this.checkBoxRelay);
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";
this.Text = "Configuration (Not working yet)";
this.TopMost = true;
this.panelRelaySettings.ResumeLayout(false);
this.panelRelaySettings.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBoxRelay;
private System.Windows.Forms.FolderBrowserDialog folderBrowserOutput;
private System.Windows.Forms.Button buttonFolderOutput;
private System.Windows.Forms.FolderBrowserDialog folderBrowserInput;
private System.Windows.Forms.Button buttonFolderInput;
private System.Windows.Forms.TextBox textPathInput;
private System.Windows.Forms.TextBox textPathOutput;
private System.Windows.Forms.Button buttonSave;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox comboBoxBaudRate;
private System.Windows.Forms.Panel panelRelaySettings;
}
}

48
Tidstagning/ConfigUI.cs Normal file
View File

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace Tidstagning
{
public partial class ConfigUI : Form
{
public ConfigUI()
{
InitializeComponent();
}
private void buttonFolderInput_Click(object sender, EventArgs e)
{
folderBrowserInput.ShowDialog();
textPathInput.Text = folderBrowserInput.SelectedPath;
}
private void buttonFolderOutput_Click(object sender, EventArgs e)
{
folderBrowserOutput.ShowDialog();
textPathOutput.Text = folderBrowserOutput.SelectedPath;
}
private void buttonCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void buttonSave_Click(object sender, EventArgs e)
{
Properties.Settings.Default.Save();
this.Close();
}
private void checkBoxRelay_CheckedChanged(object sender, EventArgs e)
{
panelRelaySettings.Enabled = checkBoxRelay.Checked;
}
}
}

1820
Tidstagning/ConfigUI.resx Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -1,18 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Tidstagning
{
class Entry
{
public enum Score
{
Score,
DNC,
DNS,
OCS,
DNF,
RET,
DSQ
};
//Competitors name
public string Name { get; set; }
//Competitor identifier (Sailnumber/Bownumber or other)
public string SailNumber { get; set; }
//DateTime the user completed the course
public DateTime Completed_Time { get; set; }
//Retirement score.
public Score Code { get; set; }
public Entry(string name, string number)
{
this.Name = name;
@ -27,6 +37,7 @@ namespace Tidstagning
public void DNF()
{
Code = Score.DNF;
this.Completed_Time = DateTime.Now;
}
}

View File

@ -1,389 +0,0 @@
namespace Tidstagning
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.countdowntimer = new System.Windows.Forms.Timer(this.components);
this.btnTest = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.comboComport = new System.Windows.Forms.ComboBox();
this.txtDebug = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.btnEditList = new System.Windows.Forms.Button();
this.btnMoveUp = new System.Windows.Forms.Button();
this.btnMoveDown = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.checkStartProcedure = new System.Windows.Forms.CheckBox();
this.lblClock = new System.Windows.Forms.Label();
this.btnAutoStart = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button();
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.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.comboSoundTime = new System.Windows.Forms.ComboBox();
this.Clock = new System.Windows.Forms.Timer(this.components);
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).BeginInit();
this.txtLog.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// countdowntimer
//
this.countdowntimer.Interval = 1000;
this.countdowntimer.Tick += new System.EventHandler(this.timer_Tick);
//
// btnTest
//
this.btnTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnTest.Location = new System.Drawing.Point(3, 3);
this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(185, 37);
this.btnTest.TabIndex = 3;
this.btnTest.Text = "Test";
this.btnTest.UseVisualStyleBackColor = true;
this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(907, 3);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 14;
this.button1.Text = "Hjælp mm.";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// comboComport
//
this.comboComport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboComport.FormattingEnabled = true;
this.comboComport.Location = new System.Drawing.Point(907, 311);
this.comboComport.Name = "comboComport";
this.comboComport.Size = new System.Drawing.Size(121, 21);
this.comboComport.TabIndex = 12;
//
// 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(203, 311);
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(698, 73);
this.txtDebug.TabIndex = 10;
//
// panel2
//
this.panel2.Controls.Add(this.btnEditList);
this.panel2.Controls.Add(this.btnMoveUp);
this.panel2.Controls.Add(this.btnMoveDown);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(3, 41);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(194, 264);
this.panel2.TabIndex = 9;
//
// btnEditList
//
this.btnEditList.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnEditList.Location = new System.Drawing.Point(0, 3);
this.btnEditList.Name = "btnEditList";
this.btnEditList.Size = new System.Drawing.Size(185, 37);
this.btnEditList.TabIndex = 3;
this.btnEditList.Text = "Rediger ";
this.btnEditList.UseVisualStyleBackColor = true;
this.btnEditList.Click += new System.EventHandler(this.btnEditList_Click);
//
// btnMoveUp
//
this.btnMoveUp.Enabled = false;
this.btnMoveUp.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnMoveUp.Location = new System.Drawing.Point(0, 46);
this.btnMoveUp.Name = "btnMoveUp";
this.btnMoveUp.Size = new System.Drawing.Size(185, 37);
this.btnMoveUp.TabIndex = 1;
this.btnMoveUp.Text = "Op";
this.btnMoveUp.UseVisualStyleBackColor = true;
this.btnMoveUp.Click += new System.EventHandler(this.btnMoveUp_Click);
//
// btnMoveDown
//
this.btnMoveDown.Enabled = false;
this.btnMoveDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnMoveDown.Location = new System.Drawing.Point(0, 89);
this.btnMoveDown.Name = "btnMoveDown";
this.btnMoveDown.Size = new System.Drawing.Size(185, 37);
this.btnMoveDown.TabIndex = 2;
this.btnMoveDown.Text = "Ned";
this.btnMoveDown.UseVisualStyleBackColor = true;
this.btnMoveDown.Click += new System.EventHandler(this.btnMoveDown_Click);
//
// panel1
//
this.panel1.Controls.Add(this.checkStartProcedure);
this.panel1.Controls.Add(this.lblClock);
this.panel1.Controls.Add(this.btnAutoStart);
this.panel1.Controls.Add(this.btnStop);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(907, 41);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(194, 264);
this.panel1.TabIndex = 8;
//
// checkStartProcedure
//
this.checkStartProcedure.AutoSize = true;
this.checkStartProcedure.Location = new System.Drawing.Point(7, 114);
this.checkStartProcedure.Name = "checkStartProcedure";
this.checkStartProcedure.Size = new System.Drawing.Size(100, 17);
this.checkStartProcedure.TabIndex = 8;
this.checkStartProcedure.Text = "Start Procedure";
this.checkStartProcedure.UseVisualStyleBackColor = true;
//
// lblClock
//
this.lblClock.AutoSize = true;
this.lblClock.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.lblClock.Location = new System.Drawing.Point(0, 222);
this.lblClock.Name = "lblClock";
this.lblClock.Size = new System.Drawing.Size(75, 29);
this.lblClock.TabIndex = 7;
this.lblClock.Text = "--:--:--";
//
// btnAutoStart
//
this.btnAutoStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnAutoStart.Location = new System.Drawing.Point(0, 7);
this.btnAutoStart.Name = "btnAutoStart";
this.btnAutoStart.Size = new System.Drawing.Size(185, 37);
this.btnAutoStart.TabIndex = 4;
this.btnAutoStart.Text = "Start";
this.btnAutoStart.UseVisualStyleBackColor = true;
this.btnAutoStart.Click += new System.EventHandler(this.btnAutoStart_Click);
//
// btnStop
//
this.btnStop.Enabled = false;
this.btnStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnStop.Location = new System.Drawing.Point(0, 50);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(182, 40);
this.btnStop.TabIndex = 6;
this.btnStop.Text = "Stop";
this.btnStop.UseVisualStyleBackColor = true;
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// 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.Name = "txtHeader";
this.txtHeader.Size = new System.Drawing.Size(194, 35);
this.txtHeader.TabIndex = 3;
//
// grid
//
this.grid.AllowUserToAddRows = false;
this.grid.AllowUserToDeleteRows = false;
this.grid.AutoGenerateColumns = false;
this.grid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Complete,
this.nameDataGridViewTextBoxColumn,
this.DNF});
this.grid.DataSource = this.entryBindingSource;
this.grid.Dock = System.Windows.Forms.DockStyle.Fill;
this.grid.Location = new System.Drawing.Point(203, 3);
this.grid.Name = "grid";
this.grid.ReadOnly = true;
this.grid.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F);
this.grid.RowsDefaultCellStyle = dataGridViewCellStyle1;
this.txtLog.SetRowSpan(this.grid, 2);
this.grid.RowTemplate.Height = 30;
this.grid.Size = new System.Drawing.Size(698, 302);
this.grid.TabIndex = 0;
this.grid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grid_Click);
this.grid.MouseMove += new System.Windows.Forms.MouseEventHandler(this.grid_MouseMove);
//
// Complete
//
this.Complete.DataPropertyName = "Name";
this.Complete.FillWeight = 400F;
this.Complete.HeaderText = "Fuldført";
this.Complete.Name = "Complete";
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";
this.DNF.Name = "DNF";
this.DNF.ReadOnly = true;
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, 200F));
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, 200F));
this.txtLog.Controls.Add(this.grid, 1, 0);
this.txtLog.Controls.Add(this.txtHeader, 0, 0);
this.txtLog.Controls.Add(this.panel1, 2, 1);
this.txtLog.Controls.Add(this.panel2, 0, 1);
this.txtLog.Controls.Add(this.txtDebug, 1, 2);
this.txtLog.Controls.Add(this.comboComport, 2, 2);
this.txtLog.Controls.Add(this.button1, 2, 0);
this.txtLog.Controls.Add(this.flowLayoutPanel1, 0, 2);
this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtLog.Location = new System.Drawing.Point(0, 0);
this.txtLog.Name = "txtLog";
this.txtLog.RowCount = 3;
this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 70F));
this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.txtLog.Size = new System.Drawing.Size(1104, 387);
this.txtLog.TabIndex = 8;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.btnTest);
this.flowLayoutPanel1.Controls.Add(this.comboSoundTime);
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 311);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(194, 73);
this.flowLayoutPanel1.TabIndex = 15;
//
// comboSoundTime
//
this.comboSoundTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboSoundTime.FormattingEnabled = true;
this.comboSoundTime.Items.AddRange(new object[] {
"250",
"500",
"750",
"1000",
"1250",
"1500",
"1750",
"2000",
"5000"});
this.comboSoundTime.Location = new System.Drawing.Point(3, 46);
this.comboSoundTime.Name = "comboSoundTime";
this.comboSoundTime.Size = new System.Drawing.Size(121, 21);
this.comboSoundTime.TabIndex = 26;
//
// Clock
//
this.Clock.Enabled = true;
this.Clock.Interval = 1000;
this.Clock.Tick += new System.EventHandler(this.Clock_Tick);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1104, 387);
this.Controls.Add(this.txtLog);
this.HelpButton = true;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Form1";
this.Text = "Tidstagning Copyright © 2014 LEAX A/S";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.Form1_HelpButtonClicked);
this.Load += new System.EventHandler(this.Form1_Load);
this.panel2.ResumeLayout(false);
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.flowLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.BindingSource entryBindingSource;
private System.Windows.Forms.Timer countdowntimer;
private System.Windows.Forms.Button btnTest;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ComboBox comboComport;
private System.Windows.Forms.TextBox txtDebug;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnMoveUp;
private System.Windows.Forms.Button btnMoveDown;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnAutoStart;
private System.Windows.Forms.Button btnStop;
private System.Windows.Forms.TextBox txtHeader;
private System.Windows.Forms.DataGridView grid;
private System.Windows.Forms.TableLayoutPanel txtLog;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.ComboBox comboSoundTime;
private System.Windows.Forms.Button btnEditList;
private System.Windows.Forms.DataGridViewButtonColumn Complete;
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewButtonColumn DNF;
private System.Windows.Forms.Label lblClock;
private System.Windows.Forms.CheckBox checkStartProcedure;
private System.Windows.Forms.Timer Clock;
}
}

View File

@ -1,250 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Tidstagning
{
public partial class Form1 : Form
{
delegate void SetTextCallback(string text);
BindingList<Entry> entries = new BindingList<Entry> {
};
ResultList liste;
Relay horn;
Procedure startprocedure;
System.IO.StreamReader deltager_handle;
System.IO.StreamReader procedure_handle;
int OldRow = 0;
public Form1()
{
InitializeComponent();
deltager_handle = new System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + "Deltager.txt");
string deltager;
while ((deltager = deltager_handle.ReadLine()) != null)
{
string[] dele = deltager.Split(',');
entries.Add(new Entry(dele[0],dele[1]));
}
startprocedure = new Procedure();
procedure_handle = new System.IO.StreamReader(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + "Startprocedure.txt");
string line;
while ((line = procedure_handle.ReadLine()) != null)
{
startprocedure.addEntry(line);
}
foreach(string port in Relay.GetPorts()) {
comboComport.Items.Add(port);
}
comboSoundTime.SelectedIndex = 3;
comboComport.SelectedIndex = 0;
}
private void Form1_Load(object sender, EventArgs e)
{
grid.DataSource = entries;
}
public void LogAppend(string text)
{
if (this.txtDebug.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(LogAppend);
this.Invoke(d, new object[] { text });
}
else
{
this.txtDebug.AppendText( text );
}
}
private void grid_Click(object sender, DataGridViewCellEventArgs e)
{
if (btnStop.Enabled != true)
return;
if (btnMoveUp.Enabled)
return;
if (e.RowIndex >= 0 && e.ColumnIndex == grid.Columns["DNF"].Index)
{
entries[e.RowIndex].DNF();
liste.WriteDNF(entries[e.RowIndex]);
int index = e.RowIndex;
grid.ClearSelection();
grid.CurrentCell = null;
entries.RemoveAt(e.RowIndex);
}
if (e.RowIndex >= 0 && e.ColumnIndex == grid.Columns["Complete"].Index) {
entries[e.RowIndex].Complete();
liste.WriteComplete(entries[e.RowIndex]);
int index = e.RowIndex;
grid.ClearSelection();
grid.CurrentCell = null;
entries.RemoveAt(e.RowIndex);
horn.Set(0x00, 0x01);
countdowntimer.Interval = int.Parse(comboSoundTime.SelectedItem.ToString());
countdowntimer.Start();
}
//grid.
grid.Refresh();
}
private void btnMoveUp_Click(object sender, EventArgs e)
{
if (grid.SelectedRows.Count == 1)
{
int idx = grid.SelectedRows[0].Index;
if (idx == 0)
return;
Entry entry = entries[idx];
entries.Remove(entry);
entries.Insert(idx - 1, entry);
grid.ClearSelection();
grid.Rows[idx - 1].Selected = true;
}
}
private void btnMoveDown_Click(object sender, EventArgs e)
{
if (grid.SelectedRows.Count == 1)
{
int idx = grid.SelectedRows[0].Index;
if (idx == grid.Rows.Count - 1 )
return;
Entry entry = entries[idx];
entries.Remove(entry);
entries.Insert(idx + 1, entry);
grid.ClearSelection();
grid.Rows[idx + 1].Selected = true;
}
}
private void btnAutoStart_Click(object sender, EventArgs e)
{
if (txtHeader.Text == "")
{
MessageBox.Show("Udfyld løbs titel");
return;
}
liste = new ResultList("Resultat", this);
liste.WriteHeader(txtHeader.Text);
btnAutoStart.Enabled = false;
btnStop.Enabled = true;
horn = new Relay(comboComport.SelectedItem.ToString());
if (checkStartProcedure.Checked)
{
startprocedure.setObjects(horn, liste);
}
}
private void btnStop_Click(object sender, EventArgs e)
{
//btnAutoStart.Enabled = true;
btnStop.Enabled = false;
horn.Close();
liste.Write("Nedtælling stoppet");
countdowntimer.Stop();
}
private void timer_Tick(object sender, EventArgs e)
{
countdowntimer.Stop();
horn.Set(0x00, 0x00);
}
private void grid_MouseMove(object sender, MouseEventArgs e)
{
DataGridView.HitTestInfo hti = grid.HitTest(e.X, e.Y);
if (hti.RowIndex >= 0 && hti.RowIndex != OldRow)
{
if (grid.Rows.Count > OldRow)
{
grid.Rows[OldRow].Selected = false;
grid.Rows[OldRow].Height = 30;
}
grid.Rows[hti.RowIndex].Selected = true;
grid.Rows[hti.RowIndex].Height = 60;
OldRow = hti.RowIndex;
}
}
private void Form1_HelpButtonClicked(object sender, CancelEventArgs e)
{
AboutBox aboutbox = new AboutBox();
aboutbox.Show();
}
private void button1_Click(object sender, EventArgs e)
{
AboutBox aboutbox = new AboutBox();
aboutbox.Show();
}
private void btnTest_Click(object sender, EventArgs e)
{
if (btnStop.Enabled != true)
return;
horn.Set(0x00, 0x01);
countdowntimer.Interval = int.Parse(comboSoundTime.SelectedItem.ToString());
countdowntimer.Start();
}
private void btnEditList_Click(object sender, EventArgs e)
{
if (btnMoveUp.Enabled)
{
btnEditList.Text = "Rediger";
btnMoveUp.Enabled = false;
btnMoveDown.Enabled = false;
}
else
{
btnEditList.Text = "Aktiv";
btnMoveUp.Enabled = true;
btnMoveDown.Enabled = true;
}
}
private void Clock_Tick(object sender, EventArgs e)
{
lblClock.Text = DateTime.Now.ToString("HH:mm:ss");
}
}
}

427
Tidstagning/MainUI.Designer.cs generated Normal file
View File

@ -0,0 +1,427 @@
namespace Tidstagning
{
partial class MainUI
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainUI));
this.btnTest = new System.Windows.Forms.Button();
this.buttonHelp = new System.Windows.Forms.Button();
this.txtDebug = new System.Windows.Forms.TextBox();
this.panel1 = new System.Windows.Forms.Panel();
this.textStartProcedure = new System.Windows.Forms.TextBox();
this.checkStartProcedure = new System.Windows.Forms.CheckBox();
this.btnStart = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button();
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();
this.numericSignalLength = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.comboComport = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.buttonConfig = new System.Windows.Forms.Button();
this.Clock = new System.Windows.Forms.Timer(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();
this.SuspendLayout();
//
// btnTest
//
this.btnTest.Dock = System.Windows.Forms.DockStyle.Bottom;
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(307, 43);
this.btnTest.TabIndex = 3;
this.btnTest.Text = "HORN 🔊";
this.btnTest.UseVisualStyleBackColor = true;
this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
//
// buttonHelp
//
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(88, 27);
this.buttonHelp.TabIndex = 14;
this.buttonHelp.Text = "Hjælp mm.";
this.buttonHelp.UseVisualStyleBackColor = true;
this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click);
//
// txtDebug
//
this.txtDebug.Dock = System.Windows.Forms.DockStyle.Fill;
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(569, 163);
this.txtDebug.TabIndex = 10;
//
// panel1
//
this.panel1.Controls.Add(this.btnTest);
this.panel1.Controls.Add(this.textStartProcedure);
this.panel1.Controls.Add(this.checkStartProcedure);
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(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(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);
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(300, 377);
this.textStartProcedure.TabIndex = 10;
this.textStartProcedure.WordWrap = false;
//
// checkStartProcedure
//
this.checkStartProcedure.AutoSize = true;
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(171, 19);
this.checkStartProcedure.TabIndex = 8;
this.checkStartProcedure.Text = "Automatisk Start Procedure";
this.checkStartProcedure.UseVisualStyleBackColor = true;
this.checkStartProcedure.CheckedChanged += new System.EventHandler(this.checkStartProcedure_CheckedChanged);
//
// btnStart
//
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(301, 43);
this.btnStart.TabIndex = 4;
this.btnStart.Text = "Start ▶";
this.btnStart.UseVisualStyleBackColor = true;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// btnStop
//
this.btnStop.Enabled = false;
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(301, 46);
this.btnStop.TabIndex = 6;
this.btnStop.Text = "Stop ■";
this.btnStop.UseVisualStyleBackColor = true;
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// txtHeader
//
this.txtHeader.Dock = System.Windows.Forms.DockStyle.Fill;
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(307, 35);
this.txtHeader.TabIndex = 3;
//
// grid
//
this.grid.AllowUserToAddRows = false;
this.grid.AllowUserToDeleteRows = false;
this.grid.AllowUserToResizeColumns = false;
this.grid.AllowUserToResizeRows = false;
this.grid.AutoGenerateColumns = false;
this.grid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.grid.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable;
this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Complete,
this.nameDataGridViewTextBoxColumn,
this.DNF});
this.txtLog.SetColumnSpan(this.grid, 2);
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(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);
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(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);
this.grid.CellMouseLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.grid_CellMouseLeave);
//
// Complete
//
this.Complete.DataPropertyName = "Name";
this.Complete.FillWeight = 400F;
this.Complete.HeaderText = "Fuldført";
this.Complete.Name = "Complete";
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";
this.DNF.Name = "DNF";
this.DNF.ReadOnly = true;
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, 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, 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);
this.txtLog.Controls.Add(this.lblClock, 2, 2);
this.txtLog.Controls.Add(this.panel1, 0, 1);
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, 23F));
this.txtLog.Size = new System.Drawing.Size(1534, 801);
this.txtLog.TabIndex = 8;
//
// lblClock
//
this.lblClock.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| 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);
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(634, 169);
this.lblClock.TabIndex = 16;
this.lblClock.Text = "--:--:--";
this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// flowLayoutPanelConfiguration
//
this.flowLayoutPanelConfiguration.Controls.Add(this.numericSignalLength);
this.flowLayoutPanelConfiguration.Controls.Add(this.label1);
this.flowLayoutPanelConfiguration.Controls.Add(this.comboComport);
this.flowLayoutPanelConfiguration.Controls.Add(this.label2);
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(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(307, 163);
this.flowLayoutPanelConfiguration.TabIndex = 15;
//
// numericSignalLength
//
this.numericSignalLength.Increment = new decimal(new int[] {
10,
0,
0,
0});
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,
0,
0});
this.numericSignalLength.Minimum = new decimal(new int[] {
10,
0,
0,
0});
this.numericSignalLength.Name = "numericSignalLength";
this.numericSignalLength.Size = new System.Drawing.Size(141, 23);
this.numericSignalLength.TabIndex = 30;
this.numericSignalLength.Value = new decimal(new int[] {
500,
0,
0,
0});
this.numericSignalLength.ValueChanged += new System.EventHandler(this.numericSignalLength_ValueChanged);
//
// 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);
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;
this.label1.Text = "Millisekunder";
//
// comboComport
//
this.comboComport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboComport.FormattingEnabled = true;
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(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);
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;
this.label2.Text = "Com Port";
//
// buttonConfig
//
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(105, 27);
this.buttonConfig.TabIndex = 29;
this.buttonConfig.Text = "Konfiguration";
this.buttonConfig.UseVisualStyleBackColor = true;
this.buttonConfig.Click += new System.EventHandler(this.buttonConfig_Click);
//
// Clock
//
this.Clock.Enabled = true;
this.Clock.Tick += new System.EventHandler(this.Clock_Tick);
//
// MainUI
//
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(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;
this.Load += new System.EventHandler(this.Form1_Load);
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();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.BindingSource entryBindingSource;
private System.Windows.Forms.Button btnTest;
private System.Windows.Forms.Button buttonHelp;
private System.Windows.Forms.TextBox txtDebug;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.Button btnStop;
private System.Windows.Forms.TextBox txtHeader;
private System.Windows.Forms.DataGridView grid;
private System.Windows.Forms.TableLayoutPanel txtLog;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelConfiguration;
private System.Windows.Forms.DataGridViewButtonColumn Complete;
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewButtonColumn DNF;
private System.Windows.Forms.CheckBox checkStartProcedure;
private System.Windows.Forms.Timer Clock;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboComport;
private System.Windows.Forms.Label lblClock;
private System.Windows.Forms.TextBox textStartProcedure;
private System.Windows.Forms.Button buttonConfig;
private System.Windows.Forms.NumericUpDown numericSignalLength;
private System.Windows.Forms.Label label2;
}
}

230
Tidstagning/MainUI.cs Normal file
View File

@ -0,0 +1,230 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace Tidstagning
{
public partial class MainUI : Form
{
delegate void SetTextCallback(string text);
BindingList<Entry> entries = new BindingList<Entry>
{
};
ResultList? liste;
Relay horn = new Relay();
Procedure startprocedure = new Procedure();
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;
while ((deltager = deltager_handle.ReadLine()) != null)
{
string[] dele = deltager.Split(',');
entries.Add(new Entry(dele[0], dele[1]));
}
deltager_handle.Dispose();
foreach (string port in Relay.GetPorts())
{
comboComport.Items.Add(port);
}
checkStartProcedure.Checked = Properties.Settings.Default.AutoStartProcedure;
numericSignalLength.Value = (decimal)Properties.Settings.Default.SignalLength;
string comport = Properties.Settings.Default.ComPort;
int index = comboComport.Items.IndexOf(comport);
if (index == -1)
{
comboComport.SelectedIndex = 0;
}
else
{
comboComport.SelectedIndex = index;
}
buttonConfig.Visible = ShowConfig;
}
private void Form1_Load(object sender, EventArgs e)
{
grid.DataSource = entries;
}
public void LogAppend(string text)
{
if (this.txtDebug.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(LogAppend);
this.Invoke(d, new object[] { text });
}
else
{
this.txtDebug.AppendText(text);
}
}
private void grid_Click(object sender, DataGridViewCellEventArgs e)
{
if (!btnStop.Enabled)
return;
if (e.RowIndex >= 0 && e.ColumnIndex == grid.Columns["DNF"].Index)
{
entries[e.RowIndex].DNF();
if(liste is not null)
liste.WriteDNF(entries[e.RowIndex]);
grid.ClearSelection();
grid.CurrentCell = null;
entries.RemoveAt(e.RowIndex);
}
if (e.RowIndex >= 0 && e.ColumnIndex == grid.Columns["Complete"].Index)
{
entries[e.RowIndex].Complete();
if(liste is not null)
liste.WriteComplete(entries[e.RowIndex]);
grid.ClearSelection();
grid.CurrentCell = null;
entries.RemoveAt(e.RowIndex);
horn.Sound((uint)numericSignalLength.Value);
}
grid.Refresh();
}
private void btnStart_Click(object sender, EventArgs e)
{
if (txtHeader.Text == "")
{
MessageBox.Show("Udfyld løbs titel");
return;
}
liste = new ResultList(txtHeader.Text, this);
liste.WriteHeader(txtHeader.Text);
btnStart.Enabled = false;
btnStop.Enabled = true;
checkStartProcedure.Enabled = false;
flowLayoutPanelConfiguration.Enabled = false;
if (checkStartProcedure.Checked)
{
liste.Write("Automatisk Start Procedure er aktiv.");
startprocedure.setObjects(horn, liste);
}
else
{
liste.Write("Manuel start procedure");
}
}
private void btnStop_Click(object sender, EventArgs e)
{
btnStop.Enabled = false;
btnStart.Enabled = true;
if (liste is not null)
{
liste.WriteFooter();
liste.Close();
}
checkStartProcedure.Enabled = true;
flowLayoutPanelConfiguration.Enabled = true;
}
private void buttonHelp_Click(object sender, EventArgs e)
{
AboutBox aboutbox = new AboutBox();
aboutbox.Show();
}
private void btnTest_Click(object sender, EventArgs e)
{
horn.Sound((uint)Properties.Settings.Default.SignalLength);
}
private void Clock_Tick(object sender, EventArgs e)
{
lblClock.Text = DateTime.Now.ToString("HH:mm:ss");
if (checkStartProcedure.Checked)
{
textStartProcedure.Text = startprocedure.TextualRepresentation();
}
}
private void comboComport_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboComport is not null && comboComport.Items.Count != 0 && comboComport.SelectedItem is not null)
{
horn.Open(comboComport.SelectedItem.ToString());
Properties.Settings.Default.ComPort = comboComport.SelectedItem.ToString();
Properties.Settings.Default.Save();
}
}
private void checkStartProcedure_CheckedChanged(object sender, EventArgs e)
{
startprocedure.Clear();
textStartProcedure.Visible = checkStartProcedure.Checked;
if (checkStartProcedure.Checked)
{
startprocedure.ReadFile(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + "Startprocedure.txt");
}
Properties.Settings.Default.AutoStartProcedure = checkStartProcedure.Checked;
Properties.Settings.Default.Save();
}
private void grid_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex > -1)
{
try
{
grid.Rows[e.RowIndex].Selected = true;
grid.Rows[e.RowIndex].Height = 60;
grid.CurrentCell = grid.Rows[e.RowIndex].Cells[e.ColumnIndex];
if (btnStop.Enabled)
{
grid.Focus();
}
}
catch { }
}
}
private void grid_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex > -1)
{
try
{
grid.Rows[e.RowIndex].Selected = false;
grid.Rows[e.RowIndex].Height = 30;
}
catch
{ }
}
}
private void buttonConfig_Click(object sender, EventArgs e)
{
ConfigUI configui = new ConfigUI();
configui.ShowDialog();
}
private void numericSignalLength_ValueChanged(object sender, EventArgs e)
{
startprocedure.adjustSignalLength((uint)numericSignalLength.Value);
Properties.Settings.Default.SignalLength = (uint)numericSignalLength.Value;
Properties.Settings.Default.Save();
}
}
}

View File

@ -1,64 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@ -112,30 +52,24 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="countdowntimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>165, 17</value>
</metadata>
<metadata name="comboComport.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="Complete.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Complete.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="DNF.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="DNF.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="entryBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="entryBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="Clock.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>297, 17</value>
<metadata name="Clock.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>166, 16</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAYAAAAAAAEAIABLFAAAZgAAACAgAAABACAAqBAAALEUAAAwMAAAAQAgAKglAABZJQAAEBAAAAEA

View File

@ -1,41 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;
namespace Tidstagning
{
class Procedure
{
struct Signal
{
public TimeSpan tid;
public Int32 Duration;
Relay? horn;
ResultList? log;
List<DateTime> signaler;
uint signalLength = 500;
public Signal(string parse)
{
string[] parts = parse.Split(',');
this.tid = TimeSpan.Parse(parts[0]);
this.Duration = Int32.Parse(parts[1]);
}
}
Relay horn;
ResultList log;
List<Signal> signaler;
Timer cooldownTimer;
Timer timer;
Timer? delayTimer;
Int16 idx = 0;
public Procedure()
{
signaler = new List<Signal>();
signaler = new List<DateTime>();
}
public void addEntry(string input) {
signaler.Add(new Signal(input));
public void ReadFile(string file)
{
System.IO.StreamReader procedure_handle = new System.IO.StreamReader(file);
string? line;
while ((line = procedure_handle.ReadLine()) != null)
{
addEntry(line);
}
procedure_handle.Dispose();
}
public void addEntry(string input)
{
string input_filtered = input.Trim();
if (input_filtered.Length > 0)
{
try
{
signaler.Add(DateTime.Parse(input_filtered));
}
catch
{
Debug.WriteLine("Failed to parse: " + input);
}
signaler.Sort();
}
}
public string TextualRepresentation()
{
string t = "";
if (signaler.Count > 0)
{
foreach (DateTime signal in signaler)
{
if (DateTime.Now > (signal.AddMilliseconds(signalLength)))
{
t += "✔";
}
else if (DateTime.Now > signal)
{
t += "o ";
}
else
{
t += " ";
}
t += signal.ToString() + "\r\n";
}
}
return t;
}
public void Clear()
{
signaler = new List<DateTime>();
idx = 0;
if (delayTimer != null)
delayTimer.Dispose();
}
public void setObjects(Relay horn_obj, ResultList log_obj)
@ -45,54 +87,61 @@ namespace Tidstagning
Run();
}
public void adjustSignalLength(uint lengthMS)
{
signalLength = lengthMS;
}
public void Run()
{
SetUpTimer(signaler[idx].tid);
if (signaler.Count > 0)
{
SetUpTimer(signaler[idx]);
}
}
private void SetUpTimer(TimeSpan alertTime)
private void SetUpTimer(DateTime alertTime)
{
DateTime current = DateTime.Now;
TimeSpan timeToGo = alertTime - current.TimeOfDay;
TimeSpan timeToGo = alertTime.TimeOfDay - current.TimeOfDay;
log.Write("Næste signal: " + alertTime.ToString() + " Om: " + timeToGo.ToString());
if (timeToGo < TimeSpan.Zero)
{
next();
if (!next())
{
return;
}
Run();
return;//time already passed
}
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.Set(0x00, 0x01);
cooldownTimer = new System.Threading.Timer(x =>
{
this.Cooldown();
}, null, new TimeSpan(0,0,signaler[idx].Duration/1000), new System.TimeSpan(0));
}
private void Cooldown()
{
horn.Set(0x00, 0x00);
if(log is not null)
log.Write("HORN!");
if(horn is not null)
horn.Sound(signalLength);
next();
this.Run();
Run();
}
private void next()
private bool next()
{
if (idx >= (signaler.Count - 1))
return;
return false;
idx++;
return true;
}
}
}

View File

@ -1,21 +1,35 @@
using System;
using CommandLine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Tidstagning
{
static class Program
class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
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<Options>(args)
.WithParsed(RunOptions)
.WithNotParsed(HandleParseError);
}
static void RunOptions(Options opts)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new MainUI(opts.Config));
}
static void HandleParseError(IEnumerable<Error> errs)
{
MessageBox.Show("Failed to start\n" + errs.ToString());
}
}
}

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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("Contact jct@leax.dk")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("LEAX")]
[assembly: AssemblyProduct("Tidstagning")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[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.2.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Entry" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>Tidstagning.Entry, Tidstagning, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1022
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Tidstagning.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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", "4.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() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.1022
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -12,7 +12,7 @@ namespace Tidstagning.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.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())));
@ -22,5 +22,41 @@ namespace Tidstagning.Properties {
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;
}
}
}
}

View File

@ -1,7 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Tidstagning.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ComPort" Type="System.String" Scope="User">
<Value Profile="(Default)">N/A</Value>
</Setting>
<Setting Name="AutoStartProcedure" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="SignalLength" Type="System.UInt32" Scope="User">
<Value Profile="(Default)">500</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel node will disable file and registry virtualization.
If you want to utilize File and Registry Virtualization for backward
compatibility then delete the requestedExecutionLevel node.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with. Windows will automatically select the most compatible environment.-->
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
</application>
</compatibility>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!-- <dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>-->
</asmv1:assembly>

View File

@ -1,33 +1,148 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO.Ports;
using System.Threading;
namespace Tidstagning
{
class Relay
{
SerialPort com;
public Relay(string ComPort)
SerialPort com = new SerialPort();
struct SignalSpec
{
public uint duration;
public bool output_on;
};
Queue<SignalSpec> signals = new Queue<SignalSpec>();
bool processing_queue = false;
public Relay()
{
com = new SerialPort();
com.PortName = ComPort;
com.BaudRate = 9600;
com.Open();
}
public void Set(int output, byte state) {
byte[] command = {0xff, 0x01, state};
com.Write(command, 0, 3);
public bool Open(string ComPort)
{
if (com.IsOpen)
{
Close();
}
com.PortName = ComPort;
com.BaudRate = 9600;
try
{
com.Open();
return true;
}
catch
{
return false;
}
}
public void Close() {
if(com.IsOpen)
private void On()
{
Debug.WriteLine("Output on");
Set(0x00, 0x01);
}
private void Off()
{
Debug.WriteLine("Output off");
Set(0x00, 0x00);
}
/**
* Sound the horn for a given time
* Uses a thread to postpone the off call.
*/
public void Sound(uint time)
{
if(!com.IsOpen)
{
Debug.WriteLine("ComPort not open");
return;
}
Debug.WriteLine("Requesting horn for: " + time.ToString() + "ms");
SignalSpec on_signal;
on_signal.duration = time;
on_signal.output_on = true;
signals.Enqueue(on_signal);
SignalSpec gracePeriod;
gracePeriod.duration = time;
gracePeriod.output_on = false;
signals.Enqueue(gracePeriod);
if (processing_queue == false)
{
Run();
}
}
private void Run()
{
if (signals.Count == 0)
{
processing_queue = false;
}
else
{
processing_queue = true;
SignalSpec signal = signals.Peek();
if(signal.output_on)
{
On();
}
else
{
Off();
}
System.Threading.Timer cooldownTimer = new System.Threading.Timer(x =>
{
signals.Dequeue();
Run();
}, null, signal.duration, Timeout.Infinite);
}
}
private void Set(int output, byte state)
{
byte[] command = { 0xff, 0x01, state };
if (com.IsOpen)
{
Debug.WriteLine("COM: " + com.PortName + " Write: 0x" + Convert.ToString(command[2], 16));
com.Write(command, 0, 3);
}
}
public void Close()
{
if (com.IsOpen)
{
Off(); //Make sure the horn is off before closing the com port...
com.Close();
}
}
public static string[] GetPorts()
{
return SerialPort.GetPortNames();
string[] ports;
if (SerialPort.GetPortNames().Length != 0)
{
ports = SerialPort.GetPortNames();
}
else
{
ports = new string[] { "N/A" };
}
return ports;
}
}
}

View File

@ -1,60 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Tidstagning
{
class ResultList
{
System.IO.StreamWriter filehandle;
System.IO.StreamWriter filehandle2;
Tidstagning.Form1 parentForm;
string racenumber;
public ResultList(string filename, Tidstagning.Form1 log_object)
System.IO.StreamWriter filehandle_log;
System.IO.StreamWriter filehandle_results;
Tidstagning.MainUI parentForm;
string racenumber = "";
public ResultList(string filename, Tidstagning.MainUI log_object)
{
filehandle = new System.IO.StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + filename +"_" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm") + ".txt");
filehandle2 = new System.IO.StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + filename + "_" + DateTime.Now.ToString("dd-MM-yyyy-HH-mm") + ".csv");
filename = MakeSafeFilename(filename, '_');
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;
}
public void WriteHeader(string header) {
private string MakeSafeFilename(string filename, char replaceChar)
{
foreach (char c in System.IO.Path.GetInvalidFileNameChars())
{
filename = filename.Replace(c, replaceChar);
}
return filename;
}
public void WriteHeader(string header)
{
this.racenumber = header;
Write("----------------------------");
Write(header);
Write("Løb startet den: " + DateTime.Now.ToString());
Write("----------------------------");
WriteCSV("RaceNo,SailNo,Finish,Code,");
}
public void WriteComplete(Entry Boat) {
public void WriteFooter()
{
Write("----------------------------");
Write("Løb afsluttet den: " + DateTime.Now.ToString());
Write("----------------------------");
}
public void WriteComplete(Entry Boat)
{
Write("Fuldført! - " + Boat.Name + " - " + Boat.Completed_Time.ToString());
WriteCSV(this.racenumber + "," +Boat.SailNumber + "," + Boat.Completed_Time.ToString("HH:mm:ss") + ", ,");
}
public void WriteDNF(Entry Boat) {
Write("Udgået! - " + Boat.Name + " - " + Boat.Completed_Time.ToString());
WriteCSV(this.racenumber + "," +Boat.SailNumber + "," + "00:00:00,DNC,");
WriteCSV(this.racenumber + "," + Boat.SailNumber + "," + Boat.Completed_Time.ToString("HH:mm:ss") + ", ,");
}
public void Write(string textstring) {
filehandle.WriteLine(textstring);
public void WriteDNF(Entry Boat)
{
Write("Udgået! - " + Boat.Name + " - " + Boat.Completed_Time.ToString());
WriteCSV(this.racenumber + "," + Boat.SailNumber + "," + "00:00:00,DNC,");
}
public void Write(string 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();
}
}

62
Tidstagning/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

33
Tidstagning/Settings.cs Normal file
View File

@ -0,0 +1,33 @@
namespace Tidstagning.Properties
{
// This class allows you to handle specific events on the settings class:
// The SettingChanging event is raised before a setting's value is changed.
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings
{
public Settings()
{
// // To add event handlers for saving and changing settings, uncomment the lines below:
//
// this.SettingChanging += this.SettingChangingEventHandler;
//
// this.SettingsSaving += this.SettingsSavingEventHandler;
//
}
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
{
// Add code to handle the SettingChangingEvent event here.
}
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)
{
// Add code to handle the SettingsSaving event here.
}
}
}

View File

@ -1,171 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DFE0844B-9986-4623-8188-7F4A828FBB02}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tidstagning</RootNamespace>
<AssemblyName>Tidstagning</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>G:\Tidstagning\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>false</MapFileExtensions>
<ProductName>Tidstagning</ProductName>
<PublisherName>LEAX</PublisherName>
<SuiteName>Lemvig Sejlklub</SuiteName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>23</ApplicationRevision>
<ApplicationVersion>1.1.2.%2a</ApplicationVersion>
<UseApplicationTrust>true</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>false</BootstrapperEnabled>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>True</UseWindowsForms>
<ImplicitUsings>disable</ImplicitUsings>
<StartupObject>Tidstagning.Program</StartupObject>
<DebugType>portable</DebugType>
<SignAssembly>False</SignAssembly>
<ErrorReport>none</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn />
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>86AFBD08924E61031114EAB5B6DF6585A43E2B5F</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>Tidstagning_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<TargetZone>Custom</TargetZone>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn />
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<PackageReference Include="CommandLineParser" Version="2.9.0-preview1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0-preview.3.22175.4" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0-preview.3.22175.4" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0-preview.3.22175.4" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0-preview.3.22175.4" />
<PackageReference Include="System.IO.Ports" Version="7.0.0-preview.3.22175.4" />
</ItemGroup>
<ItemGroup>
<Compile Include="AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="Entry.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Procedure.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Relay.cs" />
<Compile Include="ResultList.cs" />
<EmbeddedResource Include="AboutBox.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<None Include="app.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\DataSources\Entry.datasource" />
<None Include="Properties\Settings.settings">
<Compile Update="Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
<Content Include="Deltager.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>G:\Tidstagning\|G:\|publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Compile Update="AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="ConfigUI.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="MainUI.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>

View File

@ -1,3 +0,0 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727" sku="Client"/></startup></configuration>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB