private void StartBtn_Click(object sender, EventArgs e) { StopBtn.Enabled = true; PauseBtn.Enabled = true; StartBtn.Enabled = false; StartBtn.Text = "Start"; PauseBtn.BackColor = Color.Yellow; StopBtn.BackColor = Color.Red; StartBtn.BackColor = Color.White; int x, y; int.TryParse(MeasuresTB.Text, out x); int.TryParse(AveragesTB.Text, out y); bool z = false; if (DataSaverDialog.FileName == "") { DataSaverDialog.ShowDialog(); } if (int.TryParse(MeasuresTB.Text, out x) && int.TryParse(AveragesTB.Text, out y)) { Graphdrawer.Start(); StartTheThread(savepath, oscillo, x, y, TriggerBtnOn.Checked); } else { MessageBox.Show("Niepoprawne parametry"); } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (Measure != null) { if (Measure.IsAlive) { Measure.Abort(); } } if (Graphdrawer != null) { if (Graphdrawer.IsAlive) { Graphdrawer.Abort(); } } Environment.Exit(Environment.ExitCode); }
private void OnlyPico_Click(object sender, EventArgs e) { int x, y; int.TryParse(MeasuresTB.Text, out x); int.TryParse(AveragesTB.Text, out y); bool z = false; if (DataSaverDialog.FileName == "") { DataSaverDialog.ShowDialog(); } if (int.TryParse(MeasuresTB.Text, out x) && int.TryParse(AveragesTB.Text, out y)) { Graphdrawer.Start(); OnlyOscilloMeasures(savepath, oscillo, x, y, TriggerBtnOn.Checked); } else { MessageBox.Show("Niepoprawne parametry"); } }