1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81:
| Zeit := 0; i := 0; Uc := 0;
if (Form1.Aufladung.Checked = true) then begin while Uc <= (Betriebsspannung - (Betriebsspannung / 100)) do begin Uc := Betriebsspannung * (1 - exp(-Zeit / Tau)); Kondensatorspannung [i] := Uc; Zeit := Zeit + (1 / 10000); i := i + 1; end end else begin if (Form1.Entladung.Checked = true) then begin Uc := Betriebsspannung; while Uc > (0 + Betriebsspannung / 1000) do begin Uc := Betriebsspannung * exp(-Zeit / Tau); Kondensatorspannung [i] := Uc; Zeit := Zeit + (1 / 100); i := i + 1; end end end;
Schritte := i; i := 0; igenau := 0; Abstand := 30; k := Abstand; Pixelhoehe := Schritte /(ImgKurve.Height - Abstand); Pixelbreite := Schritte /(ImgKurve.Width - Abstand);
repeat if (i = 0) then begin ImgKurve.Canvas.Pen.Color := clblack; ImgKurve.Canvas.Pen.Width := 1; ImgKurve.Canvas.MoveTo(Abstand, ImgKurve.Height - Abstand); i := i + 1; end else begin ImgKurve.Canvas.Pen.Color := clblack; ImgKurve.Canvas.Pen.Width := 1; ImgKurve.Canvas.LineTo(k,ImgKurve.Height - Abstand - (round(Kondensatorspannung [i] * (ImgKurve.Height - Abstand)))); KStand := ImgKurve.Height - Abstand - (round(Kondensatorspannung [i] * (ImgKurve.Height - Abstand))); i := round(igenau + Pixelbreite + Pixelhoehe); igenau := igenau + Pixelbreite + Pixelhoehe; k := k + 1; end; until i >= Schritte; if (Form1.Aufladung.Checked = true) then begin ImgKurve.Canvas.Pen.Color := clblack; ImgKurve.Canvas.Pen.Width := 1; ImgKurve.Canvas.LineTo(ImgKurve.Width - 30,KStand - 5); end else begin if (Form1.Entladung.Checked = true) then begin ImgKurve.Canvas.Pen.Color := clblack; ImgKurve.Canvas.Pen.Width := 1; ImgKurve.Canvas.LineTo(ImgKurve.Width - 30,ImgKurve.Height - Abstand); end; end;
ImgKurve.Canvas.Pen.Width := 3; ImgKurve.Canvas.MoveTo(25,KStand); ImgKurve.Canvas.LineTo(30,KStand); ImgKurve.Canvas.TextOut(5,KStand,EBetriebsspannung.Text); |