void stdStrategie_abbruch(object sender, AbbruchEventArgs e) { this.KeyPreview = false; if (stdStrategie != null) { stdStrategie.SignalStoppen(); Thread.Sleep(100); stdStrategie = null; } this.logfiletmp.close(); this.btnUntersuchungAbbrechen.Enabled = false; this.btnUntersuchungStarten.Enabled = true; this.tbProbandenNummer.Enabled = true; this.cbAugenseite.Enabled = true; this.Dispose(); }
void btnUntersuchungStarten_Click(object sender, EventArgs e) { if (CheckProband()) { DateTime time = DateTime.Now; string format = "yyyy-MM-dd_HHmmss"; if (this.testeCFF) { logfiletmp = new LogWriter(tbProbandenNummer.Text + "_" + this.cbAugenseite.Text + "_" + time.ToString(format) + ".cff", false); } else { logfiletmp = new LogWriter(tbProbandenNummer.Text + "_" + this.cbAugenseite.Text + "_" + time.ToString(format) + ".txt", false); } this.SignalEigenschaftenEinlesen(); Globals.flagUntersuchunglaeuft = true; this.btnUntersuchungAbbrechen.Enabled = true; this.btnUntersuchungStarten.Enabled = false; this.tbUntersuchungsVerlauf.Clear(); this.tbUntersuchungsVerlauf.Visible = true; this.tbProbandenNummer.Enabled = false; this.cbAugenseite.Enabled = false; this.KeyPreview = true; if ((IRChannel.SC1DeltaK_100 < float.Epsilon) && (IGChannel.SC1DeltaK_100 < float.Epsilon) && (Math.Abs(IBChannel.SC1DeltaK_100) < float.Epsilon) && (ICChannel.SC1DeltaK_100 < float.Epsilon)) { if (UseBestPEST) { Strategie = new BestPEST(mainProgram); } else { stdStrategie = new StdStrategie(mainProgram, "außen", testeCFF); } } else { if (UseBestPEST) { Strategie = new BestPEST(mainProgram); } else { stdStrategie = new StdStrategie(mainProgram, "innen", testeCFF); } } if (UseBestPEST) { Strategie.Abbruch += new EventHandler <AbbruchEventArgs>(stdStrategie_abbruch); } else { stdStrategie.abbruch += new EventHandler <AbbruchEventArgs>(stdStrategie_abbruch); } if (!testeCFF) { if (freq > 0) { if (UseBestPEST) { Strategie._setNewFrequency(freq); } else { stdStrategie._setNewFrequency(freq); } } } } }