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

This commit is contained in:
Jens True 2021-07-04 21:52:24 +02:00
parent f1009662a5
commit 3a2e6d305d
7 changed files with 232 additions and 124 deletions

@ -31,7 +31,7 @@ namespace Tidstagning
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigUI)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigUI));
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.checkBox1 = new System.Windows.Forms.CheckBox(); this.checkBoxRelay = new System.Windows.Forms.CheckBox();
this.folderBrowserOutput = new System.Windows.Forms.FolderBrowserDialog(); this.folderBrowserOutput = new System.Windows.Forms.FolderBrowserDialog();
this.buttonFolderOutput = new System.Windows.Forms.Button(); this.buttonFolderOutput = new System.Windows.Forms.Button();
this.folderBrowserInput = new System.Windows.Forms.FolderBrowserDialog(); this.folderBrowserInput = new System.Windows.Forms.FolderBrowserDialog();
@ -41,6 +41,14 @@ namespace Tidstagning
this.buttonSave = new System.Windows.Forms.Button(); this.buttonSave = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label(); 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(); this.SuspendLayout();
// //
// label1 // label1
@ -52,15 +60,16 @@ namespace Tidstagning
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "Select folder for input files."; this.label1.Text = "Select folder for input files.";
// //
// checkBox1 // checkBoxRelay
// //
this.checkBox1.AutoSize = true; this.checkBoxRelay.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(7, 98); this.checkBoxRelay.Location = new System.Drawing.Point(7, 98);
this.checkBox1.Name = "checkBox1"; this.checkBoxRelay.Name = "checkBoxRelay";
this.checkBox1.Size = new System.Drawing.Size(95, 17); this.checkBoxRelay.Size = new System.Drawing.Size(95, 17);
this.checkBox1.TabIndex = 2; this.checkBoxRelay.TabIndex = 2;
this.checkBox1.Text = "Enable Relay?"; this.checkBoxRelay.Text = "Enable Relay?";
this.checkBox1.UseVisualStyleBackColor = true; this.checkBoxRelay.UseVisualStyleBackColor = true;
this.checkBoxRelay.CheckedChanged += new System.EventHandler(this.checkBoxRelay_CheckedChanged);
// //
// folderBrowserOutput // folderBrowserOutput
// //
@ -136,6 +145,84 @@ namespace Tidstagning
this.label2.TabIndex = 9; this.label2.TabIndex = 9;
this.label2.Text = "Select folder for output files."; this.label2.Text = "Select folder for output files.";
// //
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(259, 17);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 5;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(141, 17);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 4;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(256, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(71, 13);
this.label5.TabIndex = 3;
this.label5.Text = "Off Command";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(138, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(71, 13);
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.Name = "label3";
this.label3.Size = new System.Drawing.Size(50, 13);
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, 16);
this.comboBoxBaudRate.Name = "comboBoxBaudRate";
this.comboBoxBaudRate.Size = new System.Drawing.Size(121, 21);
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(7, 121);
this.panelRelaySettings.Name = "panelRelaySettings";
this.panelRelaySettings.Size = new System.Drawing.Size(386, 68);
this.panelRelaySettings.TabIndex = 11;
//
// ConfigUI // ConfigUI
// //
this.AcceptButton = this.buttonSave; this.AcceptButton = this.buttonSave;
@ -143,6 +230,7 @@ namespace Tidstagning
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel; this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(405, 315); this.ClientSize = new System.Drawing.Size(405, 315);
this.Controls.Add(this.panelRelaySettings);
this.Controls.Add(this.label2); this.Controls.Add(this.label2);
this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonSave); this.Controls.Add(this.buttonSave);
@ -150,15 +238,17 @@ namespace Tidstagning
this.Controls.Add(this.textPathInput); this.Controls.Add(this.textPathInput);
this.Controls.Add(this.buttonFolderInput); this.Controls.Add(this.buttonFolderInput);
this.Controls.Add(this.buttonFolderOutput); this.Controls.Add(this.buttonFolderOutput);
this.Controls.Add(this.checkBox1); this.Controls.Add(this.checkBoxRelay);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "ConfigUI"; this.Name = "ConfigUI";
this.Text = "Configuration"; this.Text = "Configuration (Not working yet)";
this.TopMost = true; this.TopMost = true;
this.panelRelaySettings.ResumeLayout(false);
this.panelRelaySettings.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -167,7 +257,7 @@ namespace Tidstagning
#endregion #endregion
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBox1; private System.Windows.Forms.CheckBox checkBoxRelay;
private System.Windows.Forms.FolderBrowserDialog folderBrowserOutput; private System.Windows.Forms.FolderBrowserDialog folderBrowserOutput;
private System.Windows.Forms.Button buttonFolderOutput; private System.Windows.Forms.Button buttonFolderOutput;
private System.Windows.Forms.FolderBrowserDialog folderBrowserInput; private System.Windows.Forms.FolderBrowserDialog folderBrowserInput;
@ -177,5 +267,12 @@ namespace Tidstagning
private System.Windows.Forms.Button buttonSave; private System.Windows.Forms.Button buttonSave;
private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Label label2; 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;
} }
} }

@ -39,5 +39,10 @@ namespace Tidstagning
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
this.Close(); this.Close();
} }
private void checkBoxRelay_CheckedChanged(object sender, EventArgs e)
{
panelRelaySettings.Enabled = checkBoxRelay.Enabled;
}
} }
} }

@ -123,9 +123,6 @@
<metadata name="folderBrowserInput.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="folderBrowserInput.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>183, 17</value> <value>183, 17</value>
</metadata> </metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.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"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

@ -45,26 +45,29 @@
this.DNF = new System.Windows.Forms.DataGridViewButtonColumn(); this.DNF = new System.Windows.Forms.DataGridViewButtonColumn();
this.entryBindingSource = new System.Windows.Forms.BindingSource(this.components); this.entryBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.txtLog = new System.Windows.Forms.TableLayoutPanel(); this.txtLog = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.lblClock = new System.Windows.Forms.Label();
this.comboSoundTime = new System.Windows.Forms.ComboBox(); this.flowLayoutPanelConfiguration = new System.Windows.Forms.FlowLayoutPanel();
this.numericSignalLength = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.comboComport = new System.Windows.Forms.ComboBox(); this.comboComport = new System.Windows.Forms.ComboBox();
this.lblClock = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.Clock = new System.Windows.Forms.Timer(this.components);
this.buttonConfig = new System.Windows.Forms.Button(); this.buttonConfig = new System.Windows.Forms.Button();
this.Clock = new System.Windows.Forms.Timer(this.components);
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).BeginInit();
this.txtLog.SuspendLayout(); this.txtLog.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanelConfiguration.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericSignalLength)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// btnTest // btnTest
// //
this.btnTest.Dock = System.Windows.Forms.DockStyle.Bottom;
this.btnTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); this.btnTest.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnTest.Location = new System.Drawing.Point(3, 3); this.btnTest.Location = new System.Drawing.Point(0, 464);
this.btnTest.Name = "btnTest"; this.btnTest.Name = "btnTest";
this.btnTest.Size = new System.Drawing.Size(185, 37); this.btnTest.Size = new System.Drawing.Size(264, 37);
this.btnTest.TabIndex = 3; this.btnTest.TabIndex = 3;
this.btnTest.Text = "HORN 🔊"; this.btnTest.Text = "HORN 🔊";
this.btnTest.UseVisualStyleBackColor = true; this.btnTest.UseVisualStyleBackColor = true;
@ -72,7 +75,7 @@
// //
// buttonHelp // buttonHelp
// //
this.buttonHelp.Location = new System.Drawing.Point(3, 100); this.buttonHelp.Location = new System.Drawing.Point(3, 56);
this.buttonHelp.Name = "buttonHelp"; this.buttonHelp.Name = "buttonHelp";
this.buttonHelp.Size = new System.Drawing.Size(75, 23); this.buttonHelp.Size = new System.Drawing.Size(75, 23);
this.buttonHelp.TabIndex = 14; this.buttonHelp.TabIndex = 14;
@ -94,6 +97,7 @@
// //
// panel1 // panel1
// //
this.panel1.Controls.Add(this.btnTest);
this.panel1.Controls.Add(this.textStartProcedure); this.panel1.Controls.Add(this.textStartProcedure);
this.panel1.Controls.Add(this.checkStartProcedure); this.panel1.Controls.Add(this.checkStartProcedure);
this.panel1.Controls.Add(this.btnStart); this.panel1.Controls.Add(this.btnStart);
@ -114,7 +118,7 @@
this.textStartProcedure.Name = "textStartProcedure"; this.textStartProcedure.Name = "textStartProcedure";
this.textStartProcedure.ReadOnly = true; this.textStartProcedure.ReadOnly = true;
this.textStartProcedure.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.textStartProcedure.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.textStartProcedure.Size = new System.Drawing.Size(258, 361); this.textStartProcedure.Size = new System.Drawing.Size(258, 311);
this.textStartProcedure.TabIndex = 10; this.textStartProcedure.TabIndex = 10;
this.textStartProcedure.WordWrap = false; this.textStartProcedure.WordWrap = false;
// //
@ -134,9 +138,9 @@
this.btnStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); this.btnStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnStart.Location = new System.Drawing.Point(3, 3); this.btnStart.Location = new System.Drawing.Point(3, 3);
this.btnStart.Name = "btnStart"; this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(185, 37); this.btnStart.Size = new System.Drawing.Size(258, 37);
this.btnStart.TabIndex = 4; this.btnStart.TabIndex = 4;
this.btnStart.Text = "Start"; this.btnStart.Text = "Start";
this.btnStart.UseVisualStyleBackColor = true; this.btnStart.UseVisualStyleBackColor = true;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click); this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
// //
@ -146,9 +150,9 @@
this.btnStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F); this.btnStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F);
this.btnStop.Location = new System.Drawing.Point(3, 46); this.btnStop.Location = new System.Drawing.Point(3, 46);
this.btnStop.Name = "btnStop"; this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(185, 40); this.btnStop.Size = new System.Drawing.Size(258, 40);
this.btnStop.TabIndex = 6; this.btnStop.TabIndex = 6;
this.btnStop.Text = "Stop"; this.btnStop.Text = "Stop";
this.btnStop.UseVisualStyleBackColor = true; this.btnStop.UseVisualStyleBackColor = true;
this.btnStop.Click += new System.EventHandler(this.btnStop_Click); this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
// //
@ -232,9 +236,9 @@
this.txtLog.Controls.Add(this.grid, 1, 0); this.txtLog.Controls.Add(this.grid, 1, 0);
this.txtLog.Controls.Add(this.txtHeader, 0, 0); this.txtLog.Controls.Add(this.txtHeader, 0, 0);
this.txtLog.Controls.Add(this.txtDebug, 1, 2); this.txtLog.Controls.Add(this.txtDebug, 1, 2);
this.txtLog.Controls.Add(this.flowLayoutPanel1, 0, 2);
this.txtLog.Controls.Add(this.lblClock, 2, 2); this.txtLog.Controls.Add(this.lblClock, 2, 2);
this.txtLog.Controls.Add(this.panel1, 0, 1); 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.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtLog.Location = new System.Drawing.Point(0, 0); this.txtLog.Location = new System.Drawing.Point(0, 0);
this.txtLog.Name = "txtLog"; this.txtLog.Name = "txtLog";
@ -242,60 +246,10 @@
this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle()); 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, 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.Percent, 22.22222F));
this.txtLog.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.txtLog.Size = new System.Drawing.Size(1315, 694); this.txtLog.Size = new System.Drawing.Size(1315, 694);
this.txtLog.TabIndex = 8; this.txtLog.TabIndex = 8;
// //
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.btnTest);
this.flowLayoutPanel1.Controls.Add(this.comboSoundTime);
this.flowLayoutPanel1.Controls.Add(this.label1);
this.flowLayoutPanel1.Controls.Add(this.comboComport);
this.flowLayoutPanel1.Controls.Add(this.buttonHelp);
this.flowLayoutPanel1.Controls.Add(this.buttonConfig);
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 551);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(194, 125);
this.flowLayoutPanel1.TabIndex = 15;
//
// comboSoundTime
//
this.comboSoundTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboSoundTime.FormattingEnabled = true;
this.comboSoundTime.Items.AddRange(new object[] {
"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(97, 21);
this.comboSoundTime.TabIndex = 26;
this.comboSoundTime.SelectionChangeCommitted += new System.EventHandler(this.comboSoundTime_SelectedIndexChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(106, 43);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(68, 13);
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(3, 73);
this.comboComport.Name = "comboComport";
this.comboComport.Size = new System.Drawing.Size(121, 21);
this.comboComport.TabIndex = 28;
this.comboComport.SelectedIndexChanged += new System.EventHandler(this.comboComport_SelectedIndexChanged);
//
// lblClock // lblClock
// //
this.lblClock.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.lblClock.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -310,14 +264,81 @@
this.lblClock.Text = "--:--:--"; this.lblClock.Text = "--:--:--";
this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblClock.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// Clock // flowLayoutPanelConfiguration
// //
this.Clock.Enabled = true; this.flowLayoutPanelConfiguration.Controls.Add(this.numericSignalLength);
this.Clock.Tick += new System.EventHandler(this.Clock_Tick); 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(3, 551);
this.flowLayoutPanelConfiguration.Name = "flowLayoutPanelConfiguration";
this.flowLayoutPanelConfiguration.Size = new System.Drawing.Size(264, 140);
this.flowLayoutPanelConfiguration.TabIndex = 15;
//
// numericSignalLength
//
this.numericSignalLength.Increment = new decimal(new int[] {
10,
0,
0,
0});
this.numericSignalLength.Location = new System.Drawing.Point(3, 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(121, 20);
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, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(130, 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(3, 29);
this.comboComport.Name = "comboComport";
this.comboComport.Size = new System.Drawing.Size(121, 21);
this.comboComport.TabIndex = 28;
this.comboComport.SelectedIndexChanged += new System.EventHandler(this.comboComport_SelectedIndexChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(130, 26);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(88, 24);
this.label2.TabIndex = 31;
this.label2.Text = "Com Port";
// //
// buttonConfig // buttonConfig
// //
this.buttonConfig.Location = new System.Drawing.Point(84, 100); this.buttonConfig.Location = new System.Drawing.Point(84, 56);
this.buttonConfig.Name = "buttonConfig"; this.buttonConfig.Name = "buttonConfig";
this.buttonConfig.Size = new System.Drawing.Size(90, 23); this.buttonConfig.Size = new System.Drawing.Size(90, 23);
this.buttonConfig.TabIndex = 29; this.buttonConfig.TabIndex = 29;
@ -325,6 +346,11 @@
this.buttonConfig.UseVisualStyleBackColor = true; this.buttonConfig.UseVisualStyleBackColor = true;
this.buttonConfig.Click += new System.EventHandler(this.buttonConfig_Click); this.buttonConfig.Click += new System.EventHandler(this.buttonConfig_Click);
// //
// Clock
//
this.Clock.Enabled = true;
this.Clock.Tick += new System.EventHandler(this.Clock_Tick);
//
// MainUI // MainUI
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -345,8 +371,9 @@
((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).EndInit();
this.txtLog.ResumeLayout(false); this.txtLog.ResumeLayout(false);
this.txtLog.PerformLayout(); this.txtLog.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanelConfiguration.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout(); this.flowLayoutPanelConfiguration.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericSignalLength)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -363,8 +390,7 @@
private System.Windows.Forms.TextBox txtHeader; private System.Windows.Forms.TextBox txtHeader;
private System.Windows.Forms.DataGridView grid; private System.Windows.Forms.DataGridView grid;
private System.Windows.Forms.TableLayoutPanel txtLog; private System.Windows.Forms.TableLayoutPanel txtLog;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanelConfiguration;
private System.Windows.Forms.ComboBox comboSoundTime;
private System.Windows.Forms.DataGridViewButtonColumn Complete; private System.Windows.Forms.DataGridViewButtonColumn Complete;
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewButtonColumn DNF; private System.Windows.Forms.DataGridViewButtonColumn DNF;
@ -375,6 +401,8 @@
private System.Windows.Forms.Label lblClock; private System.Windows.Forms.Label lblClock;
private System.Windows.Forms.TextBox textStartProcedure; private System.Windows.Forms.TextBox textStartProcedure;
private System.Windows.Forms.Button buttonConfig; private System.Windows.Forms.Button buttonConfig;
private System.Windows.Forms.NumericUpDown numericSignalLength;
private System.Windows.Forms.Label label2;
} }
} }

@ -27,28 +27,16 @@ namespace Tidstagning
} }
deltager_handle.Dispose(); deltager_handle.Dispose();
comboSoundTime.SelectedIndex = 0;
foreach (string port in Relay.GetPorts()) foreach (string port in Relay.GetPorts())
{ {
comboComport.Items.Add(port); comboComport.Items.Add(port);
} }
checkStartProcedure.Checked = Properties.Settings.Default.AutoStartProcedure; checkStartProcedure.Checked = Properties.Settings.Default.AutoStartProcedure;
numericSignalLength.Value = (decimal)Properties.Settings.Default.SignalLength;
uint signalLength = Properties.Settings.Default.SignalLength;
int index = comboSoundTime.Items.IndexOf(signalLength.ToString());
if (index == -1)
{
comboSoundTime.SelectedIndex = 0;
}
else
{
comboSoundTime.SelectedIndex = index;
}
string comport = Properties.Settings.Default.ComPort; string comport = Properties.Settings.Default.ComPort;
index = comboComport.Items.IndexOf(comport); int index = comboComport.Items.IndexOf(comport);
if (index == -1) if (index == -1)
{ {
comboComport.SelectedIndex = 0; comboComport.SelectedIndex = 0;
@ -101,7 +89,7 @@ namespace Tidstagning
grid.CurrentCell = null; grid.CurrentCell = null;
entries.RemoveAt(e.RowIndex); entries.RemoveAt(e.RowIndex);
horn.Sound(int.Parse(comboSoundTime.SelectedItem.ToString())); horn.Sound((uint)numericSignalLength.Value);
} }
grid.Refresh(); grid.Refresh();
} }
@ -118,8 +106,7 @@ namespace Tidstagning
btnStart.Enabled = false; btnStart.Enabled = false;
btnStop.Enabled = true; btnStop.Enabled = true;
checkStartProcedure.Enabled = false; checkStartProcedure.Enabled = false;
comboComport.Enabled = false; flowLayoutPanelConfiguration.Enabled = false;
comboSoundTime.Enabled = false;
if (checkStartProcedure.Checked) if (checkStartProcedure.Checked)
{ {
liste.Write("Automatisk Start Procedure er aktiv."); liste.Write("Automatisk Start Procedure er aktiv.");
@ -139,9 +126,7 @@ namespace Tidstagning
liste.WriteFooter(); liste.WriteFooter();
liste.Close(); liste.Close();
checkStartProcedure.Enabled = true; checkStartProcedure.Enabled = true;
comboComport.Enabled = true; flowLayoutPanelConfiguration.Enabled = true;
comboSoundTime.Enabled = true;
startprocedure.Clear();
} }
private void buttonHelp_Click(object sender, EventArgs e) private void buttonHelp_Click(object sender, EventArgs e)
@ -152,7 +137,7 @@ namespace Tidstagning
private void btnTest_Click(object sender, EventArgs e) private void btnTest_Click(object sender, EventArgs e)
{ {
horn.Sound(int.Parse(comboSoundTime.SelectedItem.ToString())); horn.Sound((uint)numericSignalLength.Value);
} }
private void Clock_Tick(object sender, EventArgs e) private void Clock_Tick(object sender, EventArgs e)
@ -164,14 +149,6 @@ namespace Tidstagning
} }
} }
private void comboSoundTime_SelectedIndexChanged(object sender, EventArgs e)
{
startprocedure.adjustSignalLength(int.Parse(comboSoundTime.SelectedItem.ToString()));
uint signalLength = uint.Parse(comboSoundTime.SelectedItem.ToString());
Properties.Settings.Default.SignalLength = signalLength;
Properties.Settings.Default.Save();
}
private void comboComport_SelectedIndexChanged(object sender, EventArgs e) private void comboComport_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (comboComport.Items.Count != 0) if (comboComport.Items.Count != 0)
@ -191,7 +168,6 @@ namespace Tidstagning
startprocedure.ReadFile(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + "Startprocedure.txt"); startprocedure.ReadFile(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Tidstagning/" + "Startprocedure.txt");
} }
Properties.Settings.Default.AutoStartProcedure = checkStartProcedure.Checked; Properties.Settings.Default.AutoStartProcedure = checkStartProcedure.Checked;
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
} }
@ -232,10 +208,15 @@ namespace Tidstagning
private void buttonConfig_Click(object sender, EventArgs e) private void buttonConfig_Click(object sender, EventArgs e)
{ {
this.flowLayoutPanel1.Enabled = false;
ConfigUI configui = new ConfigUI(); ConfigUI configui = new ConfigUI();
configui.ShowDialog(); configui.ShowDialog();
this.flowLayoutPanel1.Enabled = true; }
private void numericSignalLength_ValueChanged(object sender, EventArgs e)
{
startprocedure.adjustSignalLength((uint)numericSignalLength.Value);
Properties.Settings.Default.SignalLength = (uint)numericSignalLength.Value;
Properties.Settings.Default.Save();
} }
} }
} }

@ -10,7 +10,7 @@ namespace Tidstagning
Relay horn; Relay horn;
ResultList log; ResultList log;
List<DateTime> signaler; List<DateTime> signaler;
int signalLength = 500; uint signalLength = 500;
Timer timer; Timer timer;
Int16 idx = 0; Int16 idx = 0;
@ -88,7 +88,7 @@ namespace Tidstagning
Run(); Run();
} }
public void adjustSignalLength(int lengthMS) public void adjustSignalLength(uint lengthMS)
{ {
signalLength = lengthMS; signalLength = lengthMS;
} }

@ -9,7 +9,7 @@ namespace Tidstagning
{ {
SerialPort com; SerialPort com;
Timer cooldownTimer; Timer cooldownTimer;
Queue<Int32> signals = new Queue<Int32>(); Queue<uint> signals = new Queue<uint>();
public Relay(string ComPort = null) public Relay(string ComPort = null)
{ {
com = new SerialPort(); com = new SerialPort();
@ -42,7 +42,7 @@ namespace Tidstagning
* Sound the horn for a given time * Sound the horn for a given time
* Uses a thread to postpone the off call. * Uses a thread to postpone the off call.
*/ */
public void Sound(int time) public void Sound(uint time)
{ {
Debug.WriteLine("Requesting horn for: " + time.ToString() + "ms"); Debug.WriteLine("Requesting horn for: " + time.ToString() + "ms");
signals.Enqueue(time); signals.Enqueue(time);