Vývoj metody a konstrukce přístroje pro rychlé monitorování

advertisement
Vývoj metody a konstrukce přístroje pro rychlé
monitorování vysokoteplotní stability rostlin
E001:
Příloha - Software
V Drásově dne 16.12.2011
Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using System.Reflection;
namespace ProfileCon
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// Osetreni spusteni jedne instance
bool canCreate = true;
using (Mutex mutex = new Mutex(true, "ProfileCon", out canCreate))
{
if (canCreate)
{
Log.AddLog("Aplication: START", EmptyLine.Above);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMain());
Log.AddLog("Aplication: FINISH", EmptyLine.Below);
}
else
{
Log.AddLog("Attempt to run another instance of " + GetAssemblyTitle() + " application.");
MessageBox.Show("Application is already running." + Environment.NewLine + "There could be only one instance of application.",
"Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
private static string GetAssemblyTitle()
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}
}
FormMain.cs
//#define REG_FAKE
//#define XBC_FAKE
#define REFRESHER
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using System.Threading;
using System.IO;
using ProfileCon.Devices;
using ProfileCon.Measuring;
using ProfileCon.Data;
namespace ProfileCon
{
public partial class FormMain : Form
{
private const string TIME_CHART = "chArea_time";
private const string VALUE_CHART = "chArea_main";
public FormMain()
{
InitializeComponent();
InitializeDataGridView();
InitializeChart();
InitializeDevices();
InitializeFormMain();
// Connect devices pres vlakno
Thread t = new Thread(ConnectDevices);
t.Name = "ConnectingThread";
t.IsBackground = true;
t.Start();
Refresher = new System.Windows.Forms.Timer(this.components);
Refresher.Interval = 2000;
Refresher.Tick += new EventHandler(Refresher_Tick);
Refresher.Start();
}
// -------------------------------------------------------------------// Members
XBCDevice XBC;
ThermoRegulator TR;
ExperimentMeasure Measuring;
System.Windows.Forms.Timer Refresher;
// -------------------------------------------------------------------// Methods
private void ConnectDevices()
{
Thread.Sleep(1500); // zpozdeni pro efekt
TR.Connect();
Thread.Sleep(500); // zpozdeni pro efekt
XBC.Connect();
}
#region Initialize objects
private void InitializeDataGridView()
{
// Time column ----------------------------------------------DataGridViewColumn colTime = new DataGridViewTextBoxColumn();
colTime.Name = "Time";
colTime.ValueType = typeof(TimeSpan);
colTime.ReadOnly = true;
colTime.SortMode = DataGridViewColumnSortMode.NotSortable;
colTime.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
colTime.HeaderText = "Realative measure time" + Environment.NewLine + "[ H:mm:ss.f ]";
dGrid.Columns.Add(colTime);
DataGridViewCellStyle timeCellStyle = new DataGridViewCellStyle();
timeCellStyle.Format = "H:mm:ss.f";
timeCellStyle.NullValue = "noTime";
colTime.DefaultCellStyle = timeCellStyle;
// Thermoregulator temperature -----------------------------DataGridViewColumn colTempTr = new DataGridViewTextBoxColumn(); ;
colTempTr.Name = "tempTr";
colTempTr.ValueType = typeof(double);
colTempTr.ReadOnly = true;
colTempTr.SortMode = DataGridViewColumnSortMode.NotSortable;
colTempTr.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
colTempTr.HeaderText = "Temperature TR " + Environment.NewLine + "[ °C ]";
dGrid.Columns.Add(colTempTr);
// XBC temperature -----------------------------------------DataGridViewColumn colTempXbc = new DataGridViewTextBoxColumn(); ;
colTempXbc.Name = "tempXbc";
colTempXbc.ValueType = typeof(double);
colTempXbc.SortMode = DataGridViewColumnSortMode.NotSortable;
colTempXbc.ReadOnly = true;
colTempXbc.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
colTempXbc.HeaderText = "Temperature XBC " + Environment.NewLine + " [ °C ]";
dGrid.Columns.Add(colTempXbc);
// XBC conductivity ---------------------------------------DataGridViewColumn colConduc = new DataGridViewTextBoxColumn();
colConduc.Name = "conducXbc";
colConduc.ValueType = typeof(double);
colConduc.SortMode = DataGridViewColumnSortMode.NotSortable;
colConduc.ReadOnly = true;
colConduc.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
colConduc.HeaderText = "Conductivity " + Environment.NewLine + " [ µS/cm ]";
dGrid.Columns.Add(colConduc);
}
private void InitializeDevices()
{
bool trFake = Config.GetKeyValue("TR", "mode") == "fake" ? true : false;
bool xbcFake = Config.GetKeyValue("XBC", "mode") == "fake" ? true : false; ;
#if(REG_FAKE)
trFake = true;
#endif
if (trFake)
TR = new ThermoFake();
else
{
string comPort = Config.GetKeyValue("TR", "port");
if (string.IsNullOrEmpty(comPort))
{
Log.AddLog("No port definition in config file - default port COM1 will be used");
comPort = "COM1";
}
TR = new TR2000(comPort);
}
TR.EnabledChanged += new EnabledChanged(TR_OnState);
TR.OnDataRecieved += new DataReceived(TR_OnDataRecieved);
#if(XBC_FAKE)
xbcFake = true;
#endif
if (xbcFake)
{
XBC = new XBCFake(TR);
}
else
{
XBC = new XBCMagic("127.0.0.1");
}
XBC.EnabledChanged += new EnabledChanged(XBC_OnState);
XBC.OnDataRecieved += new DataReceived(XBC_OnDataRecieved);
InitializeMeasuring(TR, XBC);
}
private void InitializeMeasuring(ThermoRegulator tr, XBCDevice xbc)
{
Measuring = new ExperimentMeasure(tr, xbc);
Measuring.EnabledChanged += new OnDeviceState(Measuring_EnabledChanged);
Measuring.IsMeasuringChanged += new OnDeviceState(Measuring_IsMeasureChanged);
Measuring.MeasureStateChanged += new OnMeasureState(Measuring_MeasureStateChanged);
Measuring.NewMessage += new MeasureMessage(Measuring_OnMessage);
Measuring.NewMeasuredData += new OnNewData(Measuring_NewDataMeasured);
Measuring.StartingProgressChanged += new OnProgress(Measuring_OnStartingProgress);
Measuring.MeasureProgressChanged += new OnProgress(Measuring_OnMeasureProgress);
}
private void InitializeChart()
{
// Main chartArea -------------------------------------------// X - stuff
chart.ChartAreas[0].CursorX.IsUserEnabled = true;
chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
chart.ChartAreas[0].CursorX.Interval = 0.1;
chart.ChartAreas[0].AxisX.ScaleView.SmallScrollSize = 1;
chart.ChartAreas[0].AxisX.ScaleView.SmallScrollMinSize = 1;
// Y - stuff
chart.ChartAreas[0].CursorY.IsUserEnabled = true;
chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
chart.ChartAreas[0].CursorY.Interval = 0.1;
chart.ChartAreas[0].AxisY.ScaleView.SmallScrollSize = 1;
chart.ChartAreas[0].AxisY.ScaleView.SmallScrollMinSize = 1;
// Time chartArea ------------------------------------------DateTimeIntervalType interval = DateTimeIntervalType.Milliseconds;
// X (time) stuff
chart.ChartAreas[1].CursorX.IsUserEnabled = true;
chart.ChartAreas[1].CursorX.IsUserSelectionEnabled = true;
chart.ChartAreas[1].CursorX.IntervalType = interval;
chart.ChartAreas[1].CursorX.Interval = 100;
chart.ChartAreas[1].AxisX.ScaleView.SmallScrollSize = 100;
chart.ChartAreas[1].AxisX.ScaleView.SmallScrollSizeType = interval;
chart.ChartAreas[1].AxisX.ScaleView.SmallScrollMinSizeType = interval;
chart.ChartAreas[1].AxisX.ScaleView.SmallScrollMinSize = 100;
// Y value stuff
chart.ChartAreas[1].CursorY.IsUserEnabled = true;
chart.ChartAreas[1].CursorY.IsUserSelectionEnabled = true;
chart.ChartAreas[1].CursorY.Interval = 0.1;
chart.ChartAreas[1].AxisY.ScaleView.SmallScrollSize = 1;
chart.ChartAreas[1].AxisY.ScaleView.SmallScrollMinSize = 1;
}
private void InitializeFormMain()
{
this.FormClosing += new FormClosingEventHandler(FormMain_FormClosing);
this.WindowState = FormWindowState.Maximized;
}
#endregion
#region Start/Stop
private void bt_start_Click(object sender, EventArgs e)
{
try
{
// potvrzovacka proti smazani namerenych dat
if (Measuring.Data.Rows.Count > 0)
{
DialogResult dr = MessageBox.Show("Start experiment will rewrite previous measured data."
+ Environment.NewLine + "Do You really want to start new measuring?", "Confirmation", MessageBoxButtons.OKCancel,
MessageBoxIcon.Question);
if (dr == DialogResult.Cancel)
return;
}
ClearDataFromGUI();
// stop continual timing
Refresher.Stop();
// start s aktualnim settings
ExperimentSetting mSetting = ParseSettingsFromGUI();
Measuring.Start(mSetting);
}
catch (Exception excp)
{
Log.AddLog("Start experiment error. Msg: " + excp.Message);
MessageBox.Show(excp.Message, "Start experiment error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void bt_stop_Click(object sender, EventArgs e)
{
DialogResult dr = MessageBox.Show("Do You really want to stop experiment?", "Confirmation", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (dr == DialogResult.Yes)
{
Measuring.Stop();
}
}
private ExperimentSetting ParseSettingsFromGUI()
{
int startSeconds = int.Parse(Config.GetKeyValue("EXPERIMENT", "TOStart"));
TimeSpan startTimeout = TimeSpan.FromSeconds(startSeconds);
int steadySeconds = int.Parse(Config.GetKeyValue("EXPERIMENT", "TOSteady"));
TimeSpan steadyTimeout = TimeSpan.FromSeconds(steadySeconds);
double sAmpl = double.Parse(Config.GetKeyValue("EXPERIMENT", "SteadyAmplitude"));
double startTemp = double.Parse(tBox_tempStart.Text);
double stopTemp = double.Parse(tBox_tempStop.Text);
double slope = double.Parse(tBox_slope.Text);
ExperimentSetting mSetting = new ExperimentSetting(startTimeout,steadyTimeout, sAmpl, startTemp, stopTemp, slope);
return mSetting;
}
#endregion
#region Import / Export
private void bt_export_Click(object sender, EventArgs e)
{
if (Measuring.Data.Rows.Count != 0)
{
FormExportSetting fExport = new FormExportSetting(Measuring.Setting, Measuring.Info, new ExperimentData(Measuring.Data));
DialogResult dr = fExport.ShowDialog();
if (dr == DialogResult.OK)
{
MessageBox.Show("Export completed successfuly", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
else
{
MessageBox.Show("No Data to export", "Export Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void bt_import_Click(object sender, EventArgs e)
{
DialogResult dr = oFDialog_experiment.ShowDialog();
if (dr == DialogResult.OK)
{
try
{
Experiment experiment = Loader.LoadExperiment(oFDialog_experiment.FileName);
ClearDataFromGUI();
LaodSettingToGUI(experiment.Settings);
LaodDataToGUI(experiment.Data);
SetVisibilityChartTitle(false);
}
catch (Exception excp)
{
ClearDataFromGUI();
Log.AddLog("Loading error. Msg: " + excp.Message);
MessageBox.Show(excp.Message, "Loading error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
private void LaodDataToGUI(ExperimentData data)
{
foreach (DataRow row in data.Data.Rows)
{
double relTime = (double)row[DataStructure.DColumns.Time.ToString()];
double trTemp = (double)row[DataStructure.DColumns.TrTemp.ToString()];;
double xbcTemp = (double)row[DataStructure.DColumns.XbcTemp.ToString()];;
double xbcConduct = (double)row[DataStructure.DColumns.XbcConduct.ToString()]; ;
MeasuredData md = new MeasuredData(relTime, trTemp, xbcTemp, xbcConduct);
Measuring_NewDataMeasured(md);
}
}
private void LaodSettingToGUI(ExperimentSetting settings)
{
tBox_tempStart.Text = settings.StartTemperature.ToString();
tBox_tempStop.Text = settings.TargetTemperature.ToString();
tBox_slope.Text = settings.Slope.ToString();
}
#endregion
#region Event handlers
// XBC measure unit
//
void XBC_OnState(Device device, bool state)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => XBC_OnState(device, state);
Invoke(del);
return;
}
lab_labXbcTemp.Enabled = state;
lab_labXbcCond.Enabled = state;
lab_xbcConduct.Enabled = state;
lab_xbcTemp.Enabled = state;
if (state)
{
lab_XBCEnableState.ImageKey = "lg-success-shadow.png";
lab_xbcName.Text = XBC.Name;
}
else
{
lab_XBCEnableState.ImageKey = "lg-failed-shadow.png";
}
}
catch(Exception excp)
{
Log.AddLog("GUI exception - XBC_OnState: " + excp.Message);
}
}
void XBC_OnDataRecieved(Device device)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => XBC_OnDataRecieved(device);
Invoke(del);
return;
}
lab_xbcConduct.Text = XBC.XB1EProbe.Conductivity.ToString("0.00 µS/cm");
lab_xbcTemp.Text = XBC.XB1EProbe.Temperature.ToString("0.0 °C");
lab_xbcRefr.ImageIndex = 0;
timer2.Start();
}
catch (Exception excp)
{
Log.AddLog("GUI exception - XBC_OnDataRecieved: " + excp.Message);
}
}
// Termoregularor
//
void TR_OnState(Device device, bool state)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => TR_OnState(device, state);
Invoke(del);
return;
}
lab_labTrTemp.Enabled = state;
lab_labTrReg.Enabled = state;
lab_trTemp.Enabled = state;
lab_trState.Enabled = state;
if (state)
{
lab_TREnableState.ImageKey = "lg-success-shadow.png";
lab_trName.Text = TR.Name;
}
else
{
lab_TREnableState.ImageKey = "lg-failed-shadow.png";
}
}
catch (Exception excp)
{
Log.AddLog("GUI exception - TR_OnState: " + excp.Message);
}
if (state)
InitializeTR();
}
void TR_OnDataRecieved(Device device)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = delegate { TR_OnDataRecieved(device); };
Invoke(del);
return;
}
lab_trTemp.Text = TR.Temperature.ToString("0.0 °C");
lab_trState.Text = TR.RegulationState ? "ON" : "OFF";
lab_trError.Visible = TR.IsError;
lab_trRefr.ImageIndex = 0;
timer1.Start();
}
catch (Exception excp)
{
Log.AddLog("GUI exception - TR_OnDataRecieved: " + excp.Message);
}
}
private void InitializeTR()
{
try
{
ushort ti = ushort.Parse(Config.GetKeyValue("TR", "Ti"));
ushort k = ushort.Parse(Config.GetKeyValue("TR", "K"));
ushort td = ushort.Parse(Config.GetKeyValue("TR", "Td"));
TR.InitializeTR(ti, k, td);
}
catch (Exception excp)
{
Log.AddLog("Initialize TermoRegulator exception: " + excp.Message);
}
}
// AdvanceMeasuring
//
void Measuring_EnabledChanged(object sender, bool enabled)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => Measuring_EnabledChanged(sender, enabled);
Invoke(del);
return;
}
gBox_measuring.Enabled = enabled;
CheckStartMeasureEnabled(); // Musi byt posledni
}
catch (Exception excp)
{
Log.AddLog("GUI exception - Measuring_EnableChanbed: " + excp.Message);
}
}
void Measuring_IsMeasureChanged(object sender, bool state)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => Measuring_IsMeasureChanged(sender, state);
Invoke(del);
return;
}
// Controls enabeling
bt_export.Enabled = !state;
tBox_tempStart.Enabled = !state;
tBox_tempStop.Enabled = !state;
tBox_slope.Enabled = !state;
lab_lock.Visible = state;
CheckStartMeasureEnabled(); // Musi byt posledni
// Start vycitani
if (!state && Measuring.Enabled)
{
#if(REFRESHER)
Refresher.Start();
#endif
}
}
catch (Exception excp)
{
Log.AddLog("GUI exception - Measuring_IsMeasureChanged: " + excp.Message);
}
}
void Measuring_MeasureStateChanged(MeasureState state)
{
try
{
if (InvokeRequired)
{
MethodInvoker mI = () => Measuring_MeasureStateChanged(state);
Invoke(mI);
return;
}
lab_measureState.Text = state.ToString();
}
catch (Exception excp)
{
Log.AddLog("GUI exception - Measuring_MeasureStateChanged: " + excp.Message);
}
}
void Measuring_OnMessage(string message)
{
try
{
if (InvokeRequired)
{
MethodInvoker mI = () => Measuring_OnMessage(message);
Invoke(mI);
return;
}
tslab_message.Text = message;
Log.AddLog("AdvanceMeasure Message: " + message);
}
catch (Exception excp)
{
Log.AddLog("GUI exception - Measuring_OnMessage: " + excp.Message);
}
}
void Measuring_NewDataMeasured(MeasuredData data)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => Measuring_NewDataMeasured(data);
Invoke(del);
return;
}
SetVisibilityChartTitle(false);
DateTime fakeRelTime = DateTime.Today + TimeSpan.FromSeconds(data.Time);
// Add to DataGridView
dGrid.Rows.Add(fakeRelTime, data.TrTemp, data.XbcTemp, data.XbcConduct);
// Add to chart
chart.Series["ser_tempTRTime"].Points.AddXY(fakeRelTime.ToOADate(), data.TrTemp);
chart.Series["ser_tempXBCTime"].Points.AddXY(fakeRelTime.ToOADate(), data.XbcTemp);
chart.Series["ser_conduct"].Points.AddXY(data.TrTemp, data.XbcConduct);
}
catch (Exception excp)
{
Log.AddLog("GUI exception - Measuring_NewDataMeasured: " + excp.Message);
}
}
void Measuring_OnStartingProgress(int percent)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => Measuring_OnStartingProgress(percent);
Invoke(del);
return;
}
pBar_starting.Value = percent;
pBar_starting.Invalidate();
}
catch (Exception excp)
{
Log.AddLog("GUI exception - Measuring_OnStartingProgress: " + excp.Message);
}
}
void Measuring_OnMeasureProgress(int percent)
{
try
{
if (InvokeRequired)
{
MethodInvoker del = () => Measuring_OnMeasureProgress(percent);
Invoke(del);
return;
}
pBar_measuring.Value = percent;
pBar_measuring.Invalidate();
}
catch (Exception excp)
{
Log.AddLog("GUI exception - Measuring_OnMeasureProgress: " + excp.Message);
}
}
// Refresher
//
void Refresher_Tick(object sender, EventArgs e)
{
Thread t = new Thread(RefreshValues);
t.Name = "RefreshingThread";
t.IsBackground = true;
t.Start();
}
private void RefreshValues()
{
if (TR.Enabled)
TR.Refresh();
if (XBC.Enabled)
XBC.Refresh();
}
// MainForm
//
void FormMain_FormClosing(object sender, FormClosingEventArgs e)
{
Log.AddLog("Form closing event. This.Disposing:" + this.Disposing.ToString());
bool doRefresh = Refresher.Enabled;
Refresher.Stop();
DialogResult dr = MessageBox.Show("Do You really want to close application?", "Confirmation", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
if (dr == DialogResult.No)
{
e.Cancel = true;
if (doRefresh)
{
#if (REFRESHER)
Refresher.Start();
#endif
}
}
}
#endregion
#region Graph
private void SetVisibilityChartTitle(bool visible)
{
chart.Titles["title_empty"].Visible = visible;
chart.Titles["title_emptyBottom"].Visible = visible;
}
private void chBox_upper_CheckedChanged(object sender, EventArgs e)
{
CheckBox chBox = (CheckBox)sender;
chart.ChartAreas[VALUE_CHART].Visible = chBox.Checked;
}
private void chBox_bottom_CheckedChanged(object sender, EventArgs e)
{
CheckBox chBox = (CheckBox)sender;
chart.ChartAreas[TIME_CHART].Visible = chBox.Checked;
}
private void bt_zoomOutUpper_Click(object sender, EventArgs e)
{
foreach (Axis axis in chart.ChartAreas[VALUE_CHART].Axes)
{
axis.ScaleView.ZoomReset();
}
}
private void bt_zoomOutBottom_Click(object sender, EventArgs e)
{
foreach (Axis axis in chart.ChartAreas[TIME_CHART].Axes)
{
axis.ScaleView.ZoomReset();
}
}
#endregion
#region Input textBoxes text changed events
private void tBox_tempStart_TextChanged(object sender, EventArgs e)
{
ShowEstimatedDuration();
}
private void tBox_tempStop_TextChanged(object sender, EventArgs e)
{
ShowEstimatedDuration();
}
private void tBox_slope_TextChanged(object sender, EventArgs e)
{
ShowEstimatedDuration();
}
private void ShowEstimatedDuration()
{
try
{
ExperimentSetting setting = ParseSettingsFromGUI();
double diff = setting.TargetTemperature - setting.StartTemperature;
TimeSpan time = TimeSpan.FromMinutes(Math.Abs(diff) / setting.Slope);
lab_time.Text = (time.Minutes + time.Hours * 60).ToString() + "min " + time.Seconds.ToString("00") + "sec";
}
catch { }
}
#endregion
private void ClearDataFromGUI()
{
dGrid.Rows.Clear();
foreach (Series series in chart.Series)
{
series.Points.Clear();
}
SetVisibilityChartTitle(true);
}
private void CheckStartMeasureEnabled()
{
bool b = Measuring.Enabled && Measuring.IsMeasuring;
bt_start.Enabled = !b;
bt_stop.Enabled = b;
}
private void labs_TRs_Click(object sender, EventArgs e)
{
if (!Measuring.IsMeasuring && !Refresher.Enabled)
TR.Refresh();
}
private void labs_xbc_Click(object sender, EventArgs e)
{
if (!Measuring.IsMeasuring && !Refresher.Enabled)
XBC.Refresh();
}
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Stop();
lab_trRefr.ImageIndex = 1;
}
private void timer2_Tick(object sender, EventArgs e)
{
timer2.Stop();
lab_xbcRefr.ImageIndex = 1;
}
private void lab_TREnableState_Click(object sender, EventArgs e)
{
if (!TR.Enabled)
TR.Connect();
}
private void lab_XBCEnableState_Click(object sender, EventArgs e)
{
if (!XBC.Enabled)
XBC.Connect();
}
private void tBox_tempStart_Validating(object sender, CancelEventArgs e)
{
Correct(sender, 70, -10);
}
private void tBox_tempStop_Validating(object sender, CancelEventArgs e)
{
Correct(sender, 70, -10);
}
private void tBox_slope_Validating(object sender, CancelEventArgs e)
{
Correct(sender, 10, -10);
}
private static void Correct(object sender, double HiLimit, double LowLimit)
{
double d = double.Parse(((Control)sender).Text);
if (d > HiLimit)
{
((Control)sender).Text = HiLimit.ToString("0.");
}
else if (d < LowLimit)
{
((Control)sender).Text = LowLimit.ToString("0.");
}
}
}
}
FormMainDesigner.cs
namespace ProfileCon
{
partial class FormMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea7 = new
System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea8 = new
System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series13 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series14 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series15 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series16 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Title title7 = new System.Windows.Forms.DataVisualization.Charting.Title();
System.Windows.Forms.DataVisualization.Charting.Title title8 = new System.Windows.Forms.DataVisualization.Charting.Title();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(FormMain));
this.chart = new System.Windows.Forms.DataVisualization.Charting.Chart();
this.bt_start = new System.Windows.Forms.Button();
this.bt_stop = new System.Windows.Forms.Button();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.tslab_message = new System.Windows.Forms.ToolStripStatusLabel();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.tBox_tempStart = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tBox_slope = new System.Windows.Forms.TextBox();
this.tBox_tempStop = new System.Windows.Forms.TextBox();
this.gBox_settings = new System.Windows.Forms.GroupBox();
this.lab_time = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.lab_lock = new System.Windows.Forms.Label();
this.gBox_measuring = new System.Windows.Forms.GroupBox();
this.label15 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.lab_measureState = new System.Windows.Forms.Label();
this.pBar_starting = new System.Windows.Forms.ProgressBar();
this.pBar_measuring = new System.Windows.Forms.ProgressBar();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage_chart = new System.Windows.Forms.TabPage();
this.chBox_bottom = new System.Windows.Forms.CheckBox();
this.chBox_upper = new System.Windows.Forms.CheckBox();
this.bt_zoomOutBottom = new System.Windows.Forms.Button();
this.bt_zoomOutUpper = new System.Windows.Forms.Button();
this.tabPage_data = new System.Windows.Forms.TabPage();
this.dGrid = new System.Windows.Forms.DataGridView();
this.imList_status = new System.Windows.Forms.ImageList(this.components);
this.gBox_experiment = new System.Windows.Forms.GroupBox();
this.bt_export = new System.Windows.Forms.Button();
this.bt_import = new System.Windows.Forms.Button();
this.gBox_devices = new System.Windows.Forms.GroupBox();
this.lab_trError = new System.Windows.Forms.Label();
this.lab_xbcRefr = new System.Windows.Forms.Label();
this.imageList_reload = new System.Windows.Forms.ImageList(this.components);
this.lab_trRefr = new System.Windows.Forms.Label();
this.lab_xbcName = new System.Windows.Forms.Label();
this.lab_trName = new System.Windows.Forms.Label();
this.lab_labXbcTemp = new System.Windows.Forms.Label();
this.lab_labXbcCond = new System.Windows.Forms.Label();
this.lab_xbcConduct = new System.Windows.Forms.Label();
this.lab_XBCEnableState = new System.Windows.Forms.Label();
this.lab_xbcTemp = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.lab_labTrReg = new System.Windows.Forms.Label();
this.lab_labTrTemp = new System.Windows.Forms.Label();
this.lab_trState = new System.Windows.Forms.Label();
this.lab_TREnableState = new System.Windows.Forms.Label();
this.lab_trTemp = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.oFDialog_experiment = new System.Windows.Forms.OpenFileDialog();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.timer2 = new System.Windows.Forms.Timer(this.components);
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.statusStrip1.SuspendLayout();
this.gBox_settings.SuspendLayout();
this.gBox_measuring.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage_chart.SuspendLayout();
this.tabPage_data.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dGrid)).BeginInit();
this.gBox_experiment.SuspendLayout();
this.gBox_devices.SuspendLayout();
this.SuspendLayout();
//
// chart
//
this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.chart.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
chartArea7.AlignmentStyle =
((System.Windows.Forms.DataVisualization.Charting.AreaAlignmentStyles)((System.Windows.Forms.DataVisualization.Charting.AreaAlignment
Styles.Position | System.Windows.Forms.DataVisualization.Charting.AreaAlignmentStyles.PlotPosition)));
chartArea7.AlignWithChartArea = "chArea_time";
chartArea7.AxisX.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number;
chartArea7.AxisX.LabelStyle.Format = "0.00";
chartArea7.AxisX.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisX.MajorGrid.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisX.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
chartArea7.AxisX.MajorTickMark.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisX.MinorGrid.Enabled = true;
chartArea7.AxisX.MinorGrid.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisX.MinorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dot;
chartArea7.AxisX.Title = "Temperature [ °C ]";
chartArea7.AxisX2.IsStartedFromZero = false;
chartArea7.AxisX2.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisY.IsLabelAutoFit = false;
chartArea7.AxisY.IsStartedFromZero = false;
chartArea7.AxisY.LabelStyle.Format = "0.00";
chartArea7.AxisY.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisY.MajorGrid.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
chartArea7.AxisY.MajorTickMark.LineColor = System.Drawing.Color.DimGray;
chartArea7.AxisY.MinorGrid.Enabled = true;
chartArea7.AxisY.MinorGrid.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisY.MinorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dot;
chartArea7.AxisY.TextOrientation = System.Windows.Forms.DataVisualization.Charting.TextOrientation.Rotated270;
chartArea7.AxisY.Title = "Conductivity [ µS/cm ]";
chartArea7.AxisY2.IsStartedFromZero = false;
chartArea7.AxisY2.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisY2.MajorGrid.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisY2.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
chartArea7.AxisY2.MajorTickMark.LineColor = System.Drawing.Color.DimGray;
chartArea7.AxisY2.MinorGrid.LineColor = System.Drawing.Color.Gray;
chartArea7.AxisY2.MinorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dot;
chartArea7.AxisY2.MinorTickMark.LineColor = System.Drawing.Color.Gray;
chartArea7.BackColor = System.Drawing.Color.OldLace;
chartArea7.Name = "chArea_main";
chartArea8.AlignmentStyle =
((System.Windows.Forms.DataVisualization.Charting.AreaAlignmentStyles)((System.Windows.Forms.DataVisualization.Charting.AreaAlignment
Styles.Position | System.Windows.Forms.DataVisualization.Charting.AreaAlignmentStyles.PlotPosition)));
chartArea8.AlignWithChartArea = "chArea_main";
chartArea8.AxisX.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Seconds;
chartArea8.AxisX.LabelStyle.Format = "H:mm:ss";
chartArea8.AxisX.LabelStyle.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Seconds;
chartArea8.AxisX.LineColor = System.Drawing.Color.DimGray;
chartArea8.AxisX.MajorGrid.IntervalType = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Minutes;
chartArea8.AxisX.MajorGrid.LineColor = System.Drawing.Color.Gray;
chartArea8.AxisX.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
chartArea8.AxisX.MajorTickMark.LineColor = System.Drawing.Color.DimGray;
chartArea8.AxisX.MinorGrid.Enabled = true;
chartArea8.AxisX.MinorGrid.LineColor = System.Drawing.Color.Gray;
chartArea8.AxisX.MinorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dot;
chartArea8.AxisX.MinorTickMark.LineColor = System.Drawing.Color.Gray;
chartArea8.AxisX.Title = "Time [ h:mm:ss ]";
chartArea8.AxisX2.IsStartedFromZero = false;
chartArea8.AxisY.IsStartedFromZero = false;
chartArea8.AxisY.LineColor = System.Drawing.Color.DimGray;
chartArea8.AxisY.MajorGrid.LineColor = System.Drawing.Color.Gray;
chartArea8.AxisY.MajorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
chartArea8.AxisY.MajorTickMark.LineColor = System.Drawing.Color.DimGray;
chartArea8.AxisY.MinorGrid.Enabled = true;
chartArea8.AxisY.MinorGrid.LineColor = System.Drawing.Color.Gray;
chartArea8.AxisY.MinorGrid.LineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dot;
chartArea8.AxisY.Title = "Temperature [ °C ]";
chartArea8.AxisY2.IsStartedFromZero = false;
chartArea8.BackColor = System.Drawing.Color.OldLace;
chartArea8.Name = "chArea_time";
this.chart.ChartAreas.Add(chartArea7);
this.chart.ChartAreas.Add(chartArea8);
legend4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
legend4.BorderDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dot;
legend4.DockedToChartArea = "chArea_time";
legend4.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Bottom;
legend4.IsDockedInsideChartArea = false;
legend4.LegendStyle = System.Windows.Forms.DataVisualization.Charting.LegendStyle.Row;
legend4.Name = "legendTime";
this.chart.Legends.Add(legend4);
this.chart.Location = new System.Drawing.Point(3, 3);
this.chart.Margin = new System.Windows.Forms.Padding(4);
this.chart.Name = "chart";
series13.BorderWidth = 2;
series13.ChartArea = "chArea_time";
series13.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
series13.Legend = "legendTime";
series13.LegendText = "Temperature TR";
series13.Name = "ser_tempTRTime";
series13.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
series13.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Single;
series14.BorderWidth = 2;
series14.ChartArea = "chArea_main";
series14.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
series14.Color = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
series14.IsVisibleInLegend = false;
series14.Legend = "legendTime";
series14.LegendText = "Conductivity";
series14.Name = "ser_conduct";
series15.BorderWidth = 2;
series15.ChartArea = "chArea_time";
series15.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
series15.Legend = "legendTime";
series15.LegendText = "Temperature XBC";
series15.Name = "ser_tempXBCTime";
series15.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Time;
series16.BorderWidth = 2;
series16.ChartArea = "chArea_main";
series16.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
series16.Legend = "legendTime";
series16.LegendText = "Critical point";
series16.MarkerSize = 10;
series16.MarkerStyle = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Cross;
series16.Name = "ser_der";
series16.YValuesPerPoint = 2;
this.chart.Series.Add(series13);
this.chart.Series.Add(series14);
this.chart.Series.Add(series15);
this.chart.Series.Add(series16);
this.chart.Size = new System.Drawing.Size(629, 555);
this.chart.TabIndex = 0;
this.chart.Text = "chart1";
title7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
title7.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
title7.BorderWidth = 2;
title7.DockedToChartArea = "chArea_main";
title7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
title7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
title7.Name = "title_empty";
title7.Position.Auto = false;
title7.Position.Height = 8F;
title7.Position.Width = 60F;
title7.Position.X = 20F;
title7.Position.Y = 20F;
title7.Text = "no data to preview";
title8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
title8.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(128)))));
title8.BorderWidth = 2;
title8.DockedToChartArea = "chArea_time";
title8.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
title8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
title8.Name = "title_emptyBottom";
title8.Position.Auto = false;
title8.Position.Height = 8F;
title8.Position.Width = 60F;
title8.Position.X = 20F;
title8.Position.Y = 70F;
title8.Text = "no data to preview";
this.chart.Titles.Add(title7);
this.chart.Titles.Add(title8);
//
// bt_start
//
this.bt_start.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.bt_start.ForeColor = System.Drawing.Color.Green;
this.bt_start.Location = new System.Drawing.Point(236, 88);
this.bt_start.Margin = new System.Windows.Forms.Padding(4);
this.bt_start.Name = "bt_start";
this.bt_start.Size = new System.Drawing.Size(81, 39);
this.bt_start.TabIndex = 9;
this.bt_start.Text = "&Start";
this.bt_start.UseVisualStyleBackColor = true;
this.bt_start.Click += new System.EventHandler(this.bt_start_Click);
//
// bt_stop
//
this.bt_stop.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.bt_stop.ForeColor = System.Drawing.Color.Maroon;
this.bt_stop.Location = new System.Drawing.Point(147, 88);
this.bt_stop.Margin = new System.Windows.Forms.Padding(4);
this.bt_stop.Name = "bt_stop";
this.bt_stop.Size = new System.Drawing.Size(81, 39);
this.bt_stop.TabIndex = 10;
this.bt_stop.Text = "S&top";
this.bt_stop.UseVisualStyleBackColor = true;
this.bt_stop.Click += new System.EventHandler(this.bt_stop_Click);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1,
this.tslab_message});
this.statusStrip1.Location = new System.Drawing.Point(0, 643);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0);
this.statusStrip1.Size = new System.Drawing.Size(994, 22);
this.statusStrip1.TabIndex = 16;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(115, 17);
this.toolStripStatusLabel1.Text = "Measuring message:";
//
// tslab_message
//
this.tslab_message.Name = "tslab_message";
this.tslab_message.Size = new System.Drawing.Size(29, 17);
this.tslab_message.Text = "N/A";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label7.Location = new System.Drawing.Point(235, 82);
this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(60, 16);
this.label7.TabIndex = 10;
this.label7.Text = "[ °C/min ]";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label6.Location = new System.Drawing.Point(235, 52);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(35, 16);
this.label6.TabIndex = 9;
this.label6.Text = "[ °C ]";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label5.Location = new System.Drawing.Point(235, 22);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 16);
this.label5.TabIndex = 8;
this.label5.Text = "[ °C ]";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label4.Location = new System.Drawing.Point(96, 82);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(47, 16);
this.label4.TabIndex = 7;
this.label4.Text = "Slope:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label3.Location = new System.Drawing.Point(29, 52);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(114, 16);
this.label3.TabIndex = 5;
this.label3.Text = "Stop temperature:";
//
// tBox_tempStart
//
this.tBox_tempStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.tBox_tempStart.Location = new System.Drawing.Point(151, 19);
this.tBox_tempStart.Margin = new System.Windows.Forms.Padding(4);
this.tBox_tempStart.Name = "tBox_tempStart";
this.tBox_tempStart.Size = new System.Drawing.Size(76, 22);
this.tBox_tempStart.TabIndex = 2;
this.tBox_tempStart.Text = "20";
this.tBox_tempStart.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tBox_tempStart.TextChanged += new System.EventHandler(this.tBox_tempStart_TextChanged);
this.tBox_tempStart.Validating += new System.ComponentModel.CancelEventHandler(this.tBox_tempStart_Validating);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(30, 22);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(113, 16);
this.label2.TabIndex = 3;
this.label2.Text = "Start temperature:";
//
// tBox_slope
//
this.tBox_slope.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.tBox_slope.Location = new System.Drawing.Point(151, 79);
this.tBox_slope.Margin = new System.Windows.Forms.Padding(4);
this.tBox_slope.Name = "tBox_slope";
this.tBox_slope.Size = new System.Drawing.Size(76, 22);
this.tBox_slope.TabIndex = 4;
this.tBox_slope.Text = "2";
this.tBox_slope.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tBox_slope.TextChanged += new System.EventHandler(this.tBox_slope_TextChanged);
this.tBox_slope.Validating += new System.ComponentModel.CancelEventHandler(this.tBox_slope_Validating);
//
// tBox_tempStop
//
this.tBox_tempStop.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.tBox_tempStop.Location = new System.Drawing.Point(151, 49);
this.tBox_tempStop.Margin = new System.Windows.Forms.Padding(4);
this.tBox_tempStop.Name = "tBox_tempStop";
this.tBox_tempStop.Size = new System.Drawing.Size(76, 22);
this.tBox_tempStop.TabIndex = 3;
this.tBox_tempStop.Text = "70";
this.tBox_tempStop.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tBox_tempStop.TextChanged += new System.EventHandler(this.tBox_tempStop_TextChanged);
this.tBox_tempStop.Validating += new System.ComponentModel.CancelEventHandler(this.tBox_tempStop_Validating);
//
// gBox_settings
//
this.gBox_settings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.gBox_settings.Controls.Add(this.lab_time);
this.gBox_settings.Controls.Add(this.label8);
this.gBox_settings.Controls.Add(this.lab_lock);
this.gBox_settings.Controls.Add(this.tBox_tempStop);
this.gBox_settings.Controls.Add(this.tBox_slope);
this.gBox_settings.Controls.Add(this.label2);
this.gBox_settings.Controls.Add(this.tBox_tempStart);
this.gBox_settings.Controls.Add(this.label3);
this.gBox_settings.Controls.Add(this.label4);
this.gBox_settings.Controls.Add(this.label5);
this.gBox_settings.Controls.Add(this.label6);
this.gBox_settings.Controls.Add(this.label7);
this.gBox_settings.Location = new System.Drawing.Point(649, 248);
this.gBox_settings.Name = "gBox_settings";
this.gBox_settings.Size = new System.Drawing.Size(335, 166);
this.gBox_settings.TabIndex = 21;
this.gBox_settings.TabStop = false;
this.gBox_settings.Text = "Settings";
//
// lab_time
//
this.lab_time.BackColor = System.Drawing.Color.OldLace;
this.lab_time.Location = new System.Drawing.Point(151, 113);
this.lab_time.Name = "lab_time";
this.lab_time.Size = new System.Drawing.Size(128, 26);
this.lab_time.TabIndex = 27;
this.lab_time.Text = "25min";
this.lab_time.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label8.Location = new System.Drawing.Point(44, 118);
this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(99, 16);
this.label8.TabIndex = 26;
this.label8.Text = "Estimated time:";
//
// lab_lock
//
this.lab_lock.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.lab_lock.Image = global::ProfileCon.Properties.Resources.lock_small;
this.lab_lock.Location = new System.Drawing.Point(309, 18);
this.lab_lock.Name = "lab_lock";
this.lab_lock.Size = new System.Drawing.Size(20, 20);
this.lab_lock.TabIndex = 25;
this.lab_lock.Visible = false;
//
// gBox_measuring
//
this.gBox_measuring.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.gBox_measuring.Controls.Add(this.label15);
this.gBox_measuring.Controls.Add(this.label1);
this.gBox_measuring.Controls.Add(this.lab_measureState);
this.gBox_measuring.Controls.Add(this.pBar_starting);
this.gBox_measuring.Controls.Add(this.pBar_measuring);
this.gBox_measuring.Controls.Add(this.bt_start);
this.gBox_measuring.Controls.Add(this.bt_stop);
this.gBox_measuring.Enabled = false;
this.gBox_measuring.Location = new System.Drawing.Point(649, 420);
this.gBox_measuring.Name = "gBox_measuring";
this.gBox_measuring.Size = new System.Drawing.Size(335, 145);
this.gBox_measuring.TabIndex = 26;
this.gBox_measuring.TabStop = false;
this.gBox_measuring.Text = "Measuring";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label15.Location = new System.Drawing.Point(14, 54);
this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(71, 16);
this.label15.TabIndex = 26;
this.label15.Text = "Measuring";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(32, 35);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 16);
this.label1.TabIndex = 25;
this.label1.Text = "Starting";
//
// lab_measureState
//
this.lab_measureState.BackColor = System.Drawing.Color.OldLace;
this.lab_measureState.Location = new System.Drawing.Point(29, 88);
this.lab_measureState.Name = "lab_measureState";
this.lab_measureState.Size = new System.Drawing.Size(87, 39);
this.lab_measureState.TabIndex = 4;
this.lab_measureState.Text = "N/A";
this.lab_measureState.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// pBar_starting
//
this.pBar_starting.Location = new System.Drawing.Point(92, 38);
this.pBar_starting.Name = "pBar_starting";
this.pBar_starting.Size = new System.Drawing.Size(225, 13);
this.pBar_starting.TabIndex = 12;
//
// pBar_measuring
//
this.pBar_measuring.Location = new System.Drawing.Point(92, 57);
this.pBar_measuring.Name = "pBar_measuring";
this.pBar_measuring.Size = new System.Drawing.Size(226, 13);
this.pBar_measuring.TabIndex = 11;
//
// tabControl1
//
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Controls.Add(this.tabPage_chart);
this.tabControl1.Controls.Add(this.tabPage_data);
this.tabControl1.Location = new System.Drawing.Point(0, -1);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(643, 641);
this.tabControl1.TabIndex = 27;
//
// tabPage_chart
//
this.tabPage_chart.BackColor = System.Drawing.SystemColors.Control;
this.tabPage_chart.Controls.Add(this.chBox_bottom);
this.tabPage_chart.Controls.Add(this.chBox_upper);
this.tabPage_chart.Controls.Add(this.bt_zoomOutBottom);
this.tabPage_chart.Controls.Add(this.chart);
this.tabPage_chart.Controls.Add(this.bt_zoomOutUpper);
this.tabPage_chart.Location = new System.Drawing.Point(4, 25);
this.tabPage_chart.Name = "tabPage_chart";
this.tabPage_chart.Padding = new System.Windows.Forms.Padding(3);
this.tabPage_chart.Size = new System.Drawing.Size(635, 612);
this.tabPage_chart.TabIndex = 0;
this.tabPage_chart.Text = "Graph";
//
// chBox_bottom
//
this.chBox_bottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom |
System.Windows.Forms.AnchorStyles.Right)));
this.chBox_bottom.BackColor = System.Drawing.Color.OldLace;
this.chBox_bottom.Checked = true;
this.chBox_bottom.CheckState = System.Windows.Forms.CheckState.Checked;
this.chBox_bottom.Location = new System.Drawing.Point(458, 565);
this.chBox_bottom.Name = "chBox_bottom";
this.chBox_bottom.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.chBox_bottom.Size = new System.Drawing.Size(177, 39);
this.chBox_bottom.TabIndex = 35;
this.chBox_bottom.Text = "Temperature / Time";
this.chBox_bottom.UseVisualStyleBackColor = false;
this.chBox_bottom.CheckedChanged += new System.EventHandler(this.chBox_bottom_CheckedChanged);
//
// chBox_upper
//
this.chBox_upper.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom |
System.Windows.Forms.AnchorStyles.Right)));
this.chBox_upper.BackColor = System.Drawing.Color.OldLace;
this.chBox_upper.Checked = true;
this.chBox_upper.CheckState = System.Windows.Forms.CheckState.Checked;
this.chBox_upper.Location = new System.Drawing.Point(241, 565);
this.chBox_upper.Name = "chBox_upper";
this.chBox_upper.Padding = new System.Windows.Forms.Padding(10, 0, 0, 0);
this.chBox_upper.Size = new System.Drawing.Size(211, 39);
this.chBox_upper.TabIndex = 34;
this.chBox_upper.Text = "Conductivity / Temperature";
this.chBox_upper.UseVisualStyleBackColor = false;
this.chBox_upper.CheckedChanged += new System.EventHandler(this.chBox_upper_CheckedChanged);
//
// bt_zoomOutBottom
//
this.bt_zoomOutBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom |
System.Windows.Forms.AnchorStyles.Left)));
this.bt_zoomOutBottom.Location = new System.Drawing.Point(130, 561);
this.bt_zoomOutBottom.Name = "bt_zoomOutBottom";
this.bt_zoomOutBottom.Size = new System.Drawing.Size(103, 45);
this.bt_zoomOutBottom.TabIndex = 33;
this.bt_zoomOutBottom.Text = "Zoom Out \r\nTemp / Time";
this.bt_zoomOutBottom.UseVisualStyleBackColor = true;
this.bt_zoomOutBottom.Click += new System.EventHandler(this.bt_zoomOutBottom_Click);
//
// bt_zoomOutUpper
//
this.bt_zoomOutUpper.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom |
System.Windows.Forms.AnchorStyles.Left)));
this.bt_zoomOutUpper.Location = new System.Drawing.Point(3, 561);
this.bt_zoomOutUpper.Name = "bt_zoomOutUpper";
this.bt_zoomOutUpper.Size = new System.Drawing.Size(121, 45);
this.bt_zoomOutUpper.TabIndex = 32;
this.bt_zoomOutUpper.Text = "Zoom Out\r\nConduct / Temp";
this.bt_zoomOutUpper.UseVisualStyleBackColor = true;
this.bt_zoomOutUpper.Click += new System.EventHandler(this.bt_zoomOutUpper_Click);
//
// tabPage_data
//
this.tabPage_data.Controls.Add(this.dGrid);
this.tabPage_data.Location = new System.Drawing.Point(4, 25);
this.tabPage_data.Name = "tabPage_data";
this.tabPage_data.Padding = new System.Windows.Forms.Padding(3);
this.tabPage_data.Size = new System.Drawing.Size(635, 612);
this.tabPage_data.TabIndex = 1;
this.tabPage_data.Text = "Data";
this.tabPage_data.UseVisualStyleBackColor = true;
//
// dGrid
//
this.dGrid.AllowUserToAddRows = false;
this.dGrid.AllowUserToDeleteRows = false;
this.dGrid.AllowUserToResizeColumns = false;
this.dGrid.AllowUserToResizeRows = false;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.dGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4;
this.dGrid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.ColumnHeader;
this.dGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.dGrid.Location = new System.Drawing.Point(3, 3);
this.dGrid.MultiSelect = false;
this.dGrid.Name = "dGrid";
this.dGrid.ReadOnly = true;
this.dGrid.RowHeadersVisible = false;
this.dGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dGrid.Size = new System.Drawing.Size(629, 606);
this.dGrid.TabIndex = 0;
//
// imList_status
//
this.imList_status.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imList_status.ImageStream")));
this.imList_status.TransparentColor = System.Drawing.Color.Transparent;
this.imList_status.Images.SetKeyName(0, "lg-alertO-shadow.png");
this.imList_status.Images.SetKeyName(1, "lg-alertY-shadow.png");
this.imList_status.Images.SetKeyName(2, "lg-failed-shadow.png");
this.imList_status.Images.SetKeyName(3, "lg-info-shadow.png");
this.imList_status.Images.SetKeyName(4, "lg-success-shadow.png");
//
// gBox_experiment
//
this.gBox_experiment.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.gBox_experiment.Controls.Add(this.bt_export);
this.gBox_experiment.Controls.Add(this.bt_import);
this.gBox_experiment.Location = new System.Drawing.Point(649, 571);
this.gBox_experiment.Name = "gBox_experiment";
this.gBox_experiment.Size = new System.Drawing.Size(335, 69);
this.gBox_experiment.TabIndex = 28;
this.gBox_experiment.TabStop = false;
this.gBox_experiment.Text = "Data";
//
// bt_export
//
this.bt_export.Location = new System.Drawing.Point(20, 21);
this.bt_export.Name = "bt_export";
this.bt_export.Size = new System.Drawing.Size(145, 34);
this.bt_export.TabIndex = 22;
this.bt_export.Text = "Export";
this.bt_export.UseVisualStyleBackColor = true;
this.bt_export.Click += new System.EventHandler(this.bt_export_Click);
//
// bt_import
//
this.bt_import.Location = new System.Drawing.Point(173, 21);
this.bt_import.Name = "bt_import";
this.bt_import.Size = new System.Drawing.Size(144, 34);
this.bt_import.TabIndex = 23;
this.bt_import.Text = "&Load";
this.bt_import.UseVisualStyleBackColor = true;
this.bt_import.Click += new System.EventHandler(this.bt_import_Click);
//
// gBox_devices
//
this.gBox_devices.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.gBox_devices.Controls.Add(this.lab_trError);
this.gBox_devices.Controls.Add(this.lab_xbcRefr);
this.gBox_devices.Controls.Add(this.lab_trRefr);
this.gBox_devices.Controls.Add(this.lab_xbcName);
this.gBox_devices.Controls.Add(this.lab_trName);
this.gBox_devices.Controls.Add(this.lab_labXbcTemp);
this.gBox_devices.Controls.Add(this.lab_labXbcCond);
this.gBox_devices.Controls.Add(this.lab_xbcConduct);
this.gBox_devices.Controls.Add(this.lab_XBCEnableState);
this.gBox_devices.Controls.Add(this.lab_xbcTemp);
this.gBox_devices.Controls.Add(this.label14);
this.gBox_devices.Controls.Add(this.lab_labTrReg);
this.gBox_devices.Controls.Add(this.lab_labTrTemp);
this.gBox_devices.Controls.Add(this.lab_trState);
this.gBox_devices.Controls.Add(this.lab_TREnableState);
this.gBox_devices.Controls.Add(this.lab_trTemp);
this.gBox_devices.Controls.Add(this.label13);
this.gBox_devices.Location = new System.Drawing.Point(649, 24);
this.gBox_devices.Name = "gBox_devices";
this.gBox_devices.Size = new System.Drawing.Size(335, 218);
this.gBox_devices.TabIndex = 29;
this.gBox_devices.TabStop = false;
this.gBox_devices.Text = "Devices";
//
// lab_trError
//
this.lab_trError.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.lab_trError.Image = global::ProfileCon.Properties.Resources.error;
this.lab_trError.Location = new System.Drawing.Point(299, 65);
this.lab_trError.Name = "lab_trError";
this.lab_trError.Size = new System.Drawing.Size(30, 32);
this.lab_trError.TabIndex = 28;
this.toolTip1.SetToolTip(this.lab_trError, "Thermoregulator Error");
this.lab_trError.Visible = false;
//
// lab_xbcRefr
//
this.lab_xbcRefr.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.lab_xbcRefr.ImageIndex = 1;
this.lab_xbcRefr.ImageList = this.imageList_reload;
this.lab_xbcRefr.Location = new System.Drawing.Point(298, 121);
this.lab_xbcRefr.Name = "lab_xbcRefr";
this.lab_xbcRefr.Size = new System.Drawing.Size(30, 30);
this.lab_xbcRefr.TabIndex = 27;
this.lab_xbcRefr.Click += new System.EventHandler(this.lab_XBCEnableState_Click);
//
// imageList_reload
//
this.imageList_reload.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList_reload.ImageStream")));
this.imageList_reload.TransparentColor = System.Drawing.Color.Transparent;
this.imageList_reload.Images.SetKeyName(0, "refresh_fat.png");
this.imageList_reload.Images.SetKeyName(1, "refresh_fat_gray.png");
//
// lab_trRefr
//
this.lab_trRefr.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Right)));
this.lab_trRefr.ImageIndex = 1;
this.lab_trRefr.ImageList = this.imageList_reload;
this.lab_trRefr.Location = new System.Drawing.Point(299, 23);
this.lab_trRefr.Name = "lab_trRefr";
this.lab_trRefr.Size = new System.Drawing.Size(30, 32);
this.lab_trRefr.TabIndex = 26;
this.lab_trRefr.Click += new System.EventHandler(this.lab_TREnableState_Click);
//
// lab_xbcName
//
this.lab_xbcName.AutoSize = true;
this.lab_xbcName.Location = new System.Drawing.Point(136, 125);
this.lab_xbcName.Name = "lab_xbcName";
this.lab_xbcName.Size = new System.Drawing.Size(31, 16);
this.lab_xbcName.TabIndex = 25;
this.lab_xbcName.Text = "N/A";
//
// lab_trName
//
this.lab_trName.AutoSize = true;
this.lab_trName.Location = new System.Drawing.Point(166, 27);
this.lab_trName.Name = "lab_trName";
this.lab_trName.Size = new System.Drawing.Size(31, 16);
this.lab_trName.TabIndex = 24;
this.lab_trName.Text = "N/A";
//
// lab_labXbcTemp
//
this.lab_labXbcTemp.AutoSize = true;
this.lab_labXbcTemp.Enabled = false;
this.lab_labXbcTemp.Location = new System.Drawing.Point(56, 182);
this.lab_labXbcTemp.Name = "lab_labXbcTemp";
this.lab_labXbcTemp.Size = new System.Drawing.Size(89, 16);
this.lab_labXbcTemp.TabIndex = 23;
this.lab_labXbcTemp.Text = "Temperature:";
//
// lab_labXbcCond
//
this.lab_labXbcCond.AutoSize = true;
this.lab_labXbcCond.Enabled = false;
this.lab_labXbcCond.Location = new System.Drawing.Point(56, 153);
this.lab_labXbcCond.Name = "lab_labXbcCond";
this.lab_labXbcCond.Size = new System.Drawing.Size(83, 16);
this.lab_labXbcCond.TabIndex = 22;
this.lab_labXbcCond.Text = "Conductivity:";
//
// lab_xbcConduct
//
this.lab_xbcConduct.BackColor = System.Drawing.Color.OldLace;
this.lab_xbcConduct.Enabled = false;
this.lab_xbcConduct.Location = new System.Drawing.Point(151, 148);
this.lab_xbcConduct.Name = "lab_xbcConduct";
this.lab_xbcConduct.Size = new System.Drawing.Size(128, 26);
this.lab_xbcConduct.TabIndex = 21;
this.lab_xbcConduct.Text = "N/A";
this.lab_xbcConduct.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lab_xbcConduct.Click += new System.EventHandler(this.labs_xbc_Click);
//
// lab_XBCEnableState
//
this.lab_XBCEnableState.ImageKey = "lg-failed-shadow.png";
this.lab_XBCEnableState.ImageList = this.imList_status;
this.lab_XBCEnableState.Location = new System.Drawing.Point(17, 121);
this.lab_XBCEnableState.Name = "lab_XBCEnableState";
this.lab_XBCEnableState.Size = new System.Drawing.Size(20, 20);
this.lab_XBCEnableState.TabIndex = 20;
this.lab_XBCEnableState.Click += new System.EventHandler(this.lab_XBCEnableState_Click);
//
// lab_xbcTemp
//
this.lab_xbcTemp.BackColor = System.Drawing.Color.OldLace;
this.lab_xbcTemp.Enabled = false;
this.lab_xbcTemp.Location = new System.Drawing.Point(151, 177);
this.lab_xbcTemp.Name = "lab_xbcTemp";
this.lab_xbcTemp.Size = new System.Drawing.Size(128, 26);
this.lab_xbcTemp.TabIndex = 19;
this.lab_xbcTemp.Text = "N/A";
this.lab_xbcTemp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lab_xbcTemp.Click += new System.EventHandler(this.labs_xbc_Click);
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(43, 125);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(87, 16);
this.label14.TabIndex = 18;
this.label14.Text = "Measure Unit";
//
// lab_labTrReg
//
this.lab_labTrReg.AutoSize = true;
this.lab_labTrReg.Enabled = false;
this.lab_labTrReg.Location = new System.Drawing.Point(56, 52);
this.lab_labTrReg.Name = "lab_labTrReg";
this.lab_labTrReg.Size = new System.Drawing.Size(76, 16);
this.lab_labTrReg.TabIndex = 17;
this.lab_labTrReg.Text = "Regulation:";
//
// lab_labTrTemp
//
this.lab_labTrTemp.AutoSize = true;
this.lab_labTrTemp.Enabled = false;
this.lab_labTrTemp.Location = new System.Drawing.Point(56, 85);
this.lab_labTrTemp.Name = "lab_labTrTemp";
this.lab_labTrTemp.Size = new System.Drawing.Size(89, 16);
this.lab_labTrTemp.TabIndex = 16;
this.lab_labTrTemp.Text = "Temperature:";
//
// lab_trState
//
this.lab_trState.BackColor = System.Drawing.Color.OldLace;
this.lab_trState.Enabled = false;
this.lab_trState.Location = new System.Drawing.Point(151, 47);
this.lab_trState.Name = "lab_trState";
this.lab_trState.Size = new System.Drawing.Size(128, 26);
this.lab_trState.TabIndex = 15;
this.lab_trState.Text = "N/A";
this.lab_trState.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lab_trState.Click += new System.EventHandler(this.labs_TRs_Click);
//
// lab_TREnableState
//
this.lab_TREnableState.ImageKey = "lg-failed-shadow.png";
this.lab_TREnableState.ImageList = this.imList_status;
this.lab_TREnableState.Location = new System.Drawing.Point(17, 23);
this.lab_TREnableState.Name = "lab_TREnableState";
this.lab_TREnableState.Size = new System.Drawing.Size(20, 20);
this.lab_TREnableState.TabIndex = 14;
this.lab_TREnableState.Click += new System.EventHandler(this.lab_TREnableState_Click);
//
// lab_trTemp
//
this.lab_trTemp.BackColor = System.Drawing.Color.OldLace;
this.lab_trTemp.Enabled = false;
this.lab_trTemp.Location = new System.Drawing.Point(151, 80);
this.lab_trTemp.Name = "lab_trTemp";
this.lab_trTemp.Size = new System.Drawing.Size(128, 26);
this.lab_trTemp.TabIndex = 13;
this.lab_trTemp.Text = "N/A";
this.lab_trTemp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lab_trTemp.Click += new System.EventHandler(this.labs_TRs_Click);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(43, 27);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(117, 16);
this.label13.TabIndex = 12;
this.label13.Text = "Thermo Regulator";
//
// oFDialog_experiment
//
this.oFDialog_experiment.FileName = "experiment";
//
// timer1
//
this.timer1.Interval = 300;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// timer2
//
this.timer2.Interval = 300;
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
//
// toolTip1
//
this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Warning;
//
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(994, 665);
this.Controls.Add(this.gBox_devices);
this.Controls.Add(this.gBox_experiment);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.gBox_measuring);
this.Controls.Add(this.gBox_settings);
this.Controls.Add(this.statusStrip1);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4);
this.MinimumSize = new System.Drawing.Size(1010, 650);
this.Name = "FormMain";
this.Text = "ProfileCon";
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.gBox_settings.ResumeLayout(false);
this.gBox_settings.PerformLayout();
this.gBox_measuring.ResumeLayout(false);
this.gBox_measuring.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage_chart.ResumeLayout(false);
this.tabPage_data.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dGrid)).EndInit();
this.gBox_experiment.ResumeLayout(false);
this.gBox_devices.ResumeLayout(false);
this.gBox_devices.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.DataVisualization.Charting.Chart chart;
private System.Windows.Forms.Button bt_start;
private System.Windows.Forms.Button bt_stop;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox tBox_tempStart;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox tBox_slope;
private System.Windows.Forms.TextBox tBox_tempStop;
private System.Windows.Forms.GroupBox gBox_settings;
private System.Windows.Forms.GroupBox gBox_measuring;
private System.Windows.Forms.ProgressBar pBar_starting;
private System.Windows.Forms.ProgressBar pBar_measuring;
private System.Windows.Forms.Label lab_measureState;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage_chart;
private System.Windows.Forms.TabPage tabPage_data;
private System.Windows.Forms.DataGridView dGrid;
private System.Windows.Forms.ImageList imList_status;
private System.Windows.Forms.GroupBox gBox_experiment;
private System.Windows.Forms.Button bt_export;
private System.Windows.Forms.GroupBox gBox_devices;
private System.Windows.Forms.Label lab_labTrReg;
private System.Windows.Forms.Label lab_labTrTemp;
private System.Windows.Forms.Label lab_trState;
private System.Windows.Forms.Label lab_TREnableState;
private System.Windows.Forms.Label lab_trTemp;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label lab_labXbcTemp;
private System.Windows.Forms.Label lab_labXbcCond;
private System.Windows.Forms.Label lab_xbcConduct;
private System.Windows.Forms.Label lab_XBCEnableState;
private System.Windows.Forms.Label lab_xbcTemp;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label lab_xbcName;
private System.Windows.Forms.Label lab_trName;
private System.Windows.Forms.OpenFileDialog oFDialog_experiment;
private System.Windows.Forms.Button bt_zoomOutUpper;
private System.Windows.Forms.Button bt_zoomOutBottom;
private System.Windows.Forms.CheckBox chBox_bottom;
private System.Windows.Forms.CheckBox chBox_upper;
private System.Windows.Forms.Button bt_import;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripStatusLabel tslab_message;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lab_lock;
private System.Windows.Forms.Label lab_trRefr;
private System.Windows.Forms.Label lab_xbcRefr;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Timer timer2;
private System.Windows.Forms.ImageList imageList_reload;
private System.Windows.Forms.Label lab_time;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label lab_trError;
private System.Windows.Forms.ToolTip toolTip1;
}
}
AdvanceMeasure.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;
using System.Data;
using ProfileCon.Devices;
using ProfileCon.Data;
namespace ProfileCon.Measuring
{
public enum MeasureState {Unavailable, Ready, Starting, Measuring, Stopping, Finished, FinnishedError }
delegate void OnDeviceState(object sender, bool enabled);
delegate void MeasureMessage(string message);
delegate void OnMeasureState(MeasureState state);
delegate void OnNewData(MeasuredData data);
delegate void OnProgress(int percent);
class ExperimentMeasure
{
public const double MEASURE_PERIOD = 500;
public const double STOPPING_TIMEOUT = 60000;
public const double CORRECTION = 5;
public ExperimentMeasure(ThermoRegulator regulator, XBCDevice xbc)
{
XBC = xbc;
XBC.EnabledChanged += new EnabledChanged(Device_EnabledChanged);
TR = regulator;
TR.EnabledChanged += new EnabledChanged(Device_EnabledChanged);
RegulatorDevice TRDevice = new RegulatorDevice(regulator, xbc);
Starter = new ValueWatchSteady(TRDevice);
Starter.OnFinish += new ValueWatchFinish(Starter_OnFinish);
Starter.OnProgress += new OnValueCheck(Starter_OnProgress);
Logger = new AdvanceTimerPlus();
Logger.OnAction += new DoAction(Logger_OnAction);
Logger.OnFinish += new ActionFinish(Logger_OnFinish);
Data = DataStructure.GetEmptyDataTable();
Info = new ExperimentInfo();
}
// ======================================================
// Events
//
public event OnDeviceState EnabledChanged;
public event OnDeviceState IsMeasuringChanged;
public event OnMeasureState MeasureStateChanged;
public event MeasureMessage NewMessage;
public event OnNewData NewMeasuredData;
public event OnProgress StartingProgressChanged;
public event OnProgress MeasureProgressChanged;
// ======================================================
// Members
//
ThermoRegulator TR;
XBCDevice XBC;
ValueWatchSteady Starter;
AdvanceTimerPlus Logger;
// ======================================================
// Properties
//
private bool _Enabled = false;
public bool Enabled
{
get { return _Enabled; }
private set
{
_Enabled = value;
if (EnabledChanged != null) EnabledChanged(this, value);
if (value)
MeasureState = MeasureState.Ready;
}
}
private bool _IsMeasuring = false;
public bool IsMeasuring
{
get { return _IsMeasuring; }
private set
{
_IsMeasuring = value;
if (IsMeasuringChanged != null) IsMeasuringChanged(this, value);
}
}
private MeasureState _MeasureState = MeasureState.Unavailable;
public MeasureState MeasureState
{
get { return _MeasureState; }
private set
{
_MeasureState = value;
if (MeasureStateChanged != null) MeasureStateChanged(value);
}
}
public DataTable Data { get; private set; }
public ExperimentSetting Setting { get; private set; }
public ExperimentInfo Info { get; private set; }
// ======================================================
// Methods
//
void Device_EnabledChanged(Device device, bool state)
{
bool newState = (TR.Enabled && XBC.Enabled);
if (Enabled != newState)
{
Enabled = newState;
InvokeMessage("Measuring " + (Enabled ? "enabled" : "disabled"));
}
if (IsMeasuring && !state)
Stop();
}
#region StartExperiment
// ------------------------------------// Starter
public void Start(ExperimentSetting setting)
{
Setting = setting;
Data.Clear();
Starter.StartWatch(Setting.StartTemperature, Setting.StartTimeout, Setting.SteadyTimeout);
IsMeasuring = true;
MeasureState = MeasureState.Starting;
InvokeMessage("Starting process started");
InvokeStartingPercent(0);
InvokeMeasurePercent(0);
}
void Starter_OnFinish(WatchFinishResult result)
{
InvokeMessage("Starter finished.");
switch (result)
{
case WatchFinishResult.Setted:
string s = Config.GetKeyValue("EXPERIMENT", "TemperatureOvershoot");
double d = 0;
if (!double.TryParse(s, out d))
{
d = CORRECTION;
Log.AddLog("Used default TemperatureOvershoot: " + d.ToString());
}
double correctedTemperature = Setting.TargetTemperature + d;
TimeSpan correcedTime = TimeSpan.FromMinutes((correctedTemperature - Setting.StartTemperature) / Setting.Slope);
TR.StartRegulateWithSlope(correctedTemperature, correcedTime);
RunLogging();
break;
case WatchFinishResult.Timeout:
FinishExperiment("Experiment couldn't start - Unable to reach start temperature");
break;
case WatchFinishResult.Aborted:
FinishExperiment("Experiment aborted - Starting process finished");
break;
case WatchFinishResult.Error:
FinishExperiment("Experiment couldn't start - Starting process end with error");
break;
}
}
void Starter_OnProgress(int percent)
{
InvokeStartingPercent(percent);
}
// ------------------------------------// Logger
private void RunLogging()
{
Logger.StartRising(TimeSpan.FromMilliseconds(MEASURE_PERIOD));
MeasureState = MeasureState.Measuring;
InvokeMessage("Measure started");
}
void Logger_OnAction(TimeSpan time)
{
TR.Refresh();
XBC.Refresh();
double trTemp = Math.Round(TR.Temperature, 2, MidpointRounding.AwayFromZero);
double xbcTemp = Math.Round(XBC.XB1EProbe.Temperature, 2, MidpointRounding.AwayFromZero);
double xbcConduct = Math.Round(XBC.XB1EProbe.Conductivity, 2, MidpointRounding.AwayFromZero);
DataRow row = DataStructure.GetFilledDataRow(Data, time, trTemp, xbcTemp, xbcConduct);
Data.Rows.Add(row);
if (NewMeasuredData != null) NewMeasuredData(new MeasuredData(time.TotalSeconds, trTemp, xbcTemp, xbcConduct));
if (trTemp > Setting.TargetTemperature)
Logger.Finish();
else
{
double percent = ((trTemp - Setting.StartTemperature) / (Setting.TargetTemperature - Setting.StartTemperature)) * 100;
if (percent < 0)
percent = 0;
InvokeMeasurePercent((int)percent);
}
}
void Logger_OnFinish(ValueStoreResult result)
{
InvokeMessage("Measure finished.");
TR.StopRegulate();
Info = new ExperimentInfo(Logger._MeasureStart, DateTime.Now - Logger._MeasureStart);
string message = string.Empty;
switch (result)
{
case ValueStoreResult.Done:
message = "Experiment DONE";
InvokeMeasurePercent(100);
TR.StartRegulate(Setting.StartTemperature);
// RunAnalyze
break;
case ValueStoreResult.Aborted:
message = "Experiment stopped by user - data could be incomplete";
break;
case ValueStoreResult.Error:
message = "Experiment finish during measuring with error";
break;
}
FinishExperiment(message);
}
private void FinishExperiment(string message)
{
InvokeStartingPercent(0);
InvokeMeasurePercent(0);
MeasureState = MeasureState.Finished;
InvokeMessage(message);
IsMeasuring = false;
}
#endregion
#region StopExperiment
public void Stop()
{
StopStartingProcess();
StopMeasuring();
}
public void ForcedStop()
{
StopStartingProcess();
StopMeasuring();
}
private void StopStartingProcess()
{
if (Starter.IsRunnig)
{
Starter.CancelWatch();
InvokeMessage("Starting process aborted");
}
}
private void StopMeasuring()
{
if (Logger.IsRunnig)
{
Logger.CancelRising();
InvokeMessage("Measuring aborted");
}
}
#endregion
private void InvokeMessage(string message)
{
if (NewMessage != null) NewMessage(message);
}
private void InvokeStartingPercent(int percent)
{
if (StartingProgressChanged != null) StartingProgressChanged(percent);
}
private void InvokeMeasurePercent(int percent)
{
if (MeasureProgressChanged != null) MeasureProgressChanged(percent);
}
}
class RegulatorDevice : IWatchDevice
{
public RegulatorDevice(ThermoRegulator regulator, XBCDevice xbc)
{
Regulator = regulator;
Xbc = xbc;
}
ThermoRegulator Regulator;
XBCDevice Xbc;
public void SetValue(double value)
{
Regulator.StartRegulate(value);
}
public double GetActualValue()
{
Xbc.Refresh();
Regulator.Refresh();
return Regulator.Temperature;
}
}
}
Download