Changeset 2 for trunk/FormMain.pas
- Timestamp:
- Apr 6, 2026, 9:37:07 AM (3 weeks ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
FormMain.pas (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:ignore
set to
EdcStats
EdcStats.res
EdcStats.lps
EdcStats.dbg
lib
-
Property svn:ignore
set to
-
trunk/FormMain.pas
r1 r2 53 53 procedure ComboBoxPeriodSelect(Sender: TObject); 54 54 procedure ComboBoxUnitSelect(Sender: TObject); 55 procedure DateEdit1Change(Sender: TObject); 55 56 procedure FormCreate(Sender: TObject); 56 57 procedure FormDestroy(Sender: TObject); … … 60 61 procedure TabSheetDataShow(Sender: TObject); 61 62 procedure TabSheetLogShow(Sender: TObject); 63 procedure TimeEdit1Change(Sender: TObject); 62 64 procedure Translator1Translate(Sender: TObject); 63 65 private … … 75 77 procedure LoadConfig; 76 78 procedure Report; 77 procedure ReloadListView ;79 procedure ReloadListViewOverview; 78 80 procedure ReloadListViewData; 79 81 procedure LoadOwners(FileName: string); … … 107 109 SOwner = 'Owner'; 108 110 SShared = 'Shared'; 111 SMeasured = 'Measured'; 112 SResult = 'Result'; 109 113 110 114 { TFormMain } … … 169 173 end; 170 174 175 procedure TFormMain.DateEdit1Change(Sender: TObject); 176 begin 177 IntervalTo := DateEdit1.Date + TimeOf(IntervalTo); 178 UpdateInterval; 179 end; 180 171 181 procedure TFormMain.FormCreate(Sender: TObject); 172 182 begin … … 189 199 procedure TFormMain.TabSheetOverviewShow(Sender: TObject); 190 200 begin 191 ReloadListView ;201 ReloadListViewOverview; 192 202 end; 193 203 … … 211 221 begin 212 222 Report; 223 end; 224 225 procedure TFormMain.TimeEdit1Change(Sender: TObject); 226 begin 227 IntervalTo := DateOf(IntervalTo) + TimeEdit1.Time; 228 UpdateInterval; 213 229 end; 214 230 … … 278 294 TotalIn, TotalOut: Double; 279 295 begin 280 Memo1.Lines.Clear; 281 for I := 0 to Eans.Count - 1 do begin 282 Memo1.Lines.Add(SEAN + ': ' + Eans[I].Number); 283 Memo1.Lines.Add(SOwner + ': ' + Eans[I].Owner); 284 TotalIn := Eans[I].GetTotalIn(IntervalFrom, IntervalTo); 285 TotalOut := Eans[I].GetTotalOut(IntervalFrom, IntervalTo); 286 Memo1.Lines.Add('Total IN: ' + IntToStr(Trunc(TotalIn))); 287 Memo1.Lines.Add('Total OUT: ' + IntToStr(Trunc(TotalOut))); 288 if TotalIn <> 0 then 289 Memo1.Lines.Add(SShared + ': ' + IntToStr(Trunc(Eans[I].GetShared(IntervalFrom, IntervalTo))) + ' %'); 290 Memo1.Lines.Add(''); 291 end; 292 end; 293 294 procedure TFormMain.ReloadListView; 296 Memo1.Lines.BeginUpdate; 297 try 298 Memo1.Lines.Clear; 299 for I := 0 to Eans.Count - 1 do begin 300 Memo1.Lines.Add(SEAN + ': ' + Eans[I].Number); 301 Memo1.Lines.Add(SOwner + ': ' + Eans[I].Owner); 302 TotalIn := Eans[I].GetTotalIn(IntervalFrom, IntervalTo); 303 TotalOut := Eans[I].GetTotalOut(IntervalFrom, IntervalTo); 304 Memo1.Lines.Add(SMeasured + ': ' + IntToStr(Trunc(TotalIn))); 305 Memo1.Lines.Add(SResult + ': ' + IntToStr(Trunc(TotalOut))); 306 if TotalIn <> 0 then 307 Memo1.Lines.Add(SShared + ': ' + IntToStr(Trunc(Eans[I].GetShared(IntervalFrom, IntervalTo))) + ' %'); 308 Memo1.Lines.Add(''); 309 end; 310 finally 311 Memo1.Lines.EndUpdate; 312 end; 313 end; 314 315 procedure TFormMain.ReloadListViewOverview; 295 316 var 296 317 ListItem: TListItem; … … 305 326 ListItem.SubItems.Add(Eans[I].Owner); 306 327 ListItem.SubItems.Add(MeasureToStr(Eans[I].GetTotalIn(IntervalFrom, IntervalTo))); 328 ListItem.SubItems.Add(MeasureToStr(Eans[I].GetTotalOut(IntervalFrom, IntervalTo))); 307 329 ListItem.SubItems.Add(IntToStr(Trunc(Eans[I].GetShared(IntervalFrom, IntervalTo)))); 308 330 ListItem.SubItems.Add(EanKindText[Eans[I].Kind]); … … 397 419 TimeFrom := StrToDate(CSVDoc.Cells[0, R]) + StrToTime(CSVDoc.Cells[1, R]); 398 420 TimeTo := StrToDate(CSVDoc.Cells[0, R]) + StrToTime(CSVDoc.Cells[2, R]); 399 if TryStrToFloat(CSVDoc.Cells[3 + C * 2, R], CellValueIn) and 400 TryStrToFloat(CSVDoc.Cells[3 + C * 2 + 1, R], CellValueOut) then begin 401 if EanKind = ekConsumption then begin 402 CellValueIn := -CellValueIn; 403 CellValueOut := -CellValueOut; 404 end; 405 Ean.Values.Add(TEanValue.Create(TimeFrom, CellValueIn, CellValueOut)); 421 422 CellValueIn := 0; 423 if TryStrToFloat(CSVDoc.Cells[3 + C * 2, R], CellValueIn) then begin 424 if EanKind = ekConsumption then CellValueIn := -CellValueIn; 406 425 end; 426 427 CellValueOut := 0; 428 if TryStrToFloat(CSVDoc.Cells[3 + C * 2 + 1, R], CellValueOut) then begin 429 if EanKind = ekConsumption then CellValueOut := -CellValueOut; 430 end; 431 432 Ean.Values.Add(TEanValue.Create(TimeFrom, CellValueIn, CellValueOut)); 407 433 end; 408 434 end;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/edc-stats/chrome/site/your_project_logo.png)