20130419-181012

This commit is contained in:
2013-04-19 16:10:01 +00:00
parent c2e41fb6dd
commit 8ac7d106d4
21 changed files with 388 additions and 369 deletions
Binary file not shown.
+50 -26
View File
@@ -28,10 +28,10 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
System.Windows.Forms.DataVisualization.Charting.Series series7 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series8 = new System.Windows.Forms.DataVisualization.Charting.Series();
System.Windows.Forms.DataVisualization.Charting.Series series9 = new System.Windows.Forms.DataVisualization.Charting.Series();
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();
@@ -41,6 +41,8 @@
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();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tempbox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.motorbox)).BeginInit();
@@ -68,26 +70,26 @@
//
// chart
//
chartArea3.Name = "ChartArea1";
this.chart.ChartAreas.Add(chartArea3);
chartArea1.Name = "ChartArea1";
this.chart.ChartAreas.Add(chartArea1);
this.chart.Location = new System.Drawing.Point(13, 134);
this.chart.Name = "chart";
series7.ChartArea = "ChartArea1";
series7.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
series7.Color = System.Drawing.Color.Red;
series7.IsVisibleInLegend = false;
series7.Name = "Temp";
series8.ChartArea = "ChartArea1";
series8.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
series8.Color = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
series8.Name = "Motor";
series9.ChartArea = "ChartArea1";
series9.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
series9.Color = System.Drawing.Color.Blue;
series9.Name = "Heizung";
this.chart.Series.Add(series7);
this.chart.Series.Add(series8);
this.chart.Series.Add(series9);
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";
@@ -104,22 +106,22 @@
// heater
//
this.heater.AutoSize = true;
this.heater.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
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(98, 25);
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", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
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(72, 25);
this.motor.Size = new System.Drawing.Size(60, 22);
this.motor.TabIndex = 5;
this.motor.Text = "Motor";
//
@@ -177,11 +179,31 @@
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";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 261);
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);
@@ -216,6 +238,8 @@
private System.Windows.Forms.Button button1;
private System.Windows.Forms.NumericUpDown tempbox;
private System.Windows.Forms.NumericUpDown motorbox;
private System.Windows.Forms.Label heizungSoll;
private System.Windows.Forms.Label motorSoll;
}
}
+7 -31
View File
@@ -39,7 +39,9 @@ namespace Laminator_GUI
this.serialPort = new SerialPort(this.settings.Com_Port, 9600, Parity.None, 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);
this.serialPort.Write("t" + this.settings.Default_Temp.PadLeft(3, '0') + "\n");
this.tempbox.Value = int.Parse(this.settings.Default_Temp);
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.RefreshGui);
this.t = new Thread(this.polling);
@@ -85,29 +87,17 @@ namespace Laminator_GUI
{
try
{
this.Temp.BeginInvoke(new InvokeDelegate(InvokeMethodTemp));
this.debug.BeginInvoke(new InvokeDelegate(InvokeMethodDebug));
this.chart.BeginInvoke(new InvokeDelegate(InvokeDia));
this.Temp.BeginInvoke((MethodInvoker)delegate { this.Temp.Text = this.tempText + "°C"; });
this.debug.BeginInvoke((MethodInvoker)delegate { this.debug.Text = this.debugText; });
this.chart.BeginInvoke((MethodInvoker)delegate { this.drawDia(); });
this.heater.BeginInvoke(new InvokeDelegate(InvokeHeat));
this.motor.BeginInvoke(new InvokeDelegate(InvokeMotor));
this.tempbox.BeginInvoke(new InvokeDelegate(InvokeTempBox));
this.motorbox.BeginInvoke(new InvokeDelegate(InvokeMotorBox));
this.heizungSoll.BeginInvoke((MethodInvoker)delegate { this.heizungSoll.Text = this.solltempText + "°C"; });
this.motorSoll.BeginInvoke((MethodInvoker)delegate { this.motorSoll.Text = this.motorText; });
}
catch (InvalidOperationException) { }
}
private void InvokeMotorBox()
{
if (this.motorbox.Text == "" || this.motorbox.Text == "-1")
this.motorbox.Text = this.motorText;
}
private void InvokeTempBox()
{
if (this.tempbox.Text == "" || this.tempbox.Text == "-1")
this.tempbox.Text = this.solltempText;
}
private void InvokeHeat()
{
if (this.heaterBool)
@@ -130,18 +120,6 @@ namespace Laminator_GUI
this.motor.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
}
}
private void InvokeDia()
{
this.drawDia();
}
private void InvokeMethodTemp()
{
this.Temp.Text = this.tempText + "°C";
}
private void InvokeMethodDebug()
{
this.debug.Text = this.debugText;
}
private void drawDia()
{
this.chart.Series["Temp"].Points.Clear();
@@ -172,9 +150,7 @@ namespace Laminator_GUI
{
this.serialPort.Write("m" + this.motorbox.Text.PadLeft(2, '0') + "\n");
this.serialPort.Write("t" + this.tempbox.Text.PadLeft(3, '0') + "\n");
this.motorbox.Text = "-1";
this.motorText = "-1";
this.tempbox.Text = "-1";
this.solltempText = "-1";
}
@@ -1,6 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Laminator_GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<Laminator_GUI.Properties.Settings>
<setting name="Com_Port" serializeAs="String">
<value>COM8</value>
</setting>
<setting name="Default_Temp" serializeAs="String">
<value>32</value>
</setting>
<setting name="Default_Motor" serializeAs="String">
<value>10</value>
</setting>
</Laminator_GUI.Properties.Settings>
</userSettings>
</configuration>
@@ -6,3 +6,4 @@ D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\Release\Laminator_
D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\Release\Laminator-GUI.csproj.GenerateResource.Cache
D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\Release\Laminator-GUI.exe
D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\Release\Laminator-GUI.pdb
D:\Doc's\Basteleien\Laminator\Laminator-GUI\Laminator-GUI\obj\Release\Laminator-GUI.csprojResolveAssemblyReference.cache