56 lines
1.6 KiB
C#
56 lines
1.6 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace TBF.BenchControl.DataEntry.Munich
|
|
{
|
|
public partial class CycleEndForm : Form, GenericDevices.IHasCompleted
|
|
{
|
|
// To be set before the form opens
|
|
public string ProtocolName1;
|
|
public string ProtocolName2;
|
|
public string ProtocolName3;
|
|
|
|
// To be retrieved after the form closes
|
|
public string MainStateText;
|
|
public string AuxStateText;
|
|
public string ProtocolTitle;
|
|
|
|
// Set to 'true' when the form closes
|
|
public bool Completed { get { return completed; } }
|
|
bool completed;
|
|
|
|
public CycleEndForm()
|
|
{
|
|
InitializeComponent();
|
|
completed = false;
|
|
// TODO: localize strings
|
|
}
|
|
|
|
private void CycleEndForm_Load(object sender, EventArgs e)
|
|
{
|
|
radioButton1.Text = ProtocolName1;
|
|
radioButton2.Text = ProtocolName2;
|
|
radioButton3.Text = ProtocolName3;
|
|
qRiseTextBox.Text = Sequences.SequenceBase.Qrise.ToString("F3");
|
|
qFallTextBox.Text = Sequences.SequenceBase.Qfall.ToString("F3");
|
|
}
|
|
|
|
private void okButton_Click(object sender, EventArgs e)
|
|
{
|
|
MainStateText = mainStateTextBox.Text;
|
|
AuxStateText = auxStateTextBox.Text;
|
|
|
|
float umsch;
|
|
if (Utils.TryParseUFloat(qRiseTextBox.Text, out umsch)) Sequences.SequenceBase.Qrise = umsch;
|
|
if (Utils.TryParseUFloat(qFallTextBox.Text, out umsch)) Sequences.SequenceBase.Qfall = umsch;
|
|
|
|
if (radioButton1.Checked) ProtocolTitle = ProtocolName1;
|
|
else if (radioButton2.Checked) ProtocolTitle = ProtocolName2;
|
|
else if (radioButton3.Checked) ProtocolTitle = ProtocolName3;
|
|
|
|
completed = true;
|
|
Close();
|
|
}
|
|
}
|
|
}
|