Changeset 8 for trunk/FormMain.pas


Ignore:
Timestamp:
Apr 13, 2026, 11:12:39 PM (2 weeks ago)
Author:
chronos
Message:
  • Fixed: Data tab populating and refreshing.
  • Fixed: Used currency as decimal type for measured values instead inaccurate double type.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FormMain.pas

    r7 r8  
    6565    procedure ButtonIntervalRightClick(Sender: TObject);
    6666    procedure CheckBoxShowResultChange(Sender: TObject);
     67    procedure ComboBoxEanDataSelect(Sender: TObject);
    6768    procedure ComboBoxEanSelect(Sender: TObject);
    6869    procedure ComboBoxPeriodSelect(Sender: TObject);
     
    139140end;
    140141
     142procedure TFormMain.ComboBoxEanDataSelect(Sender: TObject);
     143begin
     144  ReloadListViewData;
     145end;
     146
    141147procedure TFormMain.ButtonIntervalRightClick(Sender: TObject);
    142148begin
     
    348354      ListItem.SubItems.Add(FloatToStr(PriceHigh));
    349355      ListItem.SubItems.Add(FloatToStr(PriceSpot));
     356      ListItem.SubItems.Add(IntToStr(GetSavings(IntervalFrom, IntervalTo)));
    350357    end;
    351358  finally
     
    367374    ListView2.BeginUpdate;
    368375    try
    369       for I := 0 to Ean.Values.Count - 1 do begin
     376      for I := 0 to Ean.Values.Count - 1 do
     377      with Ean.Values[I] do
     378      if (Time >= IntervalFrom) and (Time < IntervalTo) then begin
    370379        ListItem := ListView2.Items.Add;
    371         ListItem.Caption := DateTimeToStr(Ean.Values[I].Time);
    372         ListItem.SubItems.Add(FloatToStr(Ean.Values[I].ValueIn));
    373         ListItem.SubItems.Add(IntToStr(Trunc(Ean.Values[I].GetShared)));
     380        ListItem.Caption := DateTimeToStr(Time);
     381        ListItem.SubItems.Add(FloatToStr(ValueIn));
     382        ListItem.SubItems.Add(FloatToStr(ValueOut));
     383        ListItem.SubItems.Add(IntToStr(Trunc(GetShared)));
    374384      end;
    375385    finally
Note: See TracChangeset for help on using the changeset viewer.