Inherit ABCLogLinUnit from BasicStatsReportFormUnit

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7916 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-12-02 23:35:42 +00:00
parent 0e430a07bc
commit 013f93a05f
6 changed files with 737 additions and 809 deletions

View File

@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="12"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Scaled Value="True"/> <Scaled Value="True"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
@ -97,7 +99,6 @@
</PublishOptions> </PublishOptions>
<RunParams> <RunParams>
<FormatVersion Value="2"/> <FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams> </RunParams>
<RequiredPackages Count="7"> <RequiredPackages Count="7">
<Item1> <Item1>
@ -597,7 +598,7 @@
<Unit61> <Unit61>
<Filename Value="forms\analysis\cross-classification\loglinscreenunit.pas"/> <Filename Value="forms\analysis\cross-classification\loglinscreenunit.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="LogLinScreenFrm"/> <ComponentName Value="LogLinScreenForm"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="LogLinScreenUnit"/> <UnitName Value="LogLinScreenUnit"/>
@ -613,7 +614,7 @@
<Unit63> <Unit63>
<Filename Value="forms\analysis\cross-classification\abcloglinunit.pas"/> <Filename Value="forms\analysis\cross-classification\abcloglinunit.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="ABCLogLinearFrm"/> <ComponentName Value="ABCLogLinearForm"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="ABCLogLinUnit"/> <UnitName Value="ABCLogLinUnit"/>

View File

@ -1,530 +1,465 @@
object ABCLogLinearFrm: TABCLogLinearFrm inherited ABCLogLinearForm: TABCLogLinearForm
Left = 596 Left = 596
Height = 432 Height = 408
Top = 216 Top = 216
Width = 395 Width = 854
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/html/AxBxCLogLinear.htm' HelpKeyword = 'html/html/AxBxCLogLinear.htm'
AutoSize = True
Caption = 'Log Linear Analysis for AxBxC Classification Table' Caption = 'Log Linear Analysis for AxBxC Classification Table'
ClientHeight = 432 ClientHeight = 408
ClientWidth = 395 ClientWidth = 854
OnActivate = FormActivate inherited ParamsPanel: TPanel
OnCreate = FormCreate Height = 392
OnShow = FormShow Width = 376
Position = poMainFormCenter ClientHeight = 392
LCLVersion = '2.1.0.0' ClientWidth = 376
object ResetBtn: TButton inherited CloseBtn: TButton
AnchorSideRight.Control = ComputeBtn Left = 321
AnchorSideBottom.Control = Owner Top = 367
AnchorSideBottom.Side = asrBottom TabOrder = 5
Left = 186
Height = 25
Top = 399
Width = 54
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Reset'
OnClick = ResetBtnClick
TabOrder = 3
end
object ComputeBtn: TButton
AnchorSideRight.Control = CloseBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 248
Height = 25
Top = 399
Width = 76
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Compute'
OnClick = ComputeBtnClick
TabOrder = 4
end
object CloseBtn: TButton
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 332
Height = 25
Top = 399
Width = 55
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Close'
ModalResult = 11
TabOrder = 5
end
object HelpBtn: TButton
Tag = 101
AnchorSideRight.Control = ResetBtn
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 127
Height = 25
Top = 399
Width = 51
Anchors = [akRight, akBottom]
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Help'
OnClick = HelpBtnClick
TabOrder = 2
end
object Notebook1: TNotebook
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = FileFromGrp
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Bevel1
Left = 8
Height = 316
Top = 67
Width = 379
PageIndex = 0
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
TabOrder = 1
object Page1: TPage
object Label3: TLabel
AnchorSideLeft.Control = RowVarEdit
AnchorSideBottom.Control = RowVarEdit
Left = 211
Height = 15
Top = 8
Width = 67
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Row Variable'
ParentColor = False
end
object Label4: TLabel
AnchorSideLeft.Control = ColVarEdit
AnchorSideBottom.Control = ColVarEdit
Left = 211
Height = 15
Top = 84
Width = 87
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Column Variable'
ParentColor = False
end
object Label5: TLabel
AnchorSideLeft.Control = SliceVarEdit
AnchorSideBottom.Control = SliceVarEdit
Left = 211
Height = 15
Top = 160
Width = 68
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Slice Variable'
ParentColor = False
end
object Label6: TLabel
AnchorSideLeft.Control = FreqVarEdit
AnchorSideBottom.Control = FreqVarEdit
Left = 211
Height = 15
Top = 236
Width = 99
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Frequency Variable'
ParentColor = False
end
object VarList: TListBox
AnchorSideLeft.Control = Page1
AnchorSideTop.Control = Page1
AnchorSideRight.Control = RowInBtn
AnchorSideBottom.Control = Page1
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 316
Top = 0
Width = 167
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Right = 8
ItemHeight = 0
OnSelectionChange = VarListSelectionChange
TabOrder = 0
end
object RowInBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 175
Height = 28
Top = 0
Width = 28
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = RowInBtnClick
Spacing = 0
TabOrder = 1
end
object RowOutBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = RowInBtn
AnchorSideTop.Side = asrBottom
Left = 175
Height = 28
Top = 32
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = RowOutBtnClick
Spacing = 0
TabOrder = 2
end
object ColInBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = RowOutBtn
AnchorSideTop.Side = asrBottom
Left = 175
Height = 28
Top = 76
Width = 28
BorderSpacing.Top = 16
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = ColInBtnClick
Spacing = 0
TabOrder = 4
end
object ColOutBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ColInBtn
AnchorSideTop.Side = asrBottom
Left = 175
Height = 28
Top = 108
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = ColOutBtnClick
Spacing = 0
TabOrder = 5
end
object SliceBtnIn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ColOutBtn
AnchorSideTop.Side = asrBottom
Left = 175
Height = 28
Top = 152
Width = 28
BorderSpacing.Top = 16
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = SliceBtnInClick
Spacing = 0
TabOrder = 7
end
object SliceBtnOut: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = SliceBtnIn
AnchorSideTop.Side = asrBottom
Left = 175
Height = 28
Top = 184
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = SliceBtnOutClick
Spacing = 0
TabOrder = 8
end
object FreqInBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = SliceBtnOut
AnchorSideTop.Side = asrBottom
Left = 175
Height = 28
Top = 228
Width = 28
BorderSpacing.Top = 16
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = FreqInBtnClick
Spacing = 0
TabOrder = 10
end
object FreqOutBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = FreqInBtn
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 175
Height = 28
Top = 260
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = FreqOutBtnClick
Spacing = 0
TabOrder = 11
end
object RowVarEdit: TEdit
AnchorSideLeft.Control = RowInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = RowOutBtn
AnchorSideBottom.Side = asrBottom
Left = 211
Height = 23
Top = 25
Width = 168
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 3
Text = 'RowVarEdit'
end
object ColVarEdit: TEdit
AnchorSideLeft.Control = ColInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ColOutBtn
AnchorSideBottom.Side = asrBottom
Left = 211
Height = 23
Top = 101
Width = 168
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 6
Text = 'ColVarEdit'
end
object SliceVarEdit: TEdit
AnchorSideLeft.Control = SliceBtnIn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = SliceBtnOut
AnchorSideBottom.Side = asrBottom
Left = 211
Height = 23
Top = 177
Width = 168
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 9
Text = 'SliceVarEdit'
end
object FreqVarEdit: TEdit
AnchorSideLeft.Control = FreqInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = FreqOutBtn
AnchorSideBottom.Side = asrBottom
Left = 211
Height = 23
Top = 253
Width = 168
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 12
Text = 'FreqVarEdit'
end
end end
object Page2: TPage inherited ComputeBtn: TButton
object Label1: TLabel Left = 237
AnchorSideLeft.Control = Page2 Top = 367
AnchorSideTop.Control = NRowsEdit TabOrder = 4
AnchorSideTop.Side = asrCenter end
Left = 0 inherited ResetBtn: TButton
Height = 15 Left = 175
Top = 4 Top = 367
Width = 67 TabOrder = 3
Caption = 'No. of Rows:' end
ParentColor = False inherited HelpBtn: TButton
Tag = 101
Left = 116
Top = 367
TabOrder = 2
end
inherited ButtonBevel: TBevel
Top = 351
Width = 376
end
object FileFromGrp: TRadioGroup[5]
AnchorSideLeft.Control = ParamsPanel
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ParamsPanel
Left = 7
Height = 51
Top = 0
Width = 362
AutoFill = True
AutoSize = True
Caption = 'Enter Data From:'
ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 24
ChildSizing.VerticalSpacing = 2
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 31
ClientWidth = 358
Columns = 2
Items.Strings = (
'File Data in the Main Grid'
'Data Entered on this Form'
)
OnClick = FileFromGrpClick
TabOrder = 0
end
object Notebook: TNotebook[6]
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = FileFromGrp
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonBevel
Left = 0
Height = 284
Top = 67
Width = 376
PageIndex = 1
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 16
TabOrder = 1
object Page1: TPage
object Label3: TLabel
AnchorSideLeft.Control = RowVarEdit
AnchorSideBottom.Control = RowVarEdit
Left = 210
Height = 15
Top = 8
Width = 67
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Row Variable'
ParentColor = False
end
object Label4: TLabel
AnchorSideLeft.Control = ColVarEdit
AnchorSideBottom.Control = ColVarEdit
Left = 210
Height = 15
Top = 84
Width = 87
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Column Variable'
ParentColor = False
end
object Label5: TLabel
AnchorSideLeft.Control = SliceVarEdit
AnchorSideBottom.Control = SliceVarEdit
Left = 210
Height = 15
Top = 160
Width = 68
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Slice Variable'
ParentColor = False
end
object Label6: TLabel
AnchorSideLeft.Control = FreqVarEdit
AnchorSideBottom.Control = FreqVarEdit
Left = 210
Height = 15
Top = 236
Width = 99
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2
Caption = 'Frequency Variable'
ParentColor = False
end
object VarList: TListBox
AnchorSideLeft.Control = Page1
AnchorSideTop.Control = Page1
AnchorSideRight.Control = RowInBtn
AnchorSideBottom.Control = Page1
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 292
Top = 0
Width = 166
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Right = 8
ItemHeight = 0
OnDblClick = VarListDblClick
OnSelectionChange = VarListSelectionChange
TabOrder = 0
end
object RowInBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList
Left = 174
Height = 28
Top = 0
Width = 28
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = RowInBtnClick
Spacing = 0
TabOrder = 1
end
object RowOutBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = RowInBtn
AnchorSideTop.Side = asrBottom
Left = 174
Height = 28
Top = 32
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = RowOutBtnClick
Spacing = 0
TabOrder = 2
end
object ColInBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = RowOutBtn
AnchorSideTop.Side = asrBottom
Left = 174
Height = 28
Top = 76
Width = 28
BorderSpacing.Top = 16
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = ColInBtnClick
Spacing = 0
TabOrder = 4
end
object ColOutBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ColInBtn
AnchorSideTop.Side = asrBottom
Left = 174
Height = 28
Top = 108
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = ColOutBtnClick
Spacing = 0
TabOrder = 5
end
object SliceBtnIn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ColOutBtn
AnchorSideTop.Side = asrBottom
Left = 174
Height = 28
Top = 152
Width = 28
BorderSpacing.Top = 16
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = SliceBtnInClick
Spacing = 0
TabOrder = 7
end
object SliceBtnOut: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = SliceBtnIn
AnchorSideTop.Side = asrBottom
Left = 174
Height = 28
Top = 184
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = SliceBtnOutClick
Spacing = 0
TabOrder = 8
end
object FreqInBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = SliceBtnOut
AnchorSideTop.Side = asrBottom
Left = 174
Height = 28
Top = 228
Width = 28
BorderSpacing.Top = 16
Images = MainDataModule.ImageList
ImageIndex = 1
OnClick = FreqInBtnClick
Spacing = 0
TabOrder = 10
end
object FreqOutBtn: TBitBtn
AnchorSideLeft.Control = Page1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = FreqInBtn
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 174
Height = 28
Top = 260
Width = 28
BorderSpacing.Top = 4
Enabled = False
Images = MainDataModule.ImageList
ImageIndex = 0
OnClick = FreqOutBtnClick
Spacing = 0
TabOrder = 11
end
object RowVarEdit: TEdit
AnchorSideLeft.Control = RowInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = RowOutBtn
AnchorSideBottom.Side = asrBottom
Left = 210
Height = 23
Top = 25
Width = 166
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 3
Text = 'RowVarEdit'
end
object ColVarEdit: TEdit
AnchorSideLeft.Control = ColInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ColOutBtn
AnchorSideBottom.Side = asrBottom
Left = 210
Height = 23
Top = 101
Width = 166
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 6
Text = 'ColVarEdit'
end
object SliceVarEdit: TEdit
AnchorSideLeft.Control = SliceBtnIn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = SliceBtnOut
AnchorSideBottom.Side = asrBottom
Left = 210
Height = 23
Top = 177
Width = 166
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 9
Text = 'SliceVarEdit'
end
object FreqVarEdit: TEdit
AnchorSideLeft.Control = FreqInBtn
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Page1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = FreqOutBtn
AnchorSideBottom.Side = asrBottom
Left = 210
Height = 23
Top = 253
Width = 166
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Bottom = 12
ReadOnly = True
TabOrder = 12
Text = 'FreqVarEdit'
end
end end
object Label2: TLabel object Page2: TPage
AnchorSideLeft.Control = NRowsEdit object Label1: TLabel
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Control = Page2
AnchorSideTop.Control = Label1 AnchorSideTop.Control = NRowsEdit
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 134 Left = 0
Height = 15 Height = 15
Top = 4 Top = 4
Width = 65 Width = 67
BorderSpacing.Left = 16 Caption = 'No. of Rows:'
Caption = 'No. of Cols.:' ParentColor = False
ParentColor = False end
end object Label2: TLabel
object Label7: TLabel AnchorSideLeft.Control = NRowsEdit
AnchorSideLeft.Control = NColsEdit AnchorSideLeft.Side = asrBottom
AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = Label1
AnchorSideTop.Control = Label2 AnchorSideTop.Side = asrCenter
AnchorSideTop.Side = asrCenter Left = 134
Left = 270 Height = 15
Height = 15 Top = 4
Top = 4 Width = 65
Width = 68 BorderSpacing.Left = 16
BorderSpacing.Left = 16 Caption = 'No. of Cols.:'
Caption = 'No. of Slices:' ParentColor = False
ParentColor = False end
end object Label7: TLabel
object NRowsEdit: TEdit AnchorSideLeft.Control = NColsEdit
AnchorSideLeft.Control = Label1 AnchorSideLeft.Side = asrBottom
AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = Label2
AnchorSideTop.Control = Page2 AnchorSideTop.Side = asrCenter
Left = 75 Left = 270
Height = 23 Height = 15
Top = 0 Top = 4
Width = 43 Width = 68
Alignment = taRightJustify BorderSpacing.Left = 16
BorderSpacing.Left = 8 Caption = 'No. of Slices:'
OnKeyPress = NRowsEditKeyPress ParentColor = False
TabOrder = 0 end
Text = 'NRowsEdit' object NRowsEdit: TEdit
end AnchorSideLeft.Control = Label1
object NColsEdit: TEdit AnchorSideLeft.Side = asrBottom
AnchorSideLeft.Control = Label2 AnchorSideTop.Control = Page2
AnchorSideLeft.Side = asrBottom Left = 75
AnchorSideTop.Control = Page2 Height = 23
Left = 207 Top = 0
Height = 23 Width = 43
Top = 0 Alignment = taRightJustify
Width = 47 BorderSpacing.Left = 8
Alignment = taRightJustify OnKeyPress = NRowsEditKeyPress
BorderSpacing.Left = 8 TabOrder = 0
OnKeyPress = NColsEditKeyPress Text = 'NRowsEdit'
TabOrder = 1 end
Text = 'NColsEdit' object NColsEdit: TEdit
end AnchorSideLeft.Control = Label2
object Grid: TStringGrid AnchorSideLeft.Side = asrBottom
AnchorSideLeft.Control = Page2 AnchorSideTop.Control = Page2
AnchorSideTop.Control = NRowsEdit Left = 207
AnchorSideTop.Side = asrBottom Height = 23
AnchorSideRight.Control = Page2 Top = 0
AnchorSideRight.Side = asrBottom Width = 47
AnchorSideBottom.Control = Page2 Alignment = taRightJustify
AnchorSideBottom.Side = asrBottom BorderSpacing.Left = 8
Left = 0 OnKeyPress = NColsEditKeyPress
Height = 339 TabOrder = 1
Top = 31 Text = 'NColsEdit'
Width = 444 end
Anchors = [akTop, akLeft, akRight, akBottom] object Grid: TStringGrid
BorderSpacing.Top = 8 AnchorSideLeft.Control = Page2
ColCount = 2 AnchorSideTop.Control = NRowsEdit
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goTabs, goSmoothScroll] AnchorSideTop.Side = asrBottom
RowCount = 2 AnchorSideRight.Control = Page2
TabOrder = 2 AnchorSideRight.Side = asrBottom
end AnchorSideBottom.Control = Page2
object NslicesEdit: TEdit AnchorSideBottom.Side = asrBottom
AnchorSideLeft.Control = Label7 Left = 0
AnchorSideLeft.Side = asrBottom Height = 253
AnchorSideTop.Control = Page2 Top = 31
Left = 346 Width = 376
Height = 23 Anchors = [akTop, akLeft, akRight, akBottom]
Top = 0 BorderSpacing.Top = 8
Width = 39 ColCount = 4
Alignment = taRightJustify FixedCols = 3
BorderSpacing.Left = 8 MouseWheelOption = mwGrid
OnKeyPress = NslicesEditKeyPress Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goTabs, goThumbTracking, goSmoothScroll]
TabOrder = 3 RowCount = 2
Text = 'NslicesEdit' TabOrder = 3
end
object NslicesEdit: TEdit
AnchorSideLeft.Control = Label7
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Page2
Left = 346
Height = 23
Top = 0
Width = 39
Alignment = taRightJustify
BorderSpacing.Left = 8
OnKeyPress = NslicesEditKeyPress
TabOrder = 2
Text = 'NslicesEdit'
end
end end
end end
end end
object FileFromGrp: TRadioGroup inherited ParamsSplitter: TSplitter
AnchorSideLeft.Control = Owner Left = 388
AnchorSideTop.Control = Owner Height = 408
Left = 8
Height = 51
Top = 8
Width = 362
AutoFill = True
AutoSize = True
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'Enter Data From:'
ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 24
ChildSizing.VerticalSpacing = 2
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 31
ClientWidth = 358
Columns = 2
Items.Strings = (
'File Data in the Main Grid'
'Data Entered on this Form'
)
OnClick = FileFromGrpClick
TabOrder = 0
end
object Bevel1: TBevel
AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = CloseBtn
Left = 0
Height = 8
Top = 383
Width = 395
Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine
end
object Bevel2: TBevel
Left = 1
Height = 12
Top = 434
Width = 10
Shape = bsSpacer
end end
end end

View File

@ -7,19 +7,17 @@ unit ABCLogLinUnit;
interface interface
uses uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
ExtCtrls, StdCtrls, Buttons, Grids, ExtCtrls, StdCtrls, Buttons, Grids,
OutputUnit, MainUnit, Globals, DataProcs, ContextHelpUnit; MainUnit, Globals, DataProcs, BasicStatsReportFormUnit;
type type
{ TABCLogLinearFrm } { TABCLogLinearForm }
TABCLogLinearFrm = class(TForm) TABCLogLinearForm = class(TBasicStatsReportForm)
Bevel1: TBevel;
Bevel2: TBevel; Bevel2: TBevel;
HelpBtn: TButton; Notebook: TNotebook;
Notebook1: TNotebook;
Page1: TPage; Page1: TPage;
Page2: TPage; Page2: TPage;
RowInBtn: TBitBtn; RowInBtn: TBitBtn;
@ -32,9 +30,6 @@ type
FreqOutBtn: TBitBtn; FreqOutBtn: TBitBtn;
NslicesEdit: TEdit; NslicesEdit: TEdit;
Label7: TLabel; Label7: TLabel;
ResetBtn: TButton;
ComputeBtn: TButton;
CloseBtn: TButton;
NRowsEdit: TEdit; NRowsEdit: TEdit;
NColsEdit: TEdit; NColsEdit: TEdit;
RowVarEdit: TEdit; RowVarEdit: TEdit;
@ -52,26 +47,20 @@ type
FileFromGrp: TRadioGroup; FileFromGrp: TRadioGroup;
procedure ColInBtnClick(Sender: TObject); procedure ColInBtnClick(Sender: TObject);
procedure ColOutBtnClick(Sender: TObject); procedure ColOutBtnClick(Sender: TObject);
procedure ComputeBtnClick(Sender: TObject);
procedure FileFromGrpClick(Sender: TObject); procedure FileFromGrpClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FreqInBtnClick(Sender: TObject); procedure FreqInBtnClick(Sender: TObject);
procedure FreqOutBtnClick(Sender: TObject); procedure FreqOutBtnClick(Sender: TObject);
procedure NColsEditKeyPress(Sender: TObject; var Key: char); procedure NColsEditKeyPress(Sender: TObject; var Key: char);
procedure NRowsEditKeyPress(Sender: TObject; var Key: char); procedure NRowsEditKeyPress(Sender: TObject; var Key: char);
procedure NslicesEditKeyPress(Sender: TObject; var Key: char); procedure NslicesEditKeyPress(Sender: TObject; var Key: char);
procedure ResetBtnClick(Sender: TObject);
procedure HelpBtnClick(Sender: TObject);
procedure RowInBtnClick(Sender: TObject); procedure RowInBtnClick(Sender: TObject);
procedure RowOutBtnClick(Sender: TObject); procedure RowOutBtnClick(Sender: TObject);
procedure SliceBtnInClick(Sender: TObject); procedure SliceBtnInClick(Sender: TObject);
procedure SliceBtnOutClick(Sender: TObject); procedure SliceBtnOutClick(Sender: TObject);
procedure VarListDblClick(Sender: TObject);
procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean);
private private
{ private declarations }
FAutoSized: Boolean;
procedure ModelEffect( procedure ModelEffect(
Nrows, Ncols, Nslices: integer; Nrows, Ncols, Nslices: integer;
const Data: DblDyneCube; const Data: DblDyneCube;
@ -95,200 +84,56 @@ type
procedure PrintMatrix(const X: DblDyneMat; procedure PrintMatrix(const X: DblDyneMat;
Nrows, Ncols: integer; Title: string; AReport: TStrings); Nrows, Ncols: integer; Title: string; AReport: TStrings);
procedure UpdateBtnStates; protected
procedure AdjustConstraints; override;
procedure Compute; override;
procedure UpdateBtnStates; override;
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override;
public public
{ public declarations } procedure Reset; override;
end; end;
var var
ABCLogLinearFrm: TABCLogLinearFrm; ABCLogLinearForm: TABCLogLinearForm;
implementation implementation
{$R *.lfm}
uses uses
Math; Math,
GridProcs;
{ TABCLogLinearFrm }
procedure TABCLogLinearFrm.ResetBtnClick(Sender: TObject); { TABCLogLinearForm }
var
i: integer; procedure TABCLogLinearForm.AdjustConstraints;
begin begin
Grid.ColCount := 4; inherited;
Grid.RowCount := 2;
Grid.Cells[0,0] := 'ROW'; ParamsPanel.Constraints.MinWidth := MaxValue([
Grid.Cells[1,0] := 'COL'; FileFromGrp.Width,
Grid.Cells[2,0] := 'SLICE'; NSlicesEdit.Left + NSlicesEdit.Width,
Grid.Cells[3,0] := 'FREQ.'; 4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left
VarList.Clear; ]);
for i := 1 to NoVariables do ParamsPanel.Constraints.MinHeight :=
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); FileFromGrp.Height + NoteBook.BorderSpacing.Top +
RowVarEdit.Text := ''; FreqOutBtn.Top + FreqOutBtn.Height + ButtonBevel.Height +
ColVarEdit.Text := ''; Closebtn.BorderSpacing.Top + CloseBtn.Height;
SliceVarEdit.Text := '';
FreqVarEdit.Text := '';
NRowsEdit.Text := '';
NColsEdit.Text := '';
NSlicesEdit.Text := '';
FileFromGrp.ItemIndex := -1;
Notebook1.Hide;
UpdateBtnStates;
end; end;
procedure TABCLogLinearFrm.HelpBtnClick(Sender: TObject);
procedure TABCLogLinearForm.FileFromGrpClick(Sender: TObject);
begin begin
if ContextHelpForm = nil then Notebook.Show;
Application.CreateForm(TContextHelpForm, ContextHelpForm); Notebook.PageIndex := fileFromGrp.ItemIndex;
ContextHelpForm.HelpMessage((Sender as TButton).tag);
end; end;
procedure TABCLogLinearFrm.RowInBtnClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if (index > -1) and (RowVarEdit.Text = '') then
begin
RowVarEdit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TABCLogLinearFrm.RowOutBtnClick(Sender: TObject); procedure TABCLogLinearForm.FreqInBtnClick(Sender: TObject);
begin
if RowVarEdit.Text <> '' then
begin
VarList.Items.Add(RowVarEdit.Text);
RowVarEdit.Text := '';
end;
UpdateBtnStates;
end;
procedure TABCLogLinearFrm.SliceBtnInClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if (index > -1) and (SliceVarEdit.Text = '') then
begin
SliceVarEdit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TABCLogLinearFrm.SliceBtnOutClick(Sender: TObject);
begin
if SliceVarEdit.Text <> '' then
begin
VarList.Items.Add(SliceVarEdit.Text);
SliceVarEdit.Text := '';
end;
end;
procedure TABCLogLinearFrm.VarListSelectionChange(Sender: TObject;
User: boolean);
begin
UpdateBtnStates;
end;
procedure TABCLogLinearFrm.FileFromGrpClick(Sender: TObject);
begin
NoteBook1.Show;
NoteBook1.PageIndex := fileFromGrp.ItemIndex;
{
if FileFromGrp.ItemIndex = 0 then // file from main form
begin
VarList.Visible := true;
RowInBtn.Visible := true;
RowOutBtn.Visible := false;
ColInBtn.Visible := true;
ColOutBtn.Visible := false;
SliceBtnIn.Visible := true;
SliceBtnOut.Visible := false;
FreqInBtn.Visible := true;
FreqOutBtn.Visible := false;
Label4.Visible := true;
Label5.Visible := true;
Label6.Visible := true;
Label3.Visible := true;
RowVarEdit.Visible := true;
ColVarEdit.Visible := true;
SliceVarEdit.Visible := true;
FreqVarEdit.Visible := true;
Label1.Visible := false;
Label2.Visible := false;
Label7.Visible := false;
NRowsEdit.Visible := false;
NColsEdit.Visible := false;
NSlicesEdit.Visible := false;
Grid.Visible := false;
end;
if FileFromGrp.ItemIndex = 1 then // data from this form
begin
VarList.Visible := false;
RowInBtn.Visible := false;
RowOutBtn.Visible := false;
ColInBtn.Visible := false;
ColOutBtn.Visible := false;
SliceBtnIn.Visible := false;
SliceBtnOut.Visible := false;
FreqInBtn.Visible := false;
FreqOutBtn.Visible := false;
Label4.Visible := false;
Label5.Visible := false;
Label6.Visible := false;
Label3.Visible := false;
RowVarEdit.Visible := false;
ColVarEdit.Visible := false;
SliceVarEdit.Visible := false;
FreqVarEdit.Visible := false;
Label1.Visible := true;
Label2.Visible := true;
Label7.Visible := true;
NRowsEdit.Visible := true;
NColsEdit.Visible := true;
NSlicesEdit.Visible := true;
Grid.Visible := true;
end;
}
end;
procedure TABCLogLinearFrm.FormActivate(Sender: TObject);
var
w: Integer;
begin
if FAutoSized then
exit;
w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
HelpBtn.Constraints.MinWidth := w;
ResetBtn.Constraints.MinWidth := w;
ComputeBtn.Constraints.MinWidth := w;
CloseBtn.Constraints.MinWidth := w;
VarList.Constraints.MinHeight := FreqOutBtn.Top + FreqOutBtn.Height - VarList.Top;
Grid.Constraints.MinHeight := FreqOutBtn.Top + FreqOutBtn.Height - Grid.Top;
Constraints.MinWidth := Width;
Constraints.MinHeight := Height;
FAutoSized := true;
end;
procedure TABCLogLinearFrm.FormCreate(Sender: TObject);
begin
Assert(OS3MainFrm <> nil);
end;
procedure TABCLogLinearFrm.FormShow(Sender: TObject);
begin
ResetBtnClick(Self);
end;
procedure TABCLogLinearFrm.FreqInBtnClick(Sender: TObject);
var var
index: integer; index: integer;
begin begin
@ -301,7 +146,7 @@ begin
UpdateBtnStates; UpdateBtnStates;
end; end;
procedure TABCLogLinearFrm.FreqOutBtnClick(Sender: TObject); procedure TABCLogLinearForm.FreqOutBtnClick(Sender: TObject);
begin begin
if FreqVarEdit.Text <> '' then if FreqVarEdit.Text <> '' then
begin begin
@ -310,17 +155,17 @@ begin
end; end;
end; end;
procedure TABCLogLinearFrm.NColsEditKeyPress(Sender: TObject; var Key: char); procedure TABCLogLinearForm.NColsEditKeyPress(Sender: TObject; var Key: char);
begin begin
if ord(Key) = 13 then NslicesEdit.SetFocus; if ord(Key) = 13 then NslicesEdit.SetFocus;
end; end;
procedure TABCLogLinearFrm.NRowsEditKeyPress(Sender: TObject; var Key: char); procedure TABCLogLinearForm.NRowsEditKeyPress(Sender: TObject; var Key: char);
begin begin
if ord(Key) = 13 then NcolsEdit.SetFocus; if ord(Key) = 13 then NcolsEdit.SetFocus;
end; end;
procedure TABCLogLinearFrm.NslicesEditKeyPress(Sender: TObject; var Key: char); procedure TABCLogLinearForm.NslicesEditKeyPress(Sender: TObject; var Key: char);
var var
i, j, k, row : integer; i, j, k, row : integer;
Nslices, Ncols, Nrows : integer; Nslices, Ncols, Nrows : integer;
@ -349,7 +194,7 @@ begin
end; end;
end; end;
procedure TABCLogLinearFrm.ColInBtnClick(Sender: TObject); procedure TABCLogLinearForm.ColInBtnClick(Sender: TObject);
var var
index: integer; index: integer;
begin begin
@ -362,7 +207,7 @@ begin
UpdateBtnStates; UpdateBtnStates;
end; end;
procedure TABCLogLinearFrm.ColOutBtnClick(Sender: TObject); procedure TABCLogLinearForm.ColOutBtnClick(Sender: TObject);
begin begin
if ColVarEdit.Text <> '' then if ColVarEdit.Text <> '' then
begin begin
@ -372,43 +217,26 @@ begin
UpdateBtnStates; UpdateBtnStates;
end; end;
procedure TABCLogLinearFrm.ComputeBtnClick(Sender: TObject); procedure TABCLogLinearForm.Compute;
var var
i, j, k, row, col, slice, Nrows, Ncols, Nslices : integer; i, j, k, row, col, slice, Nrows, Ncols, Nslices : integer;
Data : DblDyneCube; Data: DblDyneCube = nil;
AB, AC, BC : DblDyneMat; AB: DblDyneMat = nil;
RowMarg, ColMarg, SliceMarg : DblDyneVec; AC: DblDyneMat = nil;
Total : double; BC: DblDyneMat = nil;
arraysize : integer; RowMarg: DblDyneVec = nil;
Model : integer; ColMarg: DblDyneVec = nil;
astr, Title : string; SliceMarg: DblDyneVec = nil;
RowCol, ColCol, SliceCol, Fcol : integer; Total: double;
GridPos : IntDyneVec; arraysize: integer;
value : integer; Model: integer;
Fx : double; astr, Title: string;
lReport: TStrings; RowCol, ColCol, SliceCol, Fcol: integer;
GridPos: IntDyneVec = nil;
value: integer;
Fx: double;
lReport: TStrings;
begin begin
if RowVarEdit.Text = '' then
begin
MessageDlg('Row variable is not selected.', mtError, [mbOK], 0);
exit;
end;
if ColVarEdit.Text = '' then
begin
MessageDlg('Column variable is not selected.', mtError, [mbOK], 0);
exit;
end;
if SliceVarEdit.Text = '' then
begin
MessageDlg('Slice variable is not selected.', mtError, [mbOK], 0);
exit;
end;
if FreqVarEdit.Text = '' then
begin
MessageDlg('Frequency variable is not selected.', mtError, [mbOK], 0);
exit;
end;
Nrows := 0; Nrows := 0;
Ncols := 0; Ncols := 0;
Nslices := 0; Nslices := 0;
@ -417,13 +245,10 @@ begin
if FileFromGrp.ItemIndex = 0 then // mainfrm input if FileFromGrp.ItemIndex = 0 then // mainfrm input
begin begin
SetLength(GridPos, 4); SetLength(GridPos, 4);
for i := 1 to NoVariables do GridPos[0] := GetVariableIndex(OS3MainFrm.DataGrid, RowVarEdit.Text);
begin GridPos[1] := GetVariableIndex(OS3MainFrm.DataGrid, ColVarEdit.Text);
if RowVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[0] := i; GridPos[2] := GetVariableIndex(OS3MainFrm.DataGrid, SliceVarEdit.Text);
if ColVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[1] := i; GridPos[3] := GetVariableIndex(OS3MainFrm.DataGrid, FreqVarEdit.Text);
if SliceVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[2] := i;
if FreqVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[3] := i;
end;
// get no. of rows, columns and slices // get no. of rows, columns and slices
for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do
@ -466,7 +291,7 @@ begin
Fcol := GridPos[3]; Fcol := GridPos[3];
for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do
begin begin
if not GoodRecord(i, 4, GridPos) then continue; if not GoodRecord(OS3MainFrm.DataGrid, i, GridPos) then continue;
row := StrToInt(OS3MainFrm.DataGrid.Cells[rowcol,i]); row := StrToInt(OS3MainFrm.DataGrid.Cells[rowcol,i]);
col := StrToInt(OS3MainFrm.DataGrid.Cells[colcol,i]); col := StrToInt(OS3MainFrm.DataGrid.Cells[colcol,i]);
slice := StrToInt(OS3MainFrm.DataGrid.Cells[slicecol,i]); slice := StrToInt(OS3MainFrm.DataGrid.Cells[slicecol,i]);
@ -547,21 +372,14 @@ begin
for Model := 1 to 9 do for Model := 1 to 9 do
ModelEffect(Nrows, Ncols, Nslices, Data, RowMarg, ColMarg, SliceMarg, AB, AC, BC, Total, Model, lReport); ModelEffect(Nrows, Ncols, Nslices, Data, RowMarg, ColMarg, SliceMarg, AB, AC, BC, Total, Model, lReport);
DisplayReport(lReport); FReportFrame.DisplayReport(lReport);
finally finally
lReport.Free; lReport.Free;
SliceMarg := nil;
ColMarg := nil;
RowMarg := nil;
Data := nil;
BC := nil;
AC := nil;
AB := nil;
end; end;
end; end;
procedure TABCLogLinearFrm.ModelEffect( procedure TABCLogLinearForm.ModelEffect(
Nrows, Ncols, Nslices: integer; Nrows, Ncols, Nslices: integer;
const Data: DblDyneCube; const Data: DblDyneCube;
const RowMarg, ColMarg, SliceMarg: DblDyneVec; const RowMarg, ColMarg, SliceMarg: DblDyneVec;
@ -840,7 +658,7 @@ begin
end; end;
//------------------------------------------------------------------- //-------------------------------------------------------------------
procedure TABCLogLinearFrm.Iterate( procedure TABCLogLinearForm.Iterate(
Nrows, Ncols, Nslices: integer; Nrows, Ncols, Nslices: integer;
const Data: DblDyneCube; const RowMarg, ColMarg, SliceMarg: DblDyneVec; const Data: DblDyneCube; const RowMarg, ColMarg, SliceMarg: DblDyneVec;
var Total: double; var Total: double;
@ -937,7 +755,7 @@ Step:
end; end;
//------------------------------------------------------------------- //-------------------------------------------------------------------
procedure TABCLogLinearFrm.PrintTable( procedure TABCLogLinearForm.PrintTable(
Nrows, Ncols, Nslices: integer; Nrows, Ncols, Nslices: integer;
const Data: DblDyneCube; const RowMarg, ColMarg, SliceMarg: DblDyneVec; const Data: DblDyneCube; const RowMarg, ColMarg, SliceMarg: DblDyneVec;
Total: double; Total: double;
@ -963,9 +781,9 @@ begin
for k := 1 to Nslices do for k := 1 to Nslices do
AReport.Add('Slice %d %8.3f', [k, SliceMarg[k]]); AReport.Add('Slice %d %8.3f', [k, SliceMarg[k]]);
end; end;
//-------------------------------------------------------------------
procedure TABCLogLinearFrm.PrintLamdas(Nrows, Ncols, Nslices: integer;
procedure TABCLogLinearForm.PrintLamdas(Nrows, Ncols, Nslices: integer;
const CellLambdas: DblDyneQuad; mu: Double; AReport: TStrings); const CellLambdas: DblDyneQuad; mu: Double; AReport: TStrings);
var var
i, j, k, l: integer; i, j, k, l: integer;
@ -989,9 +807,9 @@ begin
AReport.Add(''); AReport.Add('');
end; end;
end; end;
//-------------------------------------------------------------------
procedure TABCLogLinearFrm.PrintMatrix(const X: DblDyneMat;
procedure TABCLogLinearForm.PrintMatrix(const X: DblDyneMat;
Nrows, Ncols: integer; Title: string; AReport: TStrings); Nrows, Ncols: integer; Title: string; AReport: TStrings);
Label loop; Label loop;
var var
@ -1031,8 +849,89 @@ loop:
AReport.Add(''); AReport.Add('');
end; end;
procedure TABCLogLinearFrm.UpdateBtnStates;
procedure TABCLogLinearForm.Reset;
var
i: integer;
begin begin
inherited;
Grid.ColCount := 4;
Grid.RowCount := 2;
Grid.Cells[0,0] := 'ROW';
Grid.Cells[1,0] := 'COL';
Grid.Cells[2,0] := 'SLICE';
Grid.Cells[3,0] := 'FREQ.';
CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items);
RowVarEdit.Text := '';
ColVarEdit.Text := '';
SliceVarEdit.Text := '';
FreqVarEdit.Text := '';
NRowsEdit.Text := '';
NColsEdit.Text := '';
NSlicesEdit.Text := '';
FileFromGrp.ItemIndex := -1;
Notebook.Hide;
UpdateBtnStates;
end;
procedure TABCLogLinearForm.RowInBtnClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if (index > -1) and (RowVarEdit.Text = '') then
begin
RowVarEdit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TABCLogLinearForm.RowOutBtnClick(Sender: TObject);
begin
if RowVarEdit.Text <> '' then
begin
VarList.Items.Add(RowVarEdit.Text);
RowVarEdit.Text := '';
end;
UpdateBtnStates;
end;
procedure TABCLogLinearForm.SliceBtnInClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if (index > -1) and (SliceVarEdit.Text = '') then
begin
SliceVarEdit.Text := VarList.Items[index];
VarList.Items.Delete(index);
end;
UpdateBtnStates;
end;
procedure TABCLogLinearForm.SliceBtnOutClick(Sender: TObject);
begin
if SliceVarEdit.Text <> '' then
begin
VarList.Items.Add(SliceVarEdit.Text);
SliceVarEdit.Text := '';
end;
end;
procedure TABCLogLinearForm.UpdateBtnStates;
begin
inherited;
RowInBtn.Enabled := (VarList.ItemIndex > -1) and (RowVarEdit.Text = ''); RowInBtn.Enabled := (VarList.ItemIndex > -1) and (RowVarEdit.Text = '');
RowOutBtn.Enabled := (RowVarEdit.Text <> ''); RowOutBtn.Enabled := (RowVarEdit.Text <> '');
ColInBtn.Enabled := (VarList.ItemIndex > -1) and (ColVarEdit.Text = ''); ColInBtn.Enabled := (VarList.ItemIndex > -1) and (ColVarEdit.Text = '');
@ -1043,8 +942,98 @@ begin
FreqOutBtn.Enabled := (FreqVarEdit.Text <> ''); FreqOutBtn.Enabled := (FreqVarEdit.Text <> '');
end; end;
initialization
{$I abcloglinunit.lrs} function TABCLogLinearForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
var
i, n: Integer;
begin
Result := false;
if FileFromGrp.ItemIndex = 0 then // mainfrm input
begin
if RowVarEdit.Text = '' then
begin
AMsg := 'Row variable is not selected.';
AControl := VarList;
exit;
end;
if ColVarEdit.Text = '' then
begin
AMsg := 'Column variable is not selected.';
AControl := VarList;
exit;
end;
if SliceVarEdit.Text = '' then
begin
AMsg := 'Slice variable is not selected.';
AControl := VarList;
exit;
end;
if FreqVarEdit.Text = '' then
begin
AMsg := 'Frequency variable is not selected.';
AControl := VarList;
exit;
end;
end
else
for i := 1 to Grid.RowCount-1 do
begin
if Grid.Cells[3, i] = '' then
begin
AMsg := 'Data missing in row ' + IntToStr(i);
AControl := Grid;
Grid.Row := i;
Grid.Col := 3;
exit;
end;
if not TryStrToInt(Grid.Cells[3, i], n) then
begin
AMsg := 'No valid integer in row ' + IntToStr(i);
AControl := Grid;
Grid.Row := i;
Grid.Col := 3;
exit;
end;
end;
Result := true;
end;
procedure TABCLogLinearForm.VarListDblClick(Sender: TObject);
var
index: Integer;
s: String;
begin
index := VarList.ItemIndex;
if index > -1 then begin
s := VarList.Items[index];
if RowVarEdit.Text = '' then
RowVarEdit.Text := s
else
if ColVarEdit.Text = '' then
ColVarEdit.text := s
else
if SliceVarEdit.Text = '' then
SliceVarEdit.Text := s
else
if FreqVaredit.Text = '' then
FreqVarEdit.Text := s
else
exit;
VarList.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TABCLogLinearForm.VarListSelectionChange(Sender: TObject;
User: boolean);
begin
UpdateBtnStates;
end;
end. end.

View File

@ -19,7 +19,7 @@ object OS3MainFrm: TOS3MainFrm
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = FormShow OnShow = FormShow
LCLVersion = '2.0.10.0' LCLVersion = '2.1.0.0'
object PanelTop: TPanel object PanelTop: TPanel
Left = 0 Left = 0
Height = 35 Height = 35

View File

@ -734,30 +734,6 @@ begin
DblDeclineFrm.ShowModal; DblDeclineFrm.ShowModal;
end; end;
// Menu "Analysis" > "Cross-classification" > "AxB Log Linear"
procedure TOS3MainFrm.mnuAnalysisCC_ABLogLinClick(Sender: TObject);
begin
if TwoWayLogLinFrm = nil then
Application.CreateForm(TTwoWayLogLinFrm, TwoWayLogLinFrm);
TwoWayLogLinFrm.ShowModal;
end;
// Menu "Analysis" > "Cross-Classification" > "AxBxC Log Linear"
procedure TOS3MainFrm.mnuAnalysisCC_ABCLogLinClick(Sender: TObject);
begin
if ABCLogLinearFrm = nil then
Application.CreateForm(TABCLogLinearFrm, ABCLogLinearFrm);
ABCLogLinearFrm.ShowModal;
end;
// Menu "Analysis" > "Cross-classification" > "Log Linear Screen"
procedure TOS3MainFrm.mnuAnalysisCC_LogLinScreenClick(Sender: TObject);
begin
if LogLinScreenFrm = nil then
Application.CreateForm(TLogLinScreenFrm, LogLinScreenFrm);
LogLinScreenFrm.ShowModal;
end;
// Menu "Analysis" > "One sample tests" // Menu "Analysis" > "One sample tests"
procedure TOS3MainFrm.mnuAnalysisOneSampleTestsClick(Sender: TObject); procedure TOS3MainFrm.mnuAnalysisOneSampleTestsClick(Sender: TObject);
begin begin
@ -1509,6 +1485,33 @@ begin
end; end;
{ "Cross-classification" commands }
// Menu "Analysis" > "Cross-classification" > "AxB Log Linear"
procedure TOS3MainFrm.mnuAnalysisCC_ABLogLinClick(Sender: TObject);
begin
if TwoWayLogLinFrm = nil then
Application.CreateForm(TTwoWayLogLinFrm, TwoWayLogLinFrm);
TwoWayLogLinFrm.Show;
end;
// Menu "Analysis" > "Cross-Classification" > "AxBxC Log Linear"
procedure TOS3MainFrm.mnuAnalysisCC_ABCLogLinClick(Sender: TObject);
begin
if ABCLogLinearForm = nil then
Application.CreateForm(TABCLogLinearForm, ABCLogLinearForm);
ABCLogLinearForm.Show;
end;
// Menu "Analysis" > "Cross-classification" > "Log Linear Screen"
procedure TOS3MainFrm.mnuAnalysisCC_LogLinScreenClick(Sender: TObject);
begin
if LogLinScreenForm = nil then
Application.CreateForm(TLogLinScreenForm, LogLinScreenForm);
LogLinScreenForm.Show;
end;
{ "Measurement Programs" commands } { "Measurement Programs" commands }
// Menu "Analysis" > "Measurement Programs" > "Generate Sample Test Data" // Menu "Analysis" > "Measurement Programs" > "Generate Sample Test Data"