Empfang eingebaut und Programm verbessert
This commit is contained in:
Binary file not shown.
@@ -11,13 +11,13 @@
|
||||
<userSettings>
|
||||
<Laminator_GUI.Properties.Settings>
|
||||
<setting name="Default_Temp" serializeAs="String">
|
||||
<value>32</value>
|
||||
<value>25</value>
|
||||
</setting>
|
||||
<setting name="Default_Motor" serializeAs="String">
|
||||
<value>10</value>
|
||||
<value>20</value>
|
||||
</setting>
|
||||
<setting name="Com_Port" serializeAs="String">
|
||||
<value>COM7</value>
|
||||
<value>COM9</value>
|
||||
</setting>
|
||||
<setting name="Chart_Items" serializeAs="String">
|
||||
<value>1000</value>
|
||||
|
||||
+218
-182
@@ -28,211 +28,244 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.Temp = new System.Windows.Forms.Label();
|
||||
this.chart = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
this.debug = new System.Windows.Forms.Label();
|
||||
this.heater = new System.Windows.Forms.Label();
|
||||
this.motor = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.tempbox = new System.Windows.Forms.NumericUpDown();
|
||||
this.motorbox = new System.Windows.Forms.NumericUpDown();
|
||||
this.heizungSoll = new System.Windows.Forms.Label();
|
||||
this.motorSoll = new System.Windows.Forms.Label();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tempbox)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.motorbox)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(61, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Temperatur";
|
||||
//
|
||||
// Temp
|
||||
//
|
||||
this.Temp.AutoSize = true;
|
||||
this.Temp.Font = new System.Drawing.Font("Microsoft Sans Serif", 72F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Temp.ForeColor = System.Drawing.Color.Red;
|
||||
this.Temp.Location = new System.Drawing.Point(12, 22);
|
||||
this.Temp.Name = "Temp";
|
||||
this.Temp.Size = new System.Drawing.Size(208, 108);
|
||||
this.Temp.TabIndex = 1;
|
||||
this.Temp.Text = "0°C";
|
||||
//
|
||||
// chart
|
||||
//
|
||||
chartArea1.Name = "ChartArea1";
|
||||
this.chart.ChartAreas.Add(chartArea1);
|
||||
this.chart.Location = new System.Drawing.Point(13, 134);
|
||||
this.chart.Name = "chart";
|
||||
series1.ChartArea = "ChartArea1";
|
||||
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
|
||||
series1.Color = System.Drawing.Color.Red;
|
||||
series1.IsVisibleInLegend = false;
|
||||
series1.Name = "Temp";
|
||||
series2.ChartArea = "ChartArea1";
|
||||
series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
|
||||
series2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
series2.Name = "Motor";
|
||||
series3.ChartArea = "ChartArea1";
|
||||
series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
|
||||
series3.Color = System.Drawing.Color.Blue;
|
||||
series3.Name = "Heizung";
|
||||
this.chart.Series.Add(series1);
|
||||
this.chart.Series.Add(series2);
|
||||
this.chart.Series.Add(series3);
|
||||
this.chart.Size = new System.Drawing.Size(359, 122);
|
||||
this.chart.TabIndex = 2;
|
||||
this.chart.Text = "chart1";
|
||||
//
|
||||
// debug
|
||||
//
|
||||
this.debug.AutoSize = true;
|
||||
this.debug.Location = new System.Drawing.Point(258, 9);
|
||||
this.debug.Name = "debug";
|
||||
this.debug.Size = new System.Drawing.Size(35, 13);
|
||||
this.debug.TabIndex = 3;
|
||||
this.debug.Text = "label2";
|
||||
//
|
||||
// heater
|
||||
//
|
||||
this.heater.AutoSize = true;
|
||||
this.heater.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F, System.Drawing.FontStyle.Bold);
|
||||
this.heater.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
this.heater.Location = new System.Drawing.Point(256, 23);
|
||||
this.heater.Name = "heater";
|
||||
this.heater.Size = new System.Drawing.Size(82, 22);
|
||||
this.heater.TabIndex = 4;
|
||||
this.heater.Text = "Heizung";
|
||||
//
|
||||
// motor
|
||||
//
|
||||
this.motor.AutoSize = true;
|
||||
this.motor.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F, System.Drawing.FontStyle.Bold);
|
||||
this.motor.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
this.motor.Location = new System.Drawing.Point(256, 48);
|
||||
this.motor.Name = "motor";
|
||||
this.motor.Size = new System.Drawing.Size(60, 22);
|
||||
this.motor.TabIndex = 5;
|
||||
this.motor.Text = "Motor";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(322, 76);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(50, 47);
|
||||
this.button1.TabIndex = 8;
|
||||
this.button1.Text = "OK";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// tempbox
|
||||
//
|
||||
this.tempbox.Location = new System.Drawing.Point(261, 77);
|
||||
this.tempbox.Maximum = new decimal(new int[] {
|
||||
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.Temp = new System.Windows.Forms.Label();
|
||||
this.chart = new System.Windows.Forms.DataVisualization.Charting.Chart();
|
||||
this.debug = new System.Windows.Forms.Label();
|
||||
this.heater = new System.Windows.Forms.Label();
|
||||
this.motor = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.tempbox = new System.Windows.Forms.NumericUpDown();
|
||||
this.motorbox = new System.Windows.Forms.NumericUpDown();
|
||||
this.heizungSoll = new System.Windows.Forms.Label();
|
||||
this.motorSoll = new System.Windows.Forms.Label();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.Temp1 = new System.Windows.Forms.Label();
|
||||
this.Temp2 = new System.Windows.Forms.Label();
|
||||
this.TempDiff = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tempbox)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.motorbox)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(12, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(61, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "Temperatur";
|
||||
//
|
||||
// Temp
|
||||
//
|
||||
this.Temp.AutoSize = true;
|
||||
this.Temp.Font = new System.Drawing.Font("Microsoft Sans Serif", 65F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Temp.ForeColor = System.Drawing.Color.Red;
|
||||
this.Temp.Location = new System.Drawing.Point(12, 22);
|
||||
this.Temp.Name = "Temp";
|
||||
this.Temp.Size = new System.Drawing.Size(191, 98);
|
||||
this.Temp.TabIndex = 1;
|
||||
this.Temp.Text = "0°C";
|
||||
//
|
||||
// chart
|
||||
//
|
||||
chartArea2.Name = "ChartArea1";
|
||||
this.chart.ChartAreas.Add(chartArea2);
|
||||
this.chart.Location = new System.Drawing.Point(12, 155);
|
||||
this.chart.Name = "chart";
|
||||
series4.ChartArea = "ChartArea1";
|
||||
series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
|
||||
series4.Color = System.Drawing.Color.Red;
|
||||
series4.IsVisibleInLegend = false;
|
||||
series4.Name = "Temp";
|
||||
series5.ChartArea = "ChartArea1";
|
||||
series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
|
||||
series5.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
series5.Name = "Motor";
|
||||
series6.ChartArea = "ChartArea1";
|
||||
series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
|
||||
series6.Color = System.Drawing.Color.Blue;
|
||||
series6.Name = "Heizung";
|
||||
this.chart.Series.Add(series4);
|
||||
this.chart.Series.Add(series5);
|
||||
this.chart.Series.Add(series6);
|
||||
this.chart.Size = new System.Drawing.Size(459, 122);
|
||||
this.chart.TabIndex = 2;
|
||||
this.chart.Text = "chart1";
|
||||
//
|
||||
// debug
|
||||
//
|
||||
this.debug.AutoSize = true;
|
||||
this.debug.Location = new System.Drawing.Point(10, 280);
|
||||
this.debug.Name = "debug";
|
||||
this.debug.Size = new System.Drawing.Size(35, 13);
|
||||
this.debug.TabIndex = 3;
|
||||
this.debug.Text = "label2";
|
||||
//
|
||||
// heater
|
||||
//
|
||||
this.heater.AutoSize = true;
|
||||
this.heater.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F, System.Drawing.FontStyle.Bold);
|
||||
this.heater.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
this.heater.Location = new System.Drawing.Point(357, 22);
|
||||
this.heater.Name = "heater";
|
||||
this.heater.Size = new System.Drawing.Size(82, 22);
|
||||
this.heater.TabIndex = 4;
|
||||
this.heater.Text = "Heizung";
|
||||
//
|
||||
// motor
|
||||
//
|
||||
this.motor.AutoSize = true;
|
||||
this.motor.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F, System.Drawing.FontStyle.Bold);
|
||||
this.motor.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
|
||||
this.motor.Location = new System.Drawing.Point(357, 47);
|
||||
this.motor.Name = "motor";
|
||||
this.motor.Size = new System.Drawing.Size(60, 22);
|
||||
this.motor.TabIndex = 5;
|
||||
this.motor.Text = "Motor";
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(423, 75);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(50, 47);
|
||||
this.button1.TabIndex = 8;
|
||||
this.button1.Text = "OK";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// tempbox
|
||||
//
|
||||
this.tempbox.Location = new System.Drawing.Point(362, 76);
|
||||
this.tempbox.Maximum = new decimal(new int[] {
|
||||
250,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.tempbox.Minimum = new decimal(new int[] {
|
||||
this.tempbox.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.tempbox.Name = "tempbox";
|
||||
this.tempbox.Size = new System.Drawing.Size(55, 20);
|
||||
this.tempbox.TabIndex = 9;
|
||||
this.tempbox.Value = new decimal(new int[] {
|
||||
this.tempbox.Name = "tempbox";
|
||||
this.tempbox.Size = new System.Drawing.Size(55, 20);
|
||||
this.tempbox.TabIndex = 9;
|
||||
this.tempbox.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
//
|
||||
// motorbox
|
||||
//
|
||||
this.motorbox.Location = new System.Drawing.Point(261, 104);
|
||||
this.motorbox.Maximum = new decimal(new int[] {
|
||||
10,
|
||||
//
|
||||
// motorbox
|
||||
//
|
||||
this.motorbox.Location = new System.Drawing.Point(362, 103);
|
||||
this.motorbox.Maximum = new decimal(new int[] {
|
||||
20,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.motorbox.Minimum = new decimal(new int[] {
|
||||
this.motorbox.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
this.motorbox.Name = "motorbox";
|
||||
this.motorbox.Size = new System.Drawing.Size(55, 20);
|
||||
this.motorbox.TabIndex = 10;
|
||||
this.motorbox.Value = new decimal(new int[] {
|
||||
this.motorbox.Name = "motorbox";
|
||||
this.motorbox.Size = new System.Drawing.Size(55, 20);
|
||||
this.motorbox.TabIndex = 10;
|
||||
this.motorbox.Value = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-2147483648});
|
||||
//
|
||||
// heizungSoll
|
||||
//
|
||||
this.heizungSoll.AutoSize = true;
|
||||
this.heizungSoll.Location = new System.Drawing.Point(337, 32);
|
||||
this.heizungSoll.Name = "heizungSoll";
|
||||
this.heizungSoll.Size = new System.Drawing.Size(16, 13);
|
||||
this.heizungSoll.TabIndex = 11;
|
||||
this.heizungSoll.Text = "-1";
|
||||
//
|
||||
// motorSoll
|
||||
//
|
||||
this.motorSoll.AutoSize = true;
|
||||
this.motorSoll.Location = new System.Drawing.Point(337, 53);
|
||||
this.motorSoll.Name = "motorSoll";
|
||||
this.motorSoll.Size = new System.Drawing.Size(16, 13);
|
||||
this.motorSoll.TabIndex = 12;
|
||||
this.motorSoll.Text = "-1";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Location = new System.Drawing.Point(378, 12);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(94, 244);
|
||||
this.panel1.TabIndex = 13;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(484, 262);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.motorSoll);
|
||||
this.Controls.Add(this.heizungSoll);
|
||||
this.Controls.Add(this.motorbox);
|
||||
this.Controls.Add(this.tempbox);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.motor);
|
||||
this.Controls.Add(this.heater);
|
||||
this.Controls.Add(this.debug);
|
||||
this.Controls.Add(this.chart);
|
||||
this.Controls.Add(this.Temp);
|
||||
this.Controls.Add(this.label1);
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(500, 300);
|
||||
this.MinimumSize = new System.Drawing.Size(500, 300);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Laminator GUI";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.close);
|
||||
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tempbox)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.motorbox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
//
|
||||
// heizungSoll
|
||||
//
|
||||
this.heizungSoll.AutoSize = true;
|
||||
this.heizungSoll.Location = new System.Drawing.Point(438, 31);
|
||||
this.heizungSoll.Name = "heizungSoll";
|
||||
this.heizungSoll.Size = new System.Drawing.Size(16, 13);
|
||||
this.heizungSoll.TabIndex = 11;
|
||||
this.heizungSoll.Text = "-1";
|
||||
//
|
||||
// motorSoll
|
||||
//
|
||||
this.motorSoll.AutoSize = true;
|
||||
this.motorSoll.Location = new System.Drawing.Point(438, 52);
|
||||
this.motorSoll.Name = "motorSoll";
|
||||
this.motorSoll.Size = new System.Drawing.Size(16, 13);
|
||||
this.motorSoll.TabIndex = 12;
|
||||
this.motorSoll.Text = "-1";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Location = new System.Drawing.Point(478, 9);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(94, 268);
|
||||
this.panel1.TabIndex = 13;
|
||||
//
|
||||
// Temp1
|
||||
//
|
||||
this.Temp1.AutoSize = true;
|
||||
this.Temp1.Location = new System.Drawing.Point(15, 124);
|
||||
this.Temp1.Name = "Temp1";
|
||||
this.Temp1.Size = new System.Drawing.Size(24, 13);
|
||||
this.Temp1.TabIndex = 14;
|
||||
this.Temp1.Text = "0°C";
|
||||
//
|
||||
// Temp2
|
||||
//
|
||||
this.Temp2.AutoSize = true;
|
||||
this.Temp2.Location = new System.Drawing.Point(98, 124);
|
||||
this.Temp2.Name = "Temp2";
|
||||
this.Temp2.Size = new System.Drawing.Size(24, 13);
|
||||
this.Temp2.TabIndex = 15;
|
||||
this.Temp2.Text = "0°C";
|
||||
//
|
||||
// TempDiff
|
||||
//
|
||||
this.TempDiff.AutoSize = true;
|
||||
this.TempDiff.Location = new System.Drawing.Point(183, 124);
|
||||
this.TempDiff.Name = "TempDiff";
|
||||
this.TempDiff.Size = new System.Drawing.Size(21, 13);
|
||||
this.TempDiff.TabIndex = 16;
|
||||
this.TempDiff.Text = "0%";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(584, 302);
|
||||
this.Controls.Add(this.TempDiff);
|
||||
this.Controls.Add(this.Temp2);
|
||||
this.Controls.Add(this.Temp1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.motorSoll);
|
||||
this.Controls.Add(this.heizungSoll);
|
||||
this.Controls.Add(this.motorbox);
|
||||
this.Controls.Add(this.tempbox);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.motor);
|
||||
this.Controls.Add(this.heater);
|
||||
this.Controls.Add(this.debug);
|
||||
this.Controls.Add(this.chart);
|
||||
this.Controls.Add(this.Temp);
|
||||
this.Controls.Add(this.label1);
|
||||
this.MaximizeBox = false;
|
||||
this.MaximumSize = new System.Drawing.Size(600, 340);
|
||||
this.MinimumSize = new System.Drawing.Size(600, 340);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Laminator GUI";
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.close);
|
||||
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tempbox)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.motorbox)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
@@ -250,6 +283,9 @@
|
||||
private System.Windows.Forms.Label heizungSoll;
|
||||
private System.Windows.Forms.Label motorSoll;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Label Temp1;
|
||||
private System.Windows.Forms.Label Temp2;
|
||||
private System.Windows.Forms.Label TempDiff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Laminator_GUI
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
private Queue<int> hist = new Queue<int>();
|
||||
private Queue<float> hist = new Queue<float>();
|
||||
private Queue<bool> hmotor = new Queue<bool>();
|
||||
private Queue<bool> hheat = new Queue<bool>();
|
||||
|
||||
@@ -32,6 +32,10 @@ namespace Laminator_GUI
|
||||
private Settings settings;
|
||||
public delegate void InvokeDelegate();
|
||||
private InIReader ini = new InIReader("temperatur.ini");
|
||||
private string tempText1;
|
||||
private string tempText2;
|
||||
private float temp1;
|
||||
private float temp2;
|
||||
|
||||
public Form1()
|
||||
{
|
||||
@@ -39,7 +43,7 @@ namespace Laminator_GUI
|
||||
this.createButtons();
|
||||
this.settings = new Settings();
|
||||
this.chart.ChartAreas[0].AxisX.Maximum = this.settings.Chart_Items;
|
||||
this.serialPort = new SerialPort(this.settings.Com_Port, 9600, Parity.None, 8, StopBits.One);
|
||||
this.serialPort = new SerialPort(this.settings.Com_Port, 38400, Parity.Even, 8, StopBits.One);
|
||||
this.serialPort.Open();
|
||||
this.serialPort.Write("m" + this.settings.Default_Motor.PadLeft(2, '0') + "\n");
|
||||
this.motorbox.Value = int.Parse(this.settings.Default_Motor);
|
||||
@@ -79,20 +83,65 @@ namespace Laminator_GUI
|
||||
{
|
||||
string r = this.serialPort.ReadLine();
|
||||
this.debugText = r;
|
||||
string[] tmp = r.Split(' ');
|
||||
if (tmp.Length == 8)
|
||||
string[] tmp = r.Split(';');
|
||||
if (tmp.Length == 11)
|
||||
{
|
||||
int temp = int.Parse(tmp[3]);
|
||||
if (temp < 0)
|
||||
temp = 0;
|
||||
this.tempText = temp.ToString();
|
||||
this.solltempText = tmp[4];
|
||||
this.motorText = tmp[5];
|
||||
this.heaterBool = (int.Parse(tmp[6]) > 0);
|
||||
this.motorBool = (int.Parse(tmp[7]) > 0);
|
||||
this.hist.Enqueue(temp);
|
||||
this.hmotor.Enqueue(this.motorBool);
|
||||
this.hheat.Enqueue(this.heaterBool);
|
||||
foreach(String item in tmp) {
|
||||
string[] kv = item.Split('=');
|
||||
switch(kv[0]) {
|
||||
case "cm": {
|
||||
float temp = float.Parse(kv[1].Replace(',', '.'), System.Globalization.CultureInfo.InvariantCulture);
|
||||
if(temp < 0)
|
||||
temp = 0;
|
||||
this.tempText = temp.ToString("0.00");
|
||||
this.hist.Enqueue(temp);
|
||||
break;
|
||||
}
|
||||
case "c0": {
|
||||
this.temp1 = float.Parse(kv[1].Replace(',', '.'), System.Globalization.CultureInfo.InvariantCulture);
|
||||
if(this.temp1 < 0)
|
||||
this.temp1 = 1;
|
||||
this.tempText1 = this.temp1.ToString("0.00");
|
||||
break;
|
||||
}
|
||||
case "c1": {
|
||||
this.temp2 = float.Parse(kv[1].Replace(',', '.'), System.Globalization.CultureInfo.InvariantCulture);
|
||||
if(this.temp2 < 0)
|
||||
this.temp2 = 0;
|
||||
this.tempText2 = this.temp2.ToString("0.00");
|
||||
break;
|
||||
}
|
||||
case "t": {
|
||||
this.solltempText = kv[1];
|
||||
break;
|
||||
}
|
||||
case "m": {
|
||||
this.motorText = kv[1];
|
||||
break;
|
||||
}
|
||||
case "hon": {
|
||||
this.heaterBool = (int.Parse(kv[1]) > 0);
|
||||
this.hheat.Enqueue(this.heaterBool);
|
||||
break;
|
||||
}
|
||||
case "mon": {
|
||||
this.motorBool = (int.Parse(kv[1]) > 0);
|
||||
this.hmotor.Enqueue(this.motorBool);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//int temp = int.Parse(tmp[3]);
|
||||
//if (temp < 0)
|
||||
// temp = 0;
|
||||
//this.tempText = temp.ToString();
|
||||
//this.solltempText = tmp[4];
|
||||
//this.motorText = tmp[5];
|
||||
//this.heaterBool = (int.Parse(tmp[6]) > 0);
|
||||
//this.motorBool = (int.Parse(tmp[7]) > 0);
|
||||
//this.hist.Enqueue(temp);
|
||||
//this.hmotor.Enqueue(this.motorBool);
|
||||
//this.hheat.Enqueue(this.heaterBool);
|
||||
if (this.hist.Count > this.settings.Chart_Items)
|
||||
{
|
||||
this.hist.Dequeue();
|
||||
@@ -112,6 +161,9 @@ namespace Laminator_GUI
|
||||
try
|
||||
{
|
||||
this.Temp.BeginInvoke((MethodInvoker)delegate { this.Temp.Text = this.tempText + "°C"; });
|
||||
this.Temp1.BeginInvoke((MethodInvoker)delegate { this.Temp1.Text = this.tempText1 + "°C"; });
|
||||
this.Temp2.BeginInvoke((MethodInvoker)delegate { this.Temp2.Text = this.tempText2 + "°C"; });
|
||||
this.TempDiff.BeginInvoke((MethodInvoker)delegate { this.TempDiff.Text = ((((this.temp1 == 0 ? 1f : this.temp1) / this.temp2) * 100) - 100).ToString("0.00") + " %"; });
|
||||
this.debug.BeginInvoke((MethodInvoker)delegate { this.debug.Text = this.debugText; });
|
||||
this.chart.BeginInvoke((MethodInvoker)delegate { this.drawDia(); });
|
||||
this.heater.BeginInvoke(new InvokeDelegate(InvokeHeat));
|
||||
@@ -124,7 +176,7 @@ namespace Laminator_GUI
|
||||
|
||||
private void InvokeHeat()
|
||||
{
|
||||
if (this.heaterBool)
|
||||
if (!this.heaterBool)
|
||||
{
|
||||
this.heater.ForeColor = System.Drawing.Color.Red;
|
||||
}
|
||||
@@ -135,7 +187,7 @@ namespace Laminator_GUI
|
||||
}
|
||||
private void InvokeMotor()
|
||||
{
|
||||
if (this.motorBool)
|
||||
if (!this.motorBool)
|
||||
{
|
||||
this.motor.ForeColor = System.Drawing.Color.Red;
|
||||
}
|
||||
@@ -152,7 +204,7 @@ namespace Laminator_GUI
|
||||
int i = 1;
|
||||
try
|
||||
{
|
||||
foreach (int temp in this.hist)
|
||||
foreach (float temp in this.hist)
|
||||
{
|
||||
this.chart.Series["Temp"].Points.AddXY(i++, temp);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -11,13 +11,13 @@
|
||||
<userSettings>
|
||||
<Laminator_GUI.Properties.Settings>
|
||||
<setting name="Default_Temp" serializeAs="String">
|
||||
<value>32</value>
|
||||
<value>25</value>
|
||||
</setting>
|
||||
<setting name="Default_Motor" serializeAs="String">
|
||||
<value>10</value>
|
||||
<value>20</value>
|
||||
</setting>
|
||||
<setting name="Com_Port" serializeAs="String">
|
||||
<value>COM7</value>
|
||||
<value>COM9</value>
|
||||
</setting>
|
||||
<setting name="Chart_Items" serializeAs="String">
|
||||
<value>1000</value>
|
||||
|
||||
Binary file not shown.
@@ -11,13 +11,13 @@
|
||||
<userSettings>
|
||||
<Laminator_GUI.Properties.Settings>
|
||||
<setting name="Default_Temp" serializeAs="String">
|
||||
<value>32</value>
|
||||
<value>25</value>
|
||||
</setting>
|
||||
<setting name="Default_Motor" serializeAs="String">
|
||||
<value>10</value>
|
||||
<value>20</value>
|
||||
</setting>
|
||||
<setting name="Com_Port" serializeAs="String">
|
||||
<value>COM16</value>
|
||||
<value>COM9</value>
|
||||
</setting>
|
||||
<setting name="Chart_Items" serializeAs="String">
|
||||
<value>1000</value>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Profile 1]
|
||||
temp=200
|
||||
motor=10
|
||||
motor=20
|
||||
name=Aufheitzen 200°C
|
||||
|
||||
[Profile 2]
|
||||
@@ -10,12 +10,12 @@ name=Steppen 200°C
|
||||
|
||||
[Profile 3]
|
||||
temp=210
|
||||
motor=10
|
||||
motor=20
|
||||
name=Brennen 210°C
|
||||
|
||||
[Profile 4]
|
||||
temp=10
|
||||
motor=10
|
||||
motor=20
|
||||
name=Abkühlen Motor ein
|
||||
|
||||
[Profile 5]
|
||||
|
||||
BIN
Binary file not shown.
@@ -8,3 +8,13 @@ D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Lamina
|
||||
D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator-GUI.pdb
|
||||
D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\bin\x86\Release\temperatur.ini
|
||||
D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator-GUI.csprojResolveAssemblyReference.cache
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\bin\x86\Release\Laminator-GUI.exe.config
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator-GUI.exe
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator-GUI.pdb
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\bin\x86\Release\temperatur.ini
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\bin\x86\Release\Laminator-GUI.exe
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\bin\x86\Release\Laminator-GUI.pdb
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator-GUI.csprojResolveAssemblyReference.cache
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator_GUI.Form1.resources
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator_GUI.Properties.Resources.resources
|
||||
E:\Eigene Dateien\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\x86\Release\Laminator-GUI.csproj.GenerateResource.Cache
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
[Profile 1]
|
||||
temp=200
|
||||
motor=10
|
||||
motor=20
|
||||
name=Aufheitzen 200°C
|
||||
|
||||
[Profile 2]
|
||||
@@ -10,12 +10,12 @@ name=Steppen 200°C
|
||||
|
||||
[Profile 3]
|
||||
temp=210
|
||||
motor=10
|
||||
motor=20
|
||||
name=Brennen 210°C
|
||||
|
||||
[Profile 4]
|
||||
temp=10
|
||||
motor=10
|
||||
motor=20
|
||||
name=Abkühlen Motor ein
|
||||
|
||||
[Profile 5]
|
||||
|
||||
Reference in New Issue
Block a user