-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathkantu_simulation.pas
More file actions
112 lines (83 loc) · 2.72 KB
/
kantu_simulation.pas
File metadata and controls
112 lines (83 loc) · 2.72 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
unit kantu_simulation;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, ExtDlgs, kantu_definitions, Math, dateutils, Grids,
Buttons, CheckLst;
type
{ TSimulationForm }
TSimulationForm = class(TForm)
BeginInSampleCalendar: TCalendarDialog;
BeginInSampleEdit: TEdit;
Button1: TButton;
EndInSampleCalendar: TCalendarDialog;
EndInSampleEdit: TEdit;
EndOutOfSampleCalendar: TCalendarDialog;
EndOutOfSampleEdit: TEdit;
Label1: TLabel;
Label15: TLabel;
Label16: TLabel;
Label2: TLabel;
Label3: TLabel;
LROriginCheck: TCheckBox;
OptionsGrid: TStringGrid;
OptionsPanel: TPanel;
OptTargetComboBox: TComboBox;
UseDayFilter: TCheckBox;
UsedInputsList: TCheckListBox;
UseFixedHour: TCheckBox;
UseFixedSLTP: TCheckBox;
UseHourFilter: TCheckBox;
UseSLCheck: TCheckBox;
UseTPCheck: TCheckBox;
procedure BeginInSampleCalendarDayChanged(Sender: TObject);
procedure BeginInSampleEditChange(Sender: TObject);
procedure BeginInSampleEditClick(Sender: TObject);
procedure EndInSampleEditClick(Sender: TObject);
procedure EndOutOfSampleEditClick(Sender: TObject);
procedure OptionsGridPrepareCanvas(sender: TObject; aCol, aRow: Integer;
aState: TGridDrawState);
private
{ private declarations }
public
{ public declarations }
end;
var
SimulationForm: TSimulationForm;
implementation
uses kantu_main;
{$R *.lfm}
procedure TSimulationForm.EndInSampleEditClick(Sender: TObject);
begin
if EndInSampleCalendar.Execute then
EndInSampleEdit.Text := DateTimeToStr(EndInSampleCalendar.Date);
end;
procedure TSimulationForm.EndOutOfSampleEditClick(Sender: TObject);
begin
if EndOutOfSampleCalendar.Execute and (EndOutOfSampleCalendar.Date > EndInSampleCalendar.Date) then
begin
EndOutOfSampleEdit.Text := DateTimeToStr(EndOutOfSampleCalendar.Date);
end;
if (EndOutOfSampleCalendar.Date < EndInSampleCalendar.Date) then
EndOutOfSampleCalendar.Date := Now;
end;
procedure TSimulationForm.OptionsGridPrepareCanvas(sender: TObject; aCol,
aRow: Integer; aState: TGridDrawState);
begin
If (aRow = 1) or (aRow = 6) or (aRow = 10) or (aRow = 14) or (aRow = 16) then
OptionsGrid.Canvas.Brush.Color := clLtGray;
end;
procedure TSimulationForm.BeginInSampleCalendarDayChanged(Sender: TObject);
begin
BeginInSampleEdit.Text := DateTimeToStr(BeginInSampleCalendar.Date);
end;
procedure TSimulationForm.BeginInSampleEditChange(Sender: TObject);
begin
end;
procedure TSimulationForm.BeginInSampleEditClick(Sender: TObject);
begin
if BeginInSampleCalendar.Execute then
BeginInSampleEdit.Text := DateTimeToStr(BeginInSampleCalendar.Date);
end;
end.