{--------------------------------------------------------------------------- The control program for mass-spectrometer MI1201-AGM (c) Copyright Aleksandrov O.E., 2001 Molecular Physics department, USTU, Ekaterinsburg, K-2, 620002, RUSSIA phone 75-47-15 E-mail: aleks@dpt.ustu.ru Программа управления масс-спектрометром МИ1201-АГМ (c) Собственность Александрова О.Е., 2001 620002, Екатеринбург, К-2, УГТУ, Кафедра молекулярной физики тел. 75-47-15 E-mail: aleks@dpt.ustu.ru ----------------------------------------------------------------------------} unit MCAD_MI1201_StatisticInfo; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids; resourcestring rsCount='Число замеров'; rsCurrent='Текущее, мс'; rsMin='Минимальное, мс'; rsAvr='Среднее, мс'; rsMax='Максимальное, мс'; rsCycle='Цикл измерения'; rsPoint='Получение точки'; rsInternal='Операции с данными'; type tStatInfoCol=( cItem, cMin, cAvr, cMax, cCurr, cCount ); tStatInfoRow=( rHeader, rCycle, rPoint, rInternal ); TFormStatisticInfo = class(TForm) LabelPointsNumberTitle: TLabel; LabelPointsNumber: TLabel; CheckBoxOnTop: TCheckBox; sgStatInfo: TStringGrid; lTime: TLabel; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure CheckBoxOnTopClick(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } function GetValue(aRow:tStatInfoRow; aCol:tStatInfoCol):string; procedure SetValue(aRow:tStatInfoRow; aCol:tStatInfoCol; aValue:string); public { Public declarations } property Value[aRow:tStatInfoRow; aCol:tStatInfoCol]:string read GetValue write SetValue; end; var FormStatisticInfo: TFormStatisticInfo; implementation {$R *.DFM} procedure TFormStatisticInfo.FormClose(Sender: TObject; var Action: TCloseAction); begin Action:=caHide; end; procedure TFormStatisticInfo.CheckBoxOnTopClick(Sender: TObject); begin if CheckBoxOnTop.Checked then FormStyle:=fsStayOnTop else FormStyle:=fsNormal; end; procedure TFormStatisticInfo.FormDestroy(Sender: TObject); begin if Self=FormStatisticInfo then FormStatisticInfo:=NIL; end; procedure TFormStatisticInfo.FormCreate(Sender: TObject); begin WITH sgStatInfo.Rows[0] do begin Strings[Ord(cItem)]:=''; Strings[Ord(cCount)]:=rsCount; Strings[Ord(cMin)]:=rsMin; Strings[Ord(cAvr)]:=rsAvr; Strings[Ord(cMax)]:=rsMax; Strings[Ord(cCurr)]:=rsCurrent; end; WITH sgStatInfo.Cols[0] do begin Strings[Ord(rCycle)]:=rsCycle; Strings[Ord(rPoint)]:=rsPoint; Strings[Ord(rInternal)]:=rsInternal; end; end; function TFormStatisticInfo.GetValue(aRow:tStatInfoRow; aCol:tStatInfoCol):string; begin Result:=sgStatInfo.Cells[Ord(aCol),Ord(aRow)]; end; procedure TFormStatisticInfo.SetValue(aRow:tStatInfoRow; aCol:tStatInfoCol; aValue:string); begin if (Ord(aCol)=0) or (Ord(aRow)=0) then Exit; sgStatInfo.Cells[Ord(aCol),Ord(aRow)]:=aValue; end; end.