Now handles empty start list. Even more readable clock
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jens True 2021-06-12 17:48:08 +02:00
parent 72a4b215ff
commit c797cc5754
4 changed files with 31 additions and 23 deletions

@ -42,9 +42,7 @@
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();
@ -52,11 +50,13 @@
this.comboComport = new System.Windows.Forms.ComboBox();
this.lblClock = new System.Windows.Forms.Label();
this.Clock = new System.Windows.Forms.Timer(this.components);
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.entryBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).BeginInit();
this.txtLog.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).BeginInit();
this.SuspendLayout();
//
// btnTest
@ -108,7 +108,7 @@
//
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("Consolas", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textStartProcedure.Font = new System.Drawing.Font("Lucida Sans Typewriter", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textStartProcedure.Location = new System.Drawing.Point(3, 137);
this.textStartProcedure.Multiline = true;
this.textStartProcedure.Name = "textStartProcedure";
@ -197,13 +197,6 @@
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";
@ -212,10 +205,6 @@
this.DNF.Text = "Udgået";
this.DNF.UseColumnTextForButtonValue = true;
//
// entryBindingSource
//
this.entryBindingSource.DataSource = typeof(Tidstagning.Entry);
//
// txtLog
//
this.txtLog.ColumnCount = 3;
@ -294,7 +283,7 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblClock.AutoSize = true;
this.lblClock.Font = new System.Drawing.Font("Consolas", 81.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblClock.Font = new System.Drawing.Font("Lucida Sans Typewriter", 72F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblClock.Location = new System.Drawing.Point(768, 548);
this.lblClock.Name = "lblClock";
this.lblClock.Size = new System.Drawing.Size(544, 146);
@ -307,6 +296,17 @@
this.Clock.Enabled = true;
this.Clock.Tick += new System.EventHandler(this.Clock_Tick);
//
// nameDataGridViewTextBoxColumn
//
this.nameDataGridViewTextBoxColumn.DataPropertyName = "SailNumber";
this.nameDataGridViewTextBoxColumn.HeaderText = "Sejlnummer";
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
//
// entryBindingSource
//
this.entryBindingSource.DataSource = typeof(Tidstagning.Entry);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -323,11 +323,11 @@
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.flowLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.entryBindingSource)).EndInit();
this.ResumeLayout(false);
}

@ -162,8 +162,11 @@ namespace Tidstagning
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 comboSoundTime_SelectedIndexChanged(object sender, EventArgs e)
{
@ -183,11 +186,13 @@ namespace Tidstagning
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();
}

@ -93,8 +93,11 @@ namespace Tidstagning
}
public void Run()
{
if (signaler.Count > 0)
{
SetUpTimer(signaler[idx]);
}
}
private void SetUpTimer(DateTime alertTime)

@ -1,4 +1,4 @@
18:00:00,200
18:01:00,200
18:04:00,200
18:05:00,500
18:00:00
18:01:00
18:04:00
18:05:00