Changeset 25 for trunk/Form


Ignore:
Timestamp:
Apr 5, 2016, 10:54:28 PM (9 years ago)
Author:
chronos
Message:
  • Added: Record transfer speed to chart during scan operation.
Location:
trunk/Form
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Form/UFormMain.lfm

    r24 r25  
    3838    end
    3939  end
    40   object Panel1: TPanel
    41     Left = 597
    42     Height = 1014
    43     Top = 26
    44     Width = 1106
    45     Align = alClient
    46     BevelOuter = bvNone
    47     ClientHeight = 1014
    48     ClientWidth = 1106
    49     TabOrder = 1
    50     object Image1: TImage
    51       Left = 8
    52       Height = 998
    53       Top = 8
    54       Width = 1090
    55       Align = alClient
    56       BorderSpacing.Around = 8
    57       OnResize = Image1Resize
    58     end
    59   end
    6040  object Panel2: TPanel
    6141    Left = 0
     
    6747    ClientHeight = 1014
    6848    ClientWidth = 592
    69     TabOrder = 2
     49    TabOrder = 1
    7050    object Panel3: TPanel
    7151      Left = 0
     
    364344    Width = 5
    365345  end
     346  object PageControl1: TPageControl
     347    Left = 597
     348    Height = 1014
     349    Top = 26
     350    Width = 1106
     351    ActivePage = TabSheetSpeed
     352    Align = alClient
     353    TabIndex = 1
     354    TabOrder = 3
     355    object TabSheetSectors: TTabSheet
     356      Caption = 'Sector map'
     357      ClientHeight = 972
     358      ClientWidth = 1100
     359      object Image1: TImage
     360        Left = 4
     361        Height = 964
     362        Top = 4
     363        Width = 1092
     364        Align = alClient
     365        BorderSpacing.Around = 4
     366        OnResize = Image1Resize
     367      end
     368    end
     369    object TabSheetSpeed: TTabSheet
     370      Caption = 'Transfer speed'
     371      ClientHeight = 972
     372      ClientWidth = 1100
     373      object ChartSpeed: TChart
     374        Left = 4
     375        Height = 964
     376        Top = 4
     377        Width = 1092
     378        AxisList = <       
     379          item
     380            Marks.Format = '%0:.9g MB/s'
     381            Marks.Style = smsCustom
     382            Minors = <>
     383            Range.UseMin = True
     384            Title.LabelFont.Orientation = 900
     385          end       
     386          item
     387            Alignment = calBottom
     388            Minors = <>
     389          end>
     390        Foot.Brush.Color = clBtnFace
     391        Foot.Font.Color = clBlue
     392        Title.Brush.Color = clBtnFace
     393        Title.Font.Color = clBlue
     394        Title.Text.Strings = (
     395          'TAChart'
     396        )
     397        Align = alClient
     398        BorderSpacing.Around = 4
     399        object ChartSpeedLineSeries1: TLineSeries
     400          LinePen.Color = clWhite
     401        end
     402      end
     403    end
     404  end
    366405  object Timer1: TTimer
    367406    Interval = 500
  • trunk/Form/UFormMain.pas

    r24 r25  
    66
    77uses
    8   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   Menus, ComCtrls, ExtCtrls, ActnList, dateutils, syncobjs, UProject,
    10   UDriveScan, UPrefixMultiplier, ULastOpenedList, UPersistentForm, XMLConf,
    11   UPhysDrive;
     8  Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls, Graphics,
     9  Dialogs, StdCtrls, Menus, ComCtrls, ExtCtrls, ActnList, dateutils, syncobjs,
     10  UProject, UDriveScan, UPrefixMultiplier, ULastOpenedList, UPersistentForm,
     11  XMLConf, UPhysDrive;
    1212
    1313type
     
    3838    ButtonScan1: TButton;
    3939    ButtonScan2: TButton;
     40    ChartSpeed: TChart;
     41    ChartSpeedLineSeries1: TLineSeries;
    4042    ComboBoxDrive: TComboBox;
    4143    Image1: TImage;
     
    8385    MenuItem9: TMenuItem;
    8486    OpenDialog1: TOpenDialog;
    85     Panel1: TPanel;
     87    PageControl1: TPageControl;
    8688    Panel2: TPanel;
    8789    Panel3: TPanel;
     
    9193    Splitter1: TSplitter;
    9294    Splitter2: TSplitter;
     95    TabSheetSectors: TTabSheet;
     96    TabSheetSpeed: TTabSheet;
    9397    Timer1: TTimer;
    9498    ToolBar1: TToolBar;
     
    135139    procedure DoDraw;
    136140    procedure UpdateInterface;
     141    procedure UpdateSpeedChart;
    137142  public
    138143    procedure SaveConfig;
     
    176181    UpdateInterface;
    177182  end;
     183  PageControl1.TabIndex := 0;
    178184end;
    179185
     
    465471      CurrentScan.Lock.Release;
    466472    end;
     473    UpdateSpeedChart;
    467474  end else
    468475  with Image1 do begin
     
    522529end;
    523530
     531procedure TFormMain.UpdateSpeedChart;
     532var
     533  I: Integer;
     534begin
     535  if TabSheetSpeed.Visible then
     536  if Assigned(Core.Project) then
     537  with Core.Project do
     538  if Assigned(CurrentScan) then
     539  with CurrentScan do begin
     540    ChartSpeed.BottomAxis.Range.UseMax := True;
     541    ChartSpeed.BottomAxis.Range.Max := Length(SpeedSteps);
     542    ChartSpeedLineSeries1.Clear;
     543    for I := 0 to Length(SpeedSteps) - 1 do
     544    if not SpeedSteps[I].Null then
     545      ChartSpeedLineSeries1.AddXY(I, SpeedSteps[I].Average / (1024 * 1024));
     546  end;
     547end;
     548
    524549procedure TFormMain.SaveConfig;
    525550begin
Note: See TracChangeset for help on using the changeset viewer.