You've already forked lazarus-ccr
LazStats: Refactor GenRndValsUnit. Add its pdf to chm file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7439 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Binary file not shown.
Binary file not shown.
@ -4,7 +4,7 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
Top = 203
|
Top = 203
|
||||||
Width = 429
|
Width = 429
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderStyle = bsSingle
|
BorderStyle = bsDialog
|
||||||
Caption = 'Generate Random Values'
|
Caption = 'Generate Random Values'
|
||||||
ClientHeight = 349
|
ClientHeight = 349
|
||||||
ClientWidth = 429
|
ClientWidth = 429
|
||||||
@ -108,7 +108,8 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
ClientHeight = 145
|
ClientHeight = 145
|
||||||
ClientWidth = 400
|
ClientWidth = 400
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object Label2: TLabel
|
object LowIntLabel: TLabel
|
||||||
|
Tag = 1
|
||||||
AnchorSideLeft.Control = rbFDistributionValues
|
AnchorSideLeft.Control = rbFDistributionValues
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = rbFlatInteger
|
AnchorSideTop.Control = rbFlatInteger
|
||||||
@ -121,10 +122,11 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
Caption = 'Between '
|
Caption = 'Between '
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Label3: TLabel
|
object AndIntLabel: TLabel
|
||||||
AnchorSideLeft.Control = Label10
|
Tag = 1
|
||||||
|
AnchorSideLeft.Control = FDF2Label
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = Label2
|
AnchorSideTop.Control = LowIntLabel
|
||||||
Left = 297
|
Left = 297
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 6
|
Top = 6
|
||||||
@ -135,9 +137,10 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object LowIntEdit: TEdit
|
object LowIntEdit: TEdit
|
||||||
AnchorSideLeft.Control = Label2
|
Tag = 1
|
||||||
|
AnchorSideLeft.Control = LowIntLabel
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = Label2
|
AnchorSideTop.Control = LowIntLabel
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 228
|
Left = 228
|
||||||
Height = 23
|
Height = 23
|
||||||
@ -150,8 +153,9 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
Text = 'LowIntEdit'
|
Text = 'LowIntEdit'
|
||||||
end
|
end
|
||||||
object HiIntEdit: TEdit
|
object HiIntEdit: TEdit
|
||||||
|
Tag = 1
|
||||||
AnchorSideLeft.Control = FDF2Edit
|
AnchorSideLeft.Control = FDF2Edit
|
||||||
AnchorSideTop.Control = Label2
|
AnchorSideTop.Control = LowIntLabel
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = FDF2Edit
|
AnchorSideRight.Control = FDF2Edit
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
@ -178,19 +182,24 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
OnChange = DistTypeChange
|
OnChange = DistTypeChange
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object Label4: TLabel
|
object LowRealLabel: TLabel
|
||||||
AnchorSideLeft.Control = Label2
|
Tag = 2
|
||||||
|
AnchorSideLeft.Control = LowIntLabel
|
||||||
AnchorSideTop.Control = rbFlatFloatingPoint
|
AnchorSideTop.Control = rbFlatFloatingPoint
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = LowRealEdit
|
||||||
Left = 168
|
Left = 168
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 33
|
Top = 33
|
||||||
Width = 48
|
Width = 48
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.Right = 12
|
||||||
Caption = 'Between '
|
Caption = 'Between '
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Label5: TLabel
|
object AndRealLabel: TLabel
|
||||||
AnchorSideLeft.Control = Label10
|
Tag = 2
|
||||||
|
AnchorSideLeft.Control = FDF2Label
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = LowRealEdit
|
AnchorSideTop.Control = LowRealEdit
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
@ -202,8 +211,9 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object LowRealEdit: TEdit
|
object LowRealEdit: TEdit
|
||||||
|
Tag = 2
|
||||||
AnchorSideLeft.Control = LowIntEdit
|
AnchorSideLeft.Control = LowIntEdit
|
||||||
AnchorSideTop.Control = Label4
|
AnchorSideTop.Control = LowRealLabel
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = LowIntEdit
|
AnchorSideRight.Control = LowIntEdit
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
@ -218,8 +228,9 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
Text = 'LowRealEdit'
|
Text = 'LowRealEdit'
|
||||||
end
|
end
|
||||||
object HiRealEdit: TEdit
|
object HiRealEdit: TEdit
|
||||||
|
Tag = 2
|
||||||
AnchorSideLeft.Control = FDF2Edit
|
AnchorSideLeft.Control = FDF2Edit
|
||||||
AnchorSideTop.Control = Label5
|
AnchorSideTop.Control = AndRealLabel
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = FDF2Edit
|
AnchorSideRight.Control = FDF2Edit
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
@ -260,31 +271,37 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
OnChange = DistTypeChange
|
OnChange = DistTypeChange
|
||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
end
|
end
|
||||||
object Label6: TLabel
|
object MeanLabel: TLabel
|
||||||
AnchorSideLeft.Control = Label4
|
Tag = 3
|
||||||
|
AnchorSideLeft.Control = LowRealLabel
|
||||||
AnchorSideTop.Control = rbNormalZValues
|
AnchorSideTop.Control = rbNormalZValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 168
|
AnchorSideRight.Control = zMeanEdit
|
||||||
|
Left = 183
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 60
|
Top = 60
|
||||||
Width = 44
|
Width = 33
|
||||||
Caption = 'Mean = '
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.Right = 12
|
||||||
|
Caption = 'Mean:'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Label7: TLabel
|
object SDLabel: TLabel
|
||||||
AnchorSideLeft.Control = Label10
|
Tag = 3
|
||||||
|
AnchorSideLeft.Control = FDF2Label
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = rbNormalZValues
|
AnchorSideTop.Control = rbNormalZValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 291
|
Left = 297
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 60
|
Top = 60
|
||||||
Width = 34
|
Width = 23
|
||||||
BorderSpacing.Left = 7
|
BorderSpacing.Left = 7
|
||||||
Caption = 'S.D. = '
|
Caption = 'S.D.:'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object zMeanEdit: TEdit
|
object zMeanEdit: TEdit
|
||||||
|
Tag = 3
|
||||||
AnchorSideLeft.Control = LowRealEdit
|
AnchorSideLeft.Control = LowRealEdit
|
||||||
AnchorSideTop.Control = rbNormalZValues
|
AnchorSideTop.Control = rbNormalZValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
@ -301,6 +318,7 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
Text = 'zMeanEdit'
|
Text = 'zMeanEdit'
|
||||||
end
|
end
|
||||||
object zSDEdit: TEdit
|
object zSDEdit: TEdit
|
||||||
|
Tag = 3
|
||||||
AnchorSideLeft.Control = FDF2Edit
|
AnchorSideLeft.Control = FDF2Edit
|
||||||
AnchorSideTop.Control = rbNormalZValues
|
AnchorSideTop.Control = rbNormalZValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
@ -329,18 +347,23 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
OnChange = DistTypeChange
|
OnChange = DistTypeChange
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
object Label8: TLabel
|
object ChiSqDFLabel: TLabel
|
||||||
AnchorSideLeft.Control = Label4
|
Tag = 4
|
||||||
|
AnchorSideLeft.Control = LowRealLabel
|
||||||
AnchorSideTop.Control = rbChiSquaredValues
|
AnchorSideTop.Control = rbChiSquaredValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 168
|
AnchorSideRight.Control = ChiDFEdit
|
||||||
|
Left = 190
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 87
|
Top = 87
|
||||||
Width = 40
|
Width = 26
|
||||||
Caption = 'D.F. 1 ='
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.Right = 12
|
||||||
|
Caption = 'D.F. :'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object ChiDFEdit: TEdit
|
object ChiDFEdit: TEdit
|
||||||
|
Tag = 4
|
||||||
AnchorSideLeft.Control = zMeanEdit
|
AnchorSideLeft.Control = zMeanEdit
|
||||||
AnchorSideTop.Control = rbChiSquaredValues
|
AnchorSideTop.Control = rbChiSquaredValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
@ -369,31 +392,37 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
OnChange = DistTypeChange
|
OnChange = DistTypeChange
|
||||||
TabOrder = 11
|
TabOrder = 11
|
||||||
end
|
end
|
||||||
object Label9: TLabel
|
object FDF1Label: TLabel
|
||||||
AnchorSideLeft.Control = Label8
|
Tag = 5
|
||||||
|
AnchorSideLeft.Control = ChiSqDFLabel
|
||||||
AnchorSideTop.Control = rbFDistributionValues
|
AnchorSideTop.Control = rbFDistributionValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 168
|
AnchorSideRight.Control = FDF1Edit
|
||||||
|
Left = 184
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 114
|
Top = 114
|
||||||
Width = 40
|
Width = 32
|
||||||
Caption = 'D.F. 1 ='
|
Anchors = [akTop, akRight]
|
||||||
|
BorderSpacing.Right = 12
|
||||||
|
Caption = 'D.F. 1:'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object Label10: TLabel
|
object FDF2Label: TLabel
|
||||||
|
Tag = 5
|
||||||
AnchorSideLeft.Control = FDF1Edit
|
AnchorSideLeft.Control = FDF1Edit
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = rbFDistributionValues
|
AnchorSideTop.Control = rbFDistributionValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 288
|
Left = 292
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 114
|
Top = 114
|
||||||
Width = 40
|
Width = 32
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 12
|
||||||
Caption = 'D.F. 2 ='
|
Caption = 'D.F. 2:'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object FDF1Edit: TEdit
|
object FDF1Edit: TEdit
|
||||||
|
Tag = 5
|
||||||
AnchorSideLeft.Control = ChiDFEdit
|
AnchorSideLeft.Control = ChiDFEdit
|
||||||
AnchorSideTop.Control = rbFDistributionValues
|
AnchorSideTop.Control = rbFDistributionValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
@ -410,7 +439,8 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
Text = 'FDF1Edit'
|
Text = 'FDF1Edit'
|
||||||
end
|
end
|
||||||
object FDF2Edit: TEdit
|
object FDF2Edit: TEdit
|
||||||
AnchorSideLeft.Control = Label10
|
Tag = 5
|
||||||
|
AnchorSideLeft.Control = FDF2Label
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = rbFDistributionValues
|
AnchorSideTop.Control = rbFDistributionValues
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
@ -420,7 +450,7 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
Top = 110
|
Top = 110
|
||||||
Width = 52
|
Width = 52
|
||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 12
|
||||||
BorderSpacing.Right = 12
|
BorderSpacing.Right = 12
|
||||||
BorderSpacing.Bottom = 12
|
BorderSpacing.Bottom = 12
|
||||||
TabOrder = 13
|
TabOrder = 13
|
||||||
@ -448,8 +478,8 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
object ResetBtn: TButton
|
object ResetBtn: TButton
|
||||||
AnchorSideTop.Control = Panel1
|
AnchorSideTop.Control = Panel1
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = CancelBtn
|
AnchorSideRight.Control = ComputeBtn
|
||||||
Left = 136
|
Left = 208
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 54
|
Width = 54
|
||||||
@ -460,27 +490,11 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
OnClick = ResetBtnClick
|
OnClick = ResetBtnClick
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object CancelBtn: TButton
|
|
||||||
AnchorSideTop.Control = Panel1
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = ComputeBtn
|
|
||||||
Left = 198
|
|
||||||
Height = 25
|
|
||||||
Top = 1
|
|
||||||
Width = 62
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Right = 8
|
|
||||||
Cancel = True
|
|
||||||
Caption = 'Cancel'
|
|
||||||
ModalResult = 2
|
|
||||||
TabOrder = 1
|
|
||||||
end
|
|
||||||
object ComputeBtn: TButton
|
object ComputeBtn: TButton
|
||||||
AnchorSideTop.Control = Panel1
|
AnchorSideTop.Control = Panel1
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = ReturnBtn
|
AnchorSideRight.Control = CloseBtn
|
||||||
Left = 268
|
Left = 270
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 76
|
Width = 76
|
||||||
@ -489,22 +503,23 @@ object GenRndValsFrm: TGenRndValsFrm
|
|||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
Caption = 'Compute'
|
Caption = 'Compute'
|
||||||
OnClick = ComputeBtnClick
|
OnClick = ComputeBtnClick
|
||||||
TabOrder = 2
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object ReturnBtn: TButton
|
object CloseBtn: TButton
|
||||||
AnchorSideTop.Control = Panel1
|
AnchorSideTop.Control = Panel1
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
AnchorSideRight.Control = Panel1
|
AnchorSideRight.Control = Panel1
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 352
|
Left = 354
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 61
|
Width = 55
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Return'
|
BorderSpacing.Right = 4
|
||||||
ModalResult = 1
|
Caption = 'Close'
|
||||||
TabOrder = 3
|
ModalResult = 11
|
||||||
|
TabOrder = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object Bevel1: TBevel
|
object Bevel1: TBevel
|
||||||
|
@ -11,6 +11,8 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
TDistType = (dtUnknown, dtFlatInt, dtFlatReal, dtNormal, dtChiSq, dtF);
|
||||||
|
|
||||||
{ TGenRndValsFrm }
|
{ TGenRndValsFrm }
|
||||||
|
|
||||||
TGenRndValsFrm = class(TForm)
|
TGenRndValsFrm = class(TForm)
|
||||||
@ -25,27 +27,26 @@ type
|
|||||||
rbFlatInteger: TRadioButton;
|
rbFlatInteger: TRadioButton;
|
||||||
rbFlatFloatingPoint: TRadioButton;
|
rbFlatFloatingPoint: TRadioButton;
|
||||||
ResetBtn: TButton;
|
ResetBtn: TButton;
|
||||||
CancelBtn: TButton;
|
|
||||||
ComputeBtn: TButton;
|
ComputeBtn: TButton;
|
||||||
ReturnBtn: TButton;
|
CloseBtn: TButton;
|
||||||
ChiDFEdit: TEdit;
|
ChiDFEdit: TEdit;
|
||||||
FDF2Edit: TEdit;
|
FDF2Edit: TEdit;
|
||||||
FDF1Edit: TEdit;
|
FDF1Edit: TEdit;
|
||||||
Label10: TLabel;
|
FDF2Label: TLabel;
|
||||||
Label8: TLabel;
|
ChiSqDFLabel: TLabel;
|
||||||
Label9: TLabel;
|
FDF1Label: TLabel;
|
||||||
zSDEdit: TEdit;
|
zSDEdit: TEdit;
|
||||||
zMeanEdit: TEdit;
|
zMeanEdit: TEdit;
|
||||||
HiRealEdit: TEdit;
|
HiRealEdit: TEdit;
|
||||||
Label5: TLabel;
|
AndRealLabel: TLabel;
|
||||||
Label6: TLabel;
|
MeanLabel: TLabel;
|
||||||
Label7: TLabel;
|
SDLabel: TLabel;
|
||||||
LowRealEdit: TEdit;
|
LowRealEdit: TEdit;
|
||||||
Label4: TLabel;
|
LowRealLabel: TLabel;
|
||||||
LowIntEdit: TEdit;
|
LowIntEdit: TEdit;
|
||||||
HiIntEdit: TEdit;
|
HiIntEdit: TEdit;
|
||||||
Label2: TLabel;
|
LowIntLabel: TLabel;
|
||||||
Label3: TLabel;
|
AndIntLabel: TLabel;
|
||||||
LabelEdit: TEdit;
|
LabelEdit: TEdit;
|
||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
RadioGroup1: TRadioGroup;
|
RadioGroup1: TRadioGroup;
|
||||||
@ -62,8 +63,9 @@ type
|
|||||||
procedure zMeanEditKeyPress(Sender: TObject; var Key: char);
|
procedure zMeanEditKeyPress(Sender: TObject; var Key: char);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
Ncases : integer;
|
Ncases: integer;
|
||||||
DistType : integer;
|
DistType: TDistType;
|
||||||
|
function Validate(out AMsg: String; out AControl: TWinControl): boolean;
|
||||||
public
|
public
|
||||||
{ public declarations }
|
{ public declarations }
|
||||||
end;
|
end;
|
||||||
@ -80,26 +82,29 @@ uses
|
|||||||
|
|
||||||
procedure TGenRndValsFrm.RadioGroup1Click(Sender: TObject);
|
procedure TGenRndValsFrm.RadioGroup1Click(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if RadioGroup1.ItemIndex = 1 then
|
(*
|
||||||
|
if RadioGroup1.ItemIndex = 1 then
|
||||||
|
begin
|
||||||
|
if NoCases <= 0 then
|
||||||
begin
|
begin
|
||||||
if NoCases <= 0 then
|
MessageDlg('There are currently no cases!', mtError, [mbOK], 0);
|
||||||
begin
|
exit;
|
||||||
ShowMessage('Error! There are currently no cases!');
|
|
||||||
exit;
|
|
||||||
end
|
|
||||||
else Ncases := NoCases
|
|
||||||
end
|
end
|
||||||
else NoCasesEdit.SetFocus;
|
else
|
||||||
|
Ncases := NoCases
|
||||||
|
end else
|
||||||
|
NoCasesEdit.SetFocus;
|
||||||
|
*)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.LowIntEditKeyPress(Sender: TObject; var Key: char);
|
procedure TGenRndValsFrm.LowIntEditKeyPress(Sender: TObject; var Key: char);
|
||||||
begin
|
begin
|
||||||
if Ord(Key) = 13 then HiIntEdit.SetFocus;
|
if Key = #13 then HiIntEdit.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.FDF1EditKeyPress(Sender: TObject; var Key: char);
|
procedure TGenRndValsFrm.FDF1EditKeyPress(Sender: TObject; var Key: char);
|
||||||
begin
|
begin
|
||||||
if Ord(Key) = 13 then FDF2Edit.SetFocus;
|
if Key = #13 then FDF2Edit.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.FormCreate(Sender: TObject);
|
procedure TGenRndValsFrm.FormCreate(Sender: TObject);
|
||||||
@ -111,200 +116,398 @@ end;
|
|||||||
|
|
||||||
procedure TGenRndValsFrm.ComputeBtnClick(Sender: TObject);
|
procedure TGenRndValsFrm.ComputeBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
i, j : integer;
|
i, j : integer;
|
||||||
col : integer;
|
col : integer;
|
||||||
RndNo : integer;
|
RndNo : integer;
|
||||||
RealRnd : double;
|
RealRnd : double;
|
||||||
Range : integer;
|
Range : integer;
|
||||||
MinReal, MaxReal : double;
|
MinReal, MaxReal : double;
|
||||||
Mean, StdDev : double;
|
Mean, StdDev : double;
|
||||||
SumX1, SumX2 : double;
|
SumX1, SumX2 : double;
|
||||||
df1, df2 : integer;
|
df1, df2 : integer;
|
||||||
|
C: TWinControl;
|
||||||
|
msg: String;
|
||||||
begin
|
begin
|
||||||
if LabelEdit.Text = '' then
|
if not Validate(msg, C) then begin
|
||||||
begin
|
C.SetFocus;
|
||||||
ShowMessage('Error. Enter a label for the variable.');
|
MessageDlg(msg, mtError, [mbOK], 0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if DistType <= 0 then
|
|
||||||
begin
|
if (RadioGroup1.ItemIndex = 1) then
|
||||||
ShowMessage('First, select a distribution type.');
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
if RadioGroup1.ItemIndex < 0 then
|
|
||||||
begin
|
|
||||||
ShowMessage('Select an option for the number of values to generate.');
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
if (RadioGroup1.ItemIndex = 1) and (NoCasesEdit.Text = '') then
|
|
||||||
begin
|
|
||||||
ShowMessage('Error! Number of cases not specified.');
|
|
||||||
exit;
|
|
||||||
end
|
|
||||||
else Ncases := StrToInt(NoCasesEdit.Text);
|
|
||||||
if NoCases < Ncases then
|
if NoCases < Ncases then
|
||||||
begin
|
begin
|
||||||
OS3MainFrm.DataGrid.RowCount := NCases + 1;
|
OS3MainFrm.DataGrid.RowCount := NCases + 1;
|
||||||
OS3MainFrm.NoCasesEdit.Text := IntToStr(NCases);
|
OS3MainFrm.NoCasesEdit.Text := IntToStr(NCases);
|
||||||
NoCases := Ncases;
|
NoCases := Ncases;
|
||||||
end;
|
end;
|
||||||
DictionaryFrm.DictGrid.ColCount := 8;
|
|
||||||
if NoVariables <= 0 then // a new data file
|
if NoCases <= 0 then
|
||||||
begin
|
begin
|
||||||
OS3MainFrm.DataGrid.ColCount := 2;
|
MessageDlg('There are currently no cases.', mtError, [mbOK], 0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
DictionaryFrm.DictGrid.ColCount := 8;
|
||||||
|
if NoVariables <= 0 then // a new data file
|
||||||
|
begin
|
||||||
|
OS3MainFrm.DataGrid.ColCount := 2;
|
||||||
|
for i := 1 to Ncases do
|
||||||
|
OS3MainFrm.DataGrid.Cells[0,i] := Format('Case %d',[i]);
|
||||||
|
col := 1;
|
||||||
|
DictionaryFrm.DictGrid.RowCount := 1;
|
||||||
|
DictionaryFrm.NewVar(col);
|
||||||
|
DictionaryFrm.DictGrid.Cells[1,col] := LabelEdit.Text;
|
||||||
|
OS3MainFrm.DataGrid.Cells[col,0] := LabelEdit.Text;
|
||||||
|
end
|
||||||
|
else // existing data file
|
||||||
|
begin
|
||||||
|
col := NoVariables + 1;
|
||||||
|
DictionaryFrm.NewVar(col);
|
||||||
|
DictionaryFrm.DictGrid.Cells[1,col] := LabelEdit.Text;
|
||||||
|
OS3MainFrm.DataGrid.Cells[col,0] := LabelEdit.Text;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Randomize;
|
||||||
|
|
||||||
|
case DistType of
|
||||||
|
dtFlatInt:
|
||||||
|
begin // range of integers
|
||||||
|
Range := StrToInt(HiIntEdit.Text) - StrToInt(LowIntEdit.Text);
|
||||||
for i := 1 to Ncases do
|
for i := 1 to Ncases do
|
||||||
OS3MainFrm.DataGrid.Cells[0,i] := format('Case %d',[i]);
|
begin
|
||||||
col := 1;
|
RndNo := random(Range);
|
||||||
DictionaryFrm.DictGrid.RowCount := 1;
|
RndNo := RndNo + StrToInt(LowIntEdit.Text);
|
||||||
DictionaryFrm.NewVar(col);
|
OS3MainFrm.DataGrid.Cells[col,i] := IntToStr(RndNo);
|
||||||
DictionaryFrm.DictGrid.Cells[1,col] := LabelEdit.Text;
|
|
||||||
OS3MainFrm.DataGrid.Cells[col,0] := LabelEdit.Text;
|
|
||||||
end
|
|
||||||
else // existing data file
|
|
||||||
begin
|
|
||||||
col := NoVariables + 1;
|
|
||||||
DictionaryFrm.NewVar(col);
|
|
||||||
DictionaryFrm.DictGrid.Cells[1,col] := LabelEdit.Text;
|
|
||||||
OS3MainFrm.DataGrid.Cells[col,0] := LabelEdit.Text;
|
|
||||||
end;
|
|
||||||
randomize;
|
|
||||||
case DistType of
|
|
||||||
1 : begin // range of integers
|
|
||||||
Range := StrToInt(HiIntEdit.Text) - StrToInt(LowIntEdit.Text);
|
|
||||||
for i := 1 to Ncases do
|
|
||||||
begin
|
|
||||||
RndNo := random(Range);
|
|
||||||
RndNo := RndNo + StrToInt(LowIntEdit.Text);
|
|
||||||
OS3MainFrm.DataGrid.Cells[col,i] := IntToStr(RndNo);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
2 : begin // range of real random numbers
|
end;
|
||||||
MinReal := StrToFloat(LowRealEdit.Text);
|
dtFlatReal:
|
||||||
MaxReal := StrToFloat(HiRealEdit.Text);
|
begin // range of real random numbers
|
||||||
Range := round(MaxReal - MinReal);
|
MinReal := StrToFloat(LowRealEdit.Text);
|
||||||
for i := 1 to Ncases do
|
MaxReal := StrToFloat(HiRealEdit.Text);
|
||||||
begin
|
Range := round(MaxReal - MinReal);
|
||||||
RealRnd := random;
|
for i := 1 to Ncases do
|
||||||
RndNo := random(Range);
|
begin
|
||||||
RealRnd := RndNo + RealRnd + MinReal;
|
RealRnd := random;
|
||||||
OS3MainFrm.DataGrid.Cells[col,i] := format('%8.3f',[RealRnd]);
|
RndNo := random(Range);
|
||||||
end;
|
RealRnd := RndNo + RealRnd + MinReal;
|
||||||
|
OS3MainFrm.DataGrid.Cells[col,i] := format('%.3f',[RealRnd]);
|
||||||
end;
|
end;
|
||||||
3 : begin // normally distributed z score
|
end;
|
||||||
Mean := StrToFloat(zMeanEdit.Text);
|
dtNormal:
|
||||||
StdDev := StrToFloat(zSDEdit.Text);
|
begin // normally distributed z score
|
||||||
for i := 1 to Ncases do
|
Mean := StrToFloat(zMeanEdit.Text);
|
||||||
begin
|
StdDev := StrToFloat(zSDEdit.Text);
|
||||||
RealRnd := RandG(Mean,StdDev);
|
for i := 1 to Ncases do
|
||||||
OS3MainFrm.DataGrid.Cells[col,i] := format('%8.3f',[RealRnd]);
|
begin
|
||||||
end;
|
RealRnd := RandG(Mean, StdDev);
|
||||||
|
OS3MainFrm.DataGrid.Cells[col,i] := format('%.3f',[RealRnd]);
|
||||||
end;
|
end;
|
||||||
4 : begin // Chi square is a sum of df squared normally distributed z scores
|
end;
|
||||||
df1 := StrToInt(ChiDFEdit.Text);
|
dtChiSq:
|
||||||
for i := 1 to Ncases do
|
begin // Chi square is a sum of df squared normally distributed z scores
|
||||||
begin
|
df1 := StrToInt(ChiDFEdit.Text);
|
||||||
SumX1 := 0.0;
|
for i := 1 to Ncases do
|
||||||
for j := 1 to df1 do
|
begin
|
||||||
begin
|
SumX1 := 0.0;
|
||||||
RealRnd := RandG(0.0,1.0);
|
for j := 1 to df1 do
|
||||||
SumX1 := SumX1 + (RealRnd * RealRnd);
|
begin
|
||||||
end;
|
RealRnd := RandG(0.0, 1.0);
|
||||||
OS3MainFrm.DataGrid.Cells[col,i] := format('%8.3f',[SumX1]);
|
SumX1 := SumX1 + sqr(RealRnd);
|
||||||
end;
|
end;
|
||||||
|
OS3MainFrm.DataGrid.Cells[col,i] := format('%.3f', [SumX1]);
|
||||||
end;
|
end;
|
||||||
5 : begin // F ratio is a ratio of two independent chi-squares
|
end;
|
||||||
df1 := StrToInt(FDF1Edit.Text);
|
dtF:
|
||||||
df2 := StrToInt(FDF2Edit.Text);
|
begin // F ratio is a ratio of two independent chi-squares
|
||||||
for i := 1 to Ncases do
|
df1 := StrToInt(FDF1Edit.Text);
|
||||||
begin
|
df2 := StrToInt(FDF2Edit.Text);
|
||||||
SumX1 := 0.0;
|
for i := 1 to Ncases do
|
||||||
SumX2 := 0.0;
|
begin
|
||||||
for j := 1 to df1 do
|
SumX1 := 0.0;
|
||||||
begin
|
SumX2 := 0.0;
|
||||||
RealRnd := RandG(0.0,1.0);
|
for j := 1 to df1 do
|
||||||
SumX1 := SumX1 + (RealRnd * RealRnd);
|
begin
|
||||||
end;
|
RealRnd := RandG(0.0, 1.0);
|
||||||
for j := 1 to df2 do
|
SumX1 := SumX1 + sqr(RealRnd);
|
||||||
begin
|
end;
|
||||||
RealRnd := RandG(0.0,1.0);
|
for j := 1 to df2 do
|
||||||
SumX2 := SumX2 + (RealRnd * RealRnd);
|
begin
|
||||||
end;
|
RealRnd := RandG(0.0, 1.0);
|
||||||
RealRnd := SumX1 / SumX2;
|
SumX2 := SumX2 + sqr(RealRnd);
|
||||||
OS3MainFrm.DataGrid.Cells[col,i] := format('%8.3f',[RealRnd]);
|
end;
|
||||||
end;
|
RealRnd := SumX1 / SumX2;
|
||||||
|
OS3MainFrm.DataGrid.Cells[col,i] := format('%.3f',[RealRnd]);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
NoVariables := col;
|
end;
|
||||||
OS3MainFrm.NoVarsEdit.Text := IntToStr(NoVariables);
|
|
||||||
OS3MainFrm.NoCasesEdit.Text := IntToStr(NoCases);
|
NoVariables := col;
|
||||||
|
OS3MainFrm.NoVarsEdit.Text := IntToStr(NoVariables);
|
||||||
|
OS3MainFrm.NoCasesEdit.Text := IntToStr(NoCases);
|
||||||
|
|
||||||
|
MessageDlg(Format('%d random cases added to grid.', [NCases]), mtInformation, [mbOK], 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.FormShow(Sender: TObject);
|
procedure TGenRndValsFrm.FormShow(Sender: TObject);
|
||||||
var
|
var
|
||||||
w: Integer;
|
w: Integer;
|
||||||
begin
|
begin
|
||||||
w := MaxValue([ResetBtn.Width, CancelBtn.Width, ComputeBtn.Width, ReturnBtn.Width]);
|
w := MaxValue([ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
|
||||||
ResetBtn.Constraints.MinWidth := w;
|
ResetBtn.Constraints.MinWidth := w;
|
||||||
CancelBtn.Constraints.MinWidth := w;
|
ComputeBtn.Constraints.MinWidth := w;
|
||||||
ComputeBtn.Constraints.MinWidth := w;
|
CloseBtn.Constraints.MinWidth := w;
|
||||||
ReturnBtn.Constraints.MinWidth := w;
|
|
||||||
|
|
||||||
ResetBtnClick(self);
|
ResetBtnClick(self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.LowRealEditKeyPress(Sender: TObject; var Key: char);
|
procedure TGenRndValsFrm.LowRealEditKeyPress(Sender: TObject; var Key: char);
|
||||||
begin
|
begin
|
||||||
if Ord(Key) = 13 then HiRealEdit.SetFocus;
|
if Key = #13 then HiRealEdit.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.NoCasesEditExit(Sender: TObject);
|
procedure TGenRndValsFrm.NoCasesEditExit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if RadioGroup1.ItemIndex = 1 then Ncases := StrToInt(NoCasesEdit.Text);
|
if RadioGroup1.ItemIndex = 1 then Ncases := StrToInt(NoCasesEdit.Text);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.DistTypeChange(Sender: TObject);
|
procedure TGenRndValsFrm.DistTypeChange(Sender: TObject);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
selTag: Integer;
|
||||||
begin
|
begin
|
||||||
DistType := (Sender as TRadioButton).Tag;
|
if (Sender = nil) then
|
||||||
|
begin
|
||||||
|
DistType := dtUnknown;
|
||||||
|
selTag := -1;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
DistType := TDistType((Sender as TRadioButton).Tag);
|
||||||
|
selTag := (Sender as TRadioButton).Tag;
|
||||||
|
end;
|
||||||
|
|
||||||
|
for i := 0 to GroupBox1.ControlCount-1 do
|
||||||
|
if not (GroupBox1.Controls[i] is TRadioButton) then
|
||||||
|
GroupBox1.Controls[i].Enabled := GroupBox1.Controls[i].Tag = selTag;
|
||||||
|
|
||||||
case DistType of
|
case DistType of
|
||||||
1 : LowIntEdit.SetFocus;
|
dtFlatInt:
|
||||||
2 : LowRealEdit.SetFocus;
|
LowIntEdit.SetFocus;
|
||||||
3 : zMeanEdit.SetFocus;
|
dtFlatReal:
|
||||||
4 : ChiDFEdit.SetFocus;
|
LowRealEdit.SetFocus;
|
||||||
5 : FDF1Edit.SetFocus;
|
dtNormal:
|
||||||
else
|
zMeanEdit.SetFocus;
|
||||||
|
dtChiSq:
|
||||||
|
ChiDFEdit.SetFocus;
|
||||||
|
dtF:
|
||||||
|
FDF1Edit.SetFocus;
|
||||||
|
dtUnknown:
|
||||||
|
;
|
||||||
|
{
|
||||||
begin
|
begin
|
||||||
ShowMessage('Please select a distribution type before pressing Compute.');
|
MessageDlg('Please select a distribution type before pressing Compute.', mtError, [mbOK], 0);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
raise Exception.Create('Unsupported distribution type.');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.ResetBtnClick(Sender: TObject);
|
procedure TGenRndValsFrm.ResetBtnClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
NoCasesEdit.Text := '';
|
NoCasesEdit.Text := '';
|
||||||
RadioGroup1.ItemIndex := -1;
|
|
||||||
rbFlatInteger.Checked := false;
|
RadioGroup1.ItemIndex := -1;
|
||||||
rbFlatFloatingPoint.Checked := false;
|
rbFlatInteger.Checked := false;
|
||||||
rbNormalZValues.Checked := false;
|
rbFlatFloatingPoint.Checked := false;
|
||||||
rbChiSquaredValues.Checked := false;
|
rbNormalZValues.Checked := false;
|
||||||
rbFDistributionValues.Checked := false;
|
rbChiSquaredValues.Checked := false;
|
||||||
// RadioGroup2.ItemIndex := -1;
|
rbFDistributionValues.Checked := false;
|
||||||
LabelEdit.Text := '';
|
|
||||||
LowIntEdit.Text := '';
|
LabelEdit.Text := '';
|
||||||
HiIntEdit.Text := '';
|
LowIntEdit.Text := '';
|
||||||
LowRealEdit.Text := '';
|
HiIntEdit.Text := '';
|
||||||
HiRealEdit.Text := '';
|
LowRealEdit.Text := '';
|
||||||
zMeanEdit.Text := '';
|
HiRealEdit.Text := '';
|
||||||
zSDEdit.Text := '';
|
zMeanEdit.Text := '';
|
||||||
ChiDFEdit.Text := '';
|
zSDEdit.Text := '';
|
||||||
FDF1Edit.Text := '';
|
ChiDFEdit.Text := '';
|
||||||
FDF2Edit.Text := '';
|
FDF1Edit.Text := '';
|
||||||
DistType := 0;
|
FDF2Edit.Text := '';
|
||||||
|
|
||||||
|
DistType := dtUnknown;
|
||||||
|
DistTypeChange(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TGenRndValsFrm.zMeanEditKeyPress(Sender: TObject; var Key: char);
|
procedure TGenRndValsFrm.zMeanEditKeyPress(Sender: TObject; var Key: char);
|
||||||
begin
|
begin
|
||||||
if Ord(Key) = 13 then zSDEdit.SetFocus;
|
if Key = #13 then zSDEdit.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TGenRndvalsFrm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
|
||||||
|
var
|
||||||
|
x: Double;
|
||||||
|
n: Integer;
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
|
||||||
|
if LabelEdit.Text = '' then
|
||||||
|
begin
|
||||||
|
AControl := LabelEdit;
|
||||||
|
AMsg := 'Enter a label for the variable.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if RadioGroup1.ItemIndex < 0 then
|
||||||
|
begin
|
||||||
|
AControl := RadioGroup1;
|
||||||
|
AMsg := 'Select an option for the number of values to generate.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (RadioGroup1.ItemIndex = 1) then
|
||||||
|
begin
|
||||||
|
if (NoCasesEdit.Text = '') then
|
||||||
|
begin
|
||||||
|
AControl := NoCasesEdit;
|
||||||
|
AMsg := 'Number of cases not specified.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToInt(NoCasesEdit.Text, NCases) or (NCases <= 0) then
|
||||||
|
begin
|
||||||
|
AControl := NoCasesEdit;
|
||||||
|
AMsg := 'Valid positive number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
case DistType of
|
||||||
|
dtUnknown:
|
||||||
|
begin
|
||||||
|
AControl := GroupBox1;
|
||||||
|
AMsg := 'Select a distribution type.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
dtFlatInt:
|
||||||
|
begin
|
||||||
|
if (LowIntEdit.Text = '') or (HiIntEdit.Text = '') then
|
||||||
|
begin
|
||||||
|
if LowIntEdit.Text = '' then
|
||||||
|
AControl := LowIntEdit
|
||||||
|
else
|
||||||
|
AControl := HiIntEdit;
|
||||||
|
AMsg := 'Value required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToInt(LowIntEdit.Text, n) then
|
||||||
|
begin
|
||||||
|
AControl := LowIntEdit;
|
||||||
|
AMsg := 'Valid integer number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToInt(HiIntEdit.Text, n) then
|
||||||
|
begin
|
||||||
|
AControl := HiIntEdit;
|
||||||
|
AMsg := 'Valid integer number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
dtFlatReal:
|
||||||
|
begin
|
||||||
|
if (LowRealEdit.Text = '') or (HiRealEdit.Text = '') then
|
||||||
|
begin
|
||||||
|
if LowRealEdit.Text = '' then
|
||||||
|
AControl := LowRealEdit
|
||||||
|
else
|
||||||
|
AControl := HiRealEdit;
|
||||||
|
AMsg := 'Value required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToFloat(LowRealEdit.Text, x) then
|
||||||
|
begin
|
||||||
|
AControl := LowRealEdit;
|
||||||
|
AMsg := 'Valid number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToFloat(HiRealEdit.Text, x) then
|
||||||
|
begin
|
||||||
|
AControl := HiRealEdit;
|
||||||
|
AMsg := 'Valid number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
dtNormal:
|
||||||
|
begin
|
||||||
|
if (zMeanEdit.Text = '') or (zSDEdit.Text = '') then
|
||||||
|
begin
|
||||||
|
if zMeanEdit.Text = '' then
|
||||||
|
AControl := zMeanEdit
|
||||||
|
else
|
||||||
|
AControl := zSDEdit;
|
||||||
|
AMsg := 'Value required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToFloat(zMeanEdit.Text, x) then
|
||||||
|
begin
|
||||||
|
AControl := zMeanEdit;
|
||||||
|
AMsg := 'Valid number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToFloat(zSDEdit.Text, x) or (x <= 0) then
|
||||||
|
begin
|
||||||
|
AControl := zSDEdit;
|
||||||
|
AMsg := 'Valid positive number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
dtChiSq:
|
||||||
|
begin
|
||||||
|
if (ChiDFEdit.Text = '') then
|
||||||
|
begin
|
||||||
|
AControl := ChiDFEdit;
|
||||||
|
AMsg := 'Value required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToInt(ChiDFEdit.Text, n) or (n <= 0)then
|
||||||
|
begin
|
||||||
|
AControl := ChiDFEdit;
|
||||||
|
AMsg := 'Valid positive number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
dtF:
|
||||||
|
begin
|
||||||
|
if (FDF1Edit.Text = '') or (FDF2Edit.Text = '') then
|
||||||
|
begin
|
||||||
|
if (FDF1Edit.Text = '') then
|
||||||
|
AControl := FDF1Edit
|
||||||
|
else
|
||||||
|
AControl := FDF2Edit;
|
||||||
|
AMsg := 'Value required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToInt(FDF1Edit.Text, n) or (n <= 0)then
|
||||||
|
begin
|
||||||
|
AControl := FDF1Edit;
|
||||||
|
AMsg := 'Valid positive number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if not TryStrToInt(FDF2Edit.Text, n) or (n <= 0)then
|
||||||
|
begin
|
||||||
|
AControl := FDF2Edit;
|
||||||
|
AMsg := 'Valid positive number required.';
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
@ -91,7 +91,7 @@ object GenSeqFrm: TGenSeqFrm
|
|||||||
Top = 6
|
Top = 6
|
||||||
Width = 80
|
Width = 80
|
||||||
Caption = ' '
|
Caption = ' '
|
||||||
TabOrder = 1
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object NoCasesEdit: TEdit
|
object NoCasesEdit: TEdit
|
||||||
Left = 129
|
Left = 129
|
||||||
@ -100,7 +100,7 @@ object GenSeqFrm: TGenSeqFrm
|
|||||||
Width = 80
|
Width = 80
|
||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
BorderSpacing.Left = 3
|
BorderSpacing.Left = 3
|
||||||
TabOrder = 0
|
TabOrder = 1
|
||||||
Text = 'NoCasesEdit'
|
Text = 'NoCasesEdit'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -162,7 +162,7 @@ object GenSeqFrm: TGenSeqFrm
|
|||||||
BorderSpacing.Bottom = 8
|
BorderSpacing.Bottom = 8
|
||||||
Caption = 'Close'
|
Caption = 'Close'
|
||||||
ModalResult = 11
|
ModalResult = 11
|
||||||
TabOrder = 4
|
TabOrder = 6
|
||||||
end
|
end
|
||||||
object ComputeBtn: TButton
|
object ComputeBtn: TButton
|
||||||
AnchorSideTop.Control = CloseBtn
|
AnchorSideTop.Control = CloseBtn
|
||||||
@ -191,7 +191,7 @@ object GenSeqFrm: TGenSeqFrm
|
|||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
Caption = 'Reset'
|
Caption = 'Reset'
|
||||||
OnClick = ResetBtnClick
|
OnClick = ResetBtnClick
|
||||||
TabOrder = 6
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object Bevel1: TBevel
|
object Bevel1: TBevel
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
|
Reference in New Issue
Block a user