diff --git a/Tidstagning/Form1.cs b/Tidstagning/Form1.cs index bcaf717..78b5761 100644 --- a/Tidstagning/Form1.cs +++ b/Tidstagning/Form1.cs @@ -65,7 +65,7 @@ namespace Tidstagning private void grid_Click(object sender, DataGridViewCellEventArgs e) { - if (btnStop.Enabled != true) + if (!btnStop.Enabled) return; if (btnMoveUp.Enabled) @@ -76,7 +76,6 @@ namespace Tidstagning entries[e.RowIndex].DNF(); liste.WriteDNF(entries[e.RowIndex]); - int index = e.RowIndex; grid.ClearSelection(); grid.CurrentCell = null; entries.RemoveAt(e.RowIndex); @@ -84,8 +83,7 @@ namespace Tidstagning 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); @@ -95,11 +93,8 @@ namespace Tidstagning countdowntimer.Start(); } - - //grid. grid.Refresh(); - - + } private void btnMoveUp_Click(object sender, EventArgs e) @@ -158,7 +153,6 @@ namespace Tidstagning private void btnStop_Click(object sender, EventArgs e) { - //btnAutoStart.Enabled = true; btnStop.Enabled = false; horn.Close(); @@ -208,7 +202,7 @@ namespace Tidstagning private void btnTest_Click(object sender, EventArgs e) { - if (btnStop.Enabled != true) + if (!btnStop.Enabled) return; horn.Set(0x00, 0x01); @@ -236,9 +230,5 @@ namespace Tidstagning { lblClock.Text = DateTime.Now.ToString("HH:mm:ss"); } - - - - } } diff --git a/Tidstagning/Procedure.cs b/Tidstagning/Procedure.cs index 334357b..a1a3580 100644 --- a/Tidstagning/Procedure.cs +++ b/Tidstagning/Procedure.cs @@ -17,13 +17,12 @@ namespace Tidstagning string[] parts = parse.Split(','); this.tid = TimeSpan.Parse(parts[0]); this.Duration = Int32.Parse(parts[1]); - } } Relay horn; ResultList log; - List signaler; + readonly List signaler; Timer cooldownTimer; Timer timer; Int16 idx = 0;