You've already forked lazarus-ccr
LazStats: Fix SRHTestUnit crashing at CloseFile.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7839 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -73,6 +73,8 @@ type
|
||||
F1Labels: StrDyneVec;
|
||||
F2Labels: StrDyneVec;
|
||||
|
||||
procedure GetColsSelected(out AColsSelected: IntDyneVec);
|
||||
|
||||
function GetLabels(AColsSelected: IntDyneVec): Boolean;
|
||||
|
||||
function Calc2Way(const AColsSelected: IntDyneVec;
|
||||
@ -364,10 +366,7 @@ var
|
||||
res: TSRHResults;
|
||||
begin
|
||||
// Get column numbers of dependent variable and factors
|
||||
SetLength(colNoSelected, 3);
|
||||
colNoSelected[0] := GetVariableIndex(OS3MainFrm.DataGrid, DepVar.Text);
|
||||
colNoSelected[1] := GetVariableIndex(OS3MainFrm.DataGrid, Factor1.Text);
|
||||
colNoSelected[2] := GetVariableIndex(OS3MainFrm.DataGrid, Factor2.Text);
|
||||
GetColsSelected(colNoSelected);
|
||||
|
||||
// get labels for each factor level
|
||||
if not GetLabels(colNoSelected) then
|
||||
@ -461,6 +460,16 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TSRHTestForm.GetColsSelected(out AColsSelected: IntDyneVec);
|
||||
begin
|
||||
AColsSelected := nil;
|
||||
SetLength(AColsSelected, 3);
|
||||
AColsSelected[0] := GetVariableIndex(OS3MainFrm.DataGrid, DepVar.Text);
|
||||
AColsSelected[1] := GetVariableIndex(OS3MainFrm.DataGrid, Factor1.Text);
|
||||
AColsSelected[2] := GetVariableIndex(OS3MainFrm.DataGrid, Factor2.Text);
|
||||
end;
|
||||
|
||||
|
||||
function TSRHTestForm.GetLabels(AColsSelected: IntDyneVec): Boolean;
|
||||
var
|
||||
i, nF1, nF2: integer;
|
||||
@ -758,8 +767,11 @@ var
|
||||
begin
|
||||
tb := Sender as TToolButton;
|
||||
tb.Down := true;
|
||||
FChartSeries.Source := FChartSources[tb.Tag - 10];
|
||||
|
||||
if FChartSeries = nil then
|
||||
exit;
|
||||
|
||||
FChartSeries.Source := FChartSources[tb.Tag - 10];
|
||||
case tb.Tag-10 of
|
||||
0: begin // x = Factor 1
|
||||
FChartFrame.SetTitle(Factor1.Text);
|
||||
@ -798,13 +810,15 @@ procedure TSRHTestForm.Reset;
|
||||
var
|
||||
i : integer;
|
||||
begin
|
||||
FreeAndNil(FChartSeries);
|
||||
|
||||
inherited;
|
||||
|
||||
if FChartSources[0] <> nil then
|
||||
begin
|
||||
//SelectPlot(FSeriesButtons[0]);
|
||||
for i := 0 to High(FChartSources) do
|
||||
FChartSources[i].Clear;
|
||||
SelectPlot(FSeriesButtons[0]);
|
||||
end;
|
||||
|
||||
DepVar.Clear;
|
||||
|
Reference in New Issue
Block a user