diff --git a/Tidstagning/Form1.Designer.cs b/Tidstagning/Form1.Designer.cs index 5493529..5c7ea76 100644 --- a/Tidstagning/Form1.Designer.cs +++ b/Tidstagning/Form1.Designer.cs @@ -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); } diff --git a/Tidstagning/Form1.cs b/Tidstagning/Form1.cs index 7f857b8..d0342a2 100644 --- a/Tidstagning/Form1.cs +++ b/Tidstagning/Form1.cs @@ -162,7 +162,10 @@ namespace Tidstagning private void Clock_Tick(object sender, EventArgs e) { lblClock.Text = DateTime.Now.ToString("HH:mm:ss"); - textStartProcedure.Text = startprocedure.TextualRepresentation(); + if (checkStartProcedure.Checked) + { + textStartProcedure.Text = startprocedure.TextualRepresentation(); + } } private void comboSoundTime_SelectedIndexChanged(object sender, EventArgs e) @@ -183,10 +186,12 @@ 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(); diff --git a/Tidstagning/Procedure.cs b/Tidstagning/Procedure.cs index 6263b77..f933368 100644 --- a/Tidstagning/Procedure.cs +++ b/Tidstagning/Procedure.cs @@ -94,7 +94,10 @@ namespace Tidstagning public void Run() { - SetUpTimer(signaler[idx]); + if (signaler.Count > 0) + { + SetUpTimer(signaler[idx]); + } } private void SetUpTimer(DateTime alertTime) diff --git a/Tidstagning/Startprocedure.txt b/Tidstagning/Startprocedure.txt index 0abc604..0ca00d9 100644 --- a/Tidstagning/Startprocedure.txt +++ b/Tidstagning/Startprocedure.txt @@ -1,4 +1,4 @@ -18:00:00,200 -18:01:00,200 -18:04:00,200 -18:05:00,500 \ No newline at end of file +18:00:00 +18:01:00 +18:04:00 +18:05:00 \ No newline at end of file