LazStats: Simplification of GuttmanUnit. Add help text. No sample file found for testing, though.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7388 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-04-18 20:06:02 +00:00
parent c8fb7ae1e8
commit c0fccdfa28
4 changed files with 20 additions and 37 deletions

View File

@ -118,7 +118,7 @@ object GuttmanFrm: TGuttmanFrm
AnchorSideRight.Control = ComputeBtn AnchorSideRight.Control = ComputeBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 163 Left = 169
Height = 25 Height = 25
Top = 274 Top = 274
Width = 54 Width = 54
@ -133,10 +133,10 @@ object GuttmanFrm: TGuttmanFrm
TabOrder = 5 TabOrder = 5
end end
object ComputeBtn: TButton object ComputeBtn: TButton
AnchorSideRight.Control = ReturnBtn AnchorSideRight.Control = CloseBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 225 Left = 231
Height = 25 Height = 25
Top = 274 Top = 274
Width = 76 Width = 76
@ -150,30 +150,30 @@ object GuttmanFrm: TGuttmanFrm
OnClick = ComputeBtnClick OnClick = ComputeBtnClick
TabOrder = 6 TabOrder = 6
end end
object ReturnBtn: TButton object CloseBtn: TButton
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 309 Left = 315
Height = 25 Height = 25
Top = 274 Top = 274
Width = 61 Width = 55
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 12 BorderSpacing.Right = 12
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Return' Caption = 'Close'
ModalResult = 1 ModalResult = 11
TabOrder = 7 TabOrder = 7
end end
object Bevel1: TBevel object Bevel1: TBevel
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ReturnBtn AnchorSideBottom.Control = CloseBtn
Left = 0 Left = 0
Height = 8 Height = 8
Top = 258 Top = 258

View File

@ -20,7 +20,7 @@ type
AllBtn: TBitBtn; AllBtn: TBitBtn;
ResetBtn: TButton; ResetBtn: TButton;
ComputeBtn: TButton; ComputeBtn: TButton;
ReturnBtn: TButton; CloseBtn: TButton;
Label1: TLabel; Label1: TLabel;
Label2: TLabel; Label2: TLabel;
ItemList: TListBox; ItemList: TListBox;
@ -48,7 +48,7 @@ var
implementation implementation
uses uses
Math; Math, Utils;
{ TGuttmanFrm } { TGuttmanFrm }
@ -75,10 +75,10 @@ begin
if FAutoSized then if FAutoSized then
exit; exit;
w := MaxValue([ResetBtn.Width, ComputeBtn.Width, ReturnBtn.Width]); w := MaxValue([ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
ResetBtn.Constraints.MinWidth := w; ResetBtn.Constraints.MinWidth := w;
ComputeBtn.Constraints.MinWidth := w; ComputeBtn.Constraints.MinWidth := w;
ReturnBtn.Constraints.MinWidth := w; CloseBtn.Constraints.MinWidth := w;
Constraints.MinWidth := Width + w; // make form a bit wider... Constraints.MinWidth := Width + w; // make form a bit wider...
Constraints.MinHeight := Height; Constraints.MinHeight := Height;
@ -484,9 +484,11 @@ begin
end; end;
lReport.Add(''); lReport.Add('');
lReport.Add('No. of Cases := %3d. No. of items := %3d',[NoCases,NoSelected]); lReport.Add('No. of Cases: %3d', [NoCases]);
lReport.Add('No. of items: %3d', [NoSelected]);
lReport.Add(''); lReport.Add('');
lReport.Add('RESPONSE MATRIX'); lReport.Add('RESPONSE MATRIX');
lReport.Add('');
first := 1; first := 1;
last := first + 5; // column (item) index last := first + 5; // column (item) index
if (last > NoSelected) then last := NoSelected; if (last > NoSelected) then last := NoSelected;
@ -547,7 +549,7 @@ begin
end; end;
lReport.Add(''); lReport.Add('');
CoefRepro := 1.0 - (totalerrors / (NoCases * NoSelected)); CoefRepro := 1.0 - (totalerrors / (NoCases * NoSelected));
lReport.Add('Coefficient of Reproducibility := %6.3f', [CoefRepro]); lReport.Add('Coefficient of Reproducibility: %6.3f', [CoefRepro]);
for j := 1 to NoSelected do for j := 1 to NoSelected do
if (ColProps[j-1] > (1.0 - ColProps[j-1])) then if (ColProps[j-1] > (1.0 - ColProps[j-1])) then
@ -556,7 +558,7 @@ begin
Min_Coeff := Min_Coeff + (1.0 - ColProps[j-1]); Min_Coeff := Min_Coeff + (1.0 - ColProps[j-1]);
Min_Coeff := Min_coeff / NoSelected; Min_Coeff := Min_coeff / NoSelected;
lReport.Add('Minimal Marginal Reproducibility := %6.3f', [Min_Coeff]); lReport.Add('Minimal Marginal Reproducibility: %6.3f', [Min_Coeff]);
DisplayReport(lReport); DisplayReport(lReport);
finally finally
@ -618,28 +620,9 @@ begin
end; end;
procedure TGuttmanFrm.UpdateBtnStates; procedure TGuttmanFrm.UpdateBtnStates;
var
i: Integer;
lSelected: Boolean;
begin begin
lSelected := false; InBtn.Enabled := AnySelected(Varlist);
for i := 0 to VarList.Items.Count-1 do OutBtn.Enabled := AnySelected(Itemlist);
if VarList.Selected[i] then
begin
lSelected := true;
break;
end;
InBtn.Enabled := lSelected;
lSelected := false;
for i := 0 to ItemList.Items.Count-1 do
if ItemList.Selected[i] then
begin
lSelected := true;
break;
end;
OutBtn.Enabled := lSelected;
AllBtn.Enabled := VarList.Items.Count > 0; AllBtn.Enabled := VarList.Items.Count > 0;
end; end;