20130412-185001

This commit is contained in:
BlubbFish 2013-04-12 16:50:03 +00:00
parent bf63412d97
commit f83a4343ff
12 changed files with 102 additions and 68 deletions

View File

@ -28,20 +28,22 @@
/// </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();
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();
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.tempbox = new System.Windows.Forms.TextBox();
this.motorbox = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.tempbox = new System.Windows.Forms.NumericUpDown();
this.motorbox = new System.Windows.Forms.NumericUpDown();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tempbox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.motorbox)).BeginInit();
this.SuspendLayout();
//
// label1
@ -66,26 +68,26 @@
//
// chart
//
chartArea1.Name = "ChartArea1";
this.chart.ChartAreas.Add(chartArea1);
chartArea3.Name = "ChartArea1";
this.chart.ChartAreas.Add(chartArea3);
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);
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);
this.chart.Size = new System.Drawing.Size(359, 122);
this.chart.TabIndex = 2;
this.chart.Text = "chart1";
@ -121,20 +123,6 @@
this.motor.TabIndex = 5;
this.motor.Text = "Motor";
//
// tempbox
//
this.tempbox.Location = new System.Drawing.Point(261, 76);
this.tempbox.Name = "tempbox";
this.tempbox.Size = new System.Drawing.Size(55, 20);
this.tempbox.TabIndex = 6;
//
// motorbox
//
this.motorbox.Location = new System.Drawing.Point(261, 103);
this.motorbox.Name = "motorbox";
this.motorbox.Size = new System.Drawing.Size(55, 20);
this.motorbox.TabIndex = 7;
//
// button1
//
this.button1.Location = new System.Drawing.Point(322, 76);
@ -145,14 +133,58 @@
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[] {
250,
0,
0,
0});
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[] {
1,
0,
0,
-2147483648});
//
// motorbox
//
this.motorbox.Location = new System.Drawing.Point(261, 104);
this.motorbox.Maximum = new decimal(new int[] {
10,
0,
0,
0});
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[] {
1,
0,
0,
-2147483648});
//
// 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.button1);
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);
@ -166,6 +198,8 @@
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();
@ -179,9 +213,9 @@
private System.Windows.Forms.Label debug;
private System.Windows.Forms.Label heater;
private System.Windows.Forms.Label motor;
private System.Windows.Forms.TextBox tempbox;
private System.Windows.Forms.TextBox motorbox;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.NumericUpDown tempbox;
private System.Windows.Forms.NumericUpDown motorbox;
}
}

View File

@ -24,8 +24,8 @@ namespace Laminator_GUI
private string tempText = "";
private bool heaterBool = false;
private bool motorBool = false;
private string solltempText = "0";
private string motorText = "0";
private string solltempText = "-1";
private string motorText = "-1";
private Thread t;
public delegate void InvokeDelegate();
@ -93,13 +93,13 @@ namespace Laminator_GUI
private void InvokeMotorBox()
{
if (this.motorbox.Text == "" || this.motorbox.Text == "0")
if (this.motorbox.Text == "" || this.motorbox.Text == "-1")
this.motorbox.Text = this.motorText;
}
private void InvokeTempBox()
{
if (this.tempbox.Text == "" || this.tempbox.Text == "0")
if (this.tempbox.Text == "" || this.tempbox.Text == "-1")
this.tempbox.Text = this.solltempText;
}
@ -163,10 +163,10 @@ 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 = "";
this.motorText = "0";
this.tempbox.Text = "";
this.solltempText = "0";
this.motorbox.Text = "-1";
this.motorText = "-1";
this.tempbox.Text = "-1";
this.solltempText = "-1";
}
private void close(object sender, FormClosedEventArgs e)

View File

@ -24,8 +24,8 @@
:10017000B500089580E487B987E886B910BE089570
:10018000806487B98AE18A95F1F700C0369A349B7A
:10019000FECF349A84B195B108959C01B9018827A6
:1001A00077FD8095982F4AD12EE03BE64FE950EC41
:1001B000D1D120E738E543E354E4A9D020E030E092
:1001A00077FD8095982F4AD12BE034EB40E450EC5A
:1001B000D1D12CE83AEC48ED53E4A9D020E030E06E
:1001C00040ED51E4A4D007D1862F972F08955F9B6F
:1001D000FECF8CB10895C0DFCDDF789480E690E04B
:1001E0002ED2BA9A80E0CCDFE82EF92EC09197008B
@ -34,7 +34,7 @@
:100210000F2EFDE76F2EF0E07F2EF02D01C0840140
:10022000DD230CF4E4018BE0C816D10424F4089417
:10023000C11CD11C01C064018091960090E00A9716
:10024000BC016C0D7D1D0C171D0764F495E5E916C6
:10024000BC016C0D7D1D0C171D0764F49EE1E916C1
:10025000F10454F02A2DA9EEEA16A3E0FA062CF0D8
:100260002B2D03C02B2D01C02B2D80919700909139
:10027000980030919600EDB7FEB772970FB6F894DC

View File

@ -324,7 +324,7 @@ unsigned int read_adc(unsigned char adc_input)
0000019a <convert2degree>:
static const float c2=300;
static const float v2=89; //ADC-Wert=165 @ 202°C
static const float v2=53; //ADC-Wert=165 @ 202°C
float m=((c1-c2)/(v1-v2));
@ -336,15 +336,15 @@ unsigned int read_adc(unsigned char adc_input)
1a2: 80 95 com r24
1a4: 98 2f mov r25, r24
1a6: 4a d1 rcall .+660 ; 0x43c <__floatsisf>
1a8: 2e e0 ldi r18, 0x0E ; 14
1aa: 3b e6 ldi r19, 0x6B ; 107
1ac: 4f e9 ldi r20, 0x9F ; 159
1a8: 2b e0 ldi r18, 0x0B ; 11
1aa: 34 eb ldi r19, 0xB4 ; 180
1ac: 40 e4 ldi r20, 0x40 ; 64
1ae: 50 ec ldi r21, 0xC0 ; 192
1b0: d1 d1 rcall .+930 ; 0x554 <__mulsf3>
1b2: 20 e7 ldi r18, 0x70 ; 112
1b4: 38 e5 ldi r19, 0x58 ; 88
1b6: 43 e3 ldi r20, 0x33 ; 51
1b8: 54 e4 ldi r21, 0x44 ; 68
1b2: 2c e8 ldi r18, 0x8C ; 140
1b4: 3a ec ldi r19, 0xCA ; 202
1b6: 48 ed ldi r20, 0xD8 ; 216
1b8: 53 e4 ldi r21, 0x43 ; 67
1ba: a9 d0 rcall .+338 ; 0x30e <__addsf3>
1bc: 20 e0 ldi r18, 0x00 ; 0
1be: 30 e0 ldi r19, 0x00 ; 0
@ -432,7 +432,7 @@ int main(void)
} else {
mon = 0;
}
if (pwm<=pwm_ctr || val<85 || val>1000) { //pwm, detect Sensor contakt break/short
if (pwm<=pwm_ctr || val<30 || val>1000) { //pwm, detect Sensor contakt break/short
hon = 0;
20a: bb 24 eor r11, r11
20c: aa 24 eor r10, r10
@ -492,11 +492,11 @@ int main(void)
} else {
mon = 0;
}
if (pwm<=pwm_ctr || val<85 || val>1000) { //pwm, detect Sensor contakt break/short
if (pwm<=pwm_ctr || val<30 || val>1000) { //pwm, detect Sensor contakt break/short
246: 0c 17 cp r16, r28
248: 1d 07 cpc r17, r29
24a: 64 f4 brge .+24 ; 0x264 <main+0x8e>
24c: 95 e5 ldi r25, 0x55 ; 85
24c: 9e e1 ldi r25, 0x1E ; 30
24e: e9 16 cp r14, r25
250: f1 04 cpc r15, r1
252: 54 f0 brlt .+20 ; 0x268 <main+0x92>

View File

@ -25,8 +25,8 @@ S11301608AB983E389B989E990E09093B6008093D2
S1130170B500089580E487B987E886B910BE08956C
S1130180806487B98AE18A95F1F700C0369A349B76
S1130190FECF349A84B195B108959C01B9018827A2
S11301A077FD8095982F4AD12EE03BE64FE950EC3D
S11301B0D1D120E738E543E354E4A9D020E030E08E
S11301A077FD8095982F4AD12BE034EB40E450EC56
S11301B0D1D12CE83AEC48ED53E4A9D020E030E06A
S11301C040ED51E4A4D007D1862F972F08955F9B6B
S11301D0FECF8CB10895C0DFCDDF789480E690E047
S11301E02ED2BA9A80E0CCDFE82EF92EC091970087
@ -35,7 +35,7 @@ S1130200DD2401E010E088249924BB24AA24A394CB
S11302100F2EFDE76F2EF0E07F2EF02D01C084013C
S1130220DD230CF4E4018BE0C816D10424F4089413
S1130230C11CD11C01C064018091960090E00A9712
S1130240BC016C0D7D1D0C171D0764F495E5E916C2
S1130240BC016C0D7D1D0C171D0764F49EE1E916BD
S1130250F10454F02A2DA9EEEA16A3E0FA062CF0D4
S11302602B2D03C02B2D01C02B2D80919700909135
S1130270980030919600EDB7FEB772970FB6F894D8

View File

@ -97,7 +97,7 @@ int convert2degree(int value) {
static const float v1=144; //ADC-Wert=264 @ 20°C
static const float c2=300;
static const float v2=89; //ADC-Wert=165 @ 202°C
static const float v2=53; //ADC-Wert=165 @ 202°C
float m=((c1-c2)/(v1-v2));
@ -143,7 +143,7 @@ int main(void)
} else {
mon = 0;
}
if (pwm<=pwm_ctr || val<85 || val>1000) { //pwm, detect Sensor contakt break/short
if (pwm<=pwm_ctr || val<30 || val>1000) { //pwm, detect Sensor contakt break/short
hon = 0;
} else {
hon = 1;