-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChartMenu.pas
More file actions
53 lines (41 loc) · 1.21 KB
/
ChartMenu.pas
File metadata and controls
53 lines (41 loc) · 1.21 KB
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
unit ChartMenu;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Connection, VclTee.TeeGDIPlus,
VclTee.Series, VclTee.TeEngine, Vcl.ExtCtrls, VclTee.TeeProcs, VclTee.Chart,
VclTee.DBChart;
type
TChart = class(TForm)
DBChart1: TDBChart;
Panel1: TPanel;
Series2: THorizBarSeries;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Chart: TChart;
implementation
{$R *.dfm}
procedure TChart.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Chart.Free;
end;
procedure TChart.FormCreate(Sender: TObject);
begin
DT_connection.qryVaxrede.Close;
DT_connection.qryVaxrede.SQL.Clear;
DT_connection.qryVaxrede.SQL.Add
('select DISTINCT s.SensorID, s.SetorSensor,sum (c.cvalor * s.Rede) as Potencia_W, '+
'sum (c.cvalor * s.Rede) /1000 as KWh, '+
's.rede from Sensor s, coleta c where s.SensorID = c.Sensor_SensorID and '+
'c.data = c.data '+
'group by s.SetorSensor');
DT_connection.qryVaxrede.Open;
end;
end.