- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
- 82
- 83
- 84
- 85
procedure TForm1.btn1Click(Sender: TObject);
var
s, i: Byte;
prg: Byte;
fs: Tfilestream; JPEG: TJPEGImage; Bitmap: TBitmap; oldindex: Byte;
iCounterPerSec: TLargeInteger;
C1, C2: TLargeInteger;
label
ss;
begin
pb1.Position := 0;
ComboBox1.Enabled := False;
DateTimePicker2.Enabled := False;
DateTimePicker1.Enabled := False;
Button3.Enabled := False;
Button1.Enabled := False;
SpeedButton1.Enabled := False;
chk1.Enabled := False;
chk2.Enabled := False;
btn1.Enabled := False;
txt := 'Подготовка отчёта, подождите... ~ ?';
oldindex := ComboBox1.ItemIndex;
for i := 0 to ComboBox1.Items.Count do
begin
QueryPerformanceFrequency(iCounterPerSec);
QueryPerformanceCounter(C1);
ComboBox1.ItemIndex := i;
Button1.Click;
inc(prg);
pb1.Position := prg;
if AnsiRightStr(Combobox1.Text, 6) <> 'стакан' then
begin
Chart1.SaveToBitmapFile(Path + 'Report\~temp.tmp');
JPEG := TJPEGImage.Create;
Bitmap := TBitmap.Create;
try
Bitmap.LoadFromFile(path + 'Report\~temp.tmp');
Bitmap.Canvas.LineTo(0, 0);
Bitmap.Canvas.Font.Name := 'Courier New';
Bitmap.Canvas.Font.Size := 10;
Bitmap.Canvas.TextOut(25, 5, ' Дата и время выдачи: ' + datetostr(date)
+ ' ' + timetostr(time) + ' |');
JPEG.Assign(Bitmap);
JPEG.CompressionQuality := 85;
JPEG.Compress;
Image1.Picture.Assign(JPEG);
finally
JPEG.Free;
Bitmap.Free;
end;
DeleteFile(path + 'Report\~temp.tmp');
end;
if AnsiRightStr(Combobox1.Text, 6) <> 'стакан' then
Image1.Picture.SaveToFile(path + 'Report\' + Combobox1.Text + '.jpg');
Application.HandleMessage;
if i > 0 then
goto ss;
QueryPerformanceCounter(C2);
txt := 'Подготовка отчёта, подождите... ~ ' +
IntToStr(strtoint(FormatFloat('0', (C2 - C1) / iCounterPerSec)) * 60 div
60)
+ ' мин';
ss:
pb1.Visible := True;
end;
prg := 0;
ComboBox1.ItemIndex := oldindex;
Button1.Click;
ComboBox1.Enabled := True;
DateTimePicker2.Enabled := True;
DateTimePicker1.Enabled := True;
Button3.Enabled := True;
Button1.Enabled := True;
SpeedButton1.Enabled := True;
chk1.Enabled := True;
chk2.Enabled := True;
btn1.Enabled := True;
txt := 'Построение графика...';
end;
Программа просмотра архива температурных датчиков. Работает неплохо, со своими обязанностями справляется.
Полный исходный код проекта с откомпилированным екзешником и базой можно взять здесь: https://yadi.sk/d/lM7TrPJ33EFeDJ