You've already forked lazarus-ccr
LazStats: Inherit the SPC forms from TBasicStatsResultAndChartForm. Not all verified, yet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7765 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
object BasicSPCForm: TBasicSPCForm
|
inherited BasicSPCForm: TBasicSPCForm
|
||||||
Left = 535
|
Left = 535
|
||||||
Height = 438
|
Height = 438
|
||||||
Top = 241
|
Top = 241
|
||||||
@ -6,129 +6,53 @@ object BasicSPCForm: TBasicSPCForm
|
|||||||
Caption = 'SPC Form'
|
Caption = 'SPC Form'
|
||||||
ClientHeight = 438
|
ClientHeight = 438
|
||||||
ClientWidth = 927
|
ClientWidth = 927
|
||||||
OnActivate = FormActivate
|
inherited ParamsPanel: TPanel
|
||||||
OnCreate = FormCreate
|
Height = 422
|
||||||
Position = poMainFormCenter
|
|
||||||
LCLVersion = '2.1.0.0'
|
|
||||||
object SpecsPanel: TPanel
|
|
||||||
Left = 8
|
|
||||||
Height = 438
|
|
||||||
Top = 0
|
|
||||||
Width = 357
|
Width = 357
|
||||||
Align = alLeft
|
ClientHeight = 422
|
||||||
BorderSpacing.Left = 8
|
|
||||||
BorderSpacing.Right = 3
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 438
|
|
||||||
ClientWidth = 357
|
ClientWidth = 357
|
||||||
TabOrder = 0
|
inherited CloseBtn: TButton
|
||||||
object ButtonPanel: TPanel
|
Left = 302
|
||||||
Left = 0
|
Top = 397
|
||||||
Height = 42
|
TabOrder = 4
|
||||||
Top = 396
|
|
||||||
Width = 357
|
|
||||||
Align = alBottom
|
|
||||||
AutoSize = True
|
|
||||||
BevelOuter = bvNone
|
|
||||||
ClientHeight = 42
|
|
||||||
ClientWidth = 357
|
|
||||||
TabOrder = 3
|
|
||||||
object CloseBtn: TButton
|
|
||||||
AnchorSideTop.Control = ButtonPanel
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = ButtonPanel
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 302
|
|
||||||
Height = 25
|
|
||||||
Top = 9
|
|
||||||
Width = 55
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Top = 8
|
|
||||||
BorderSpacing.Bottom = 8
|
|
||||||
Caption = 'Close'
|
|
||||||
ModalResult = 11
|
|
||||||
OnClick = CloseBtnClick
|
|
||||||
TabOrder = 3
|
|
||||||
end
|
|
||||||
object ComputeBtn: TButton
|
|
||||||
AnchorSideTop.Control = ButtonPanel
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = CloseBtn
|
|
||||||
Left = 218
|
|
||||||
Height = 25
|
|
||||||
Top = 9
|
|
||||||
Width = 76
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Around = 8
|
|
||||||
Caption = 'Compute'
|
|
||||||
OnClick = ComputeBtnClick
|
|
||||||
TabOrder = 2
|
|
||||||
end
|
|
||||||
object ResetBtn: TButton
|
|
||||||
AnchorSideTop.Control = ButtonPanel
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = ComputeBtn
|
|
||||||
Left = 156
|
|
||||||
Height = 25
|
|
||||||
Top = 9
|
|
||||||
Width = 54
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
AutoSize = True
|
|
||||||
BorderSpacing.Around = 8
|
|
||||||
Caption = 'Reset'
|
|
||||||
OnClick = ResetBtnClick
|
|
||||||
TabOrder = 1
|
|
||||||
end
|
|
||||||
object HelpBtn: TButton
|
|
||||||
AnchorSideTop.Control = ButtonPanel
|
|
||||||
AnchorSideTop.Side = asrCenter
|
|
||||||
AnchorSideRight.Control = ResetBtn
|
|
||||||
Left = 105
|
|
||||||
Height = 25
|
|
||||||
Top = 9
|
|
||||||
Width = 43
|
|
||||||
Anchors = [akTop, akRight]
|
|
||||||
BorderSpacing.Around = 8
|
|
||||||
Caption = 'Help'
|
|
||||||
OnClick = HelpBtnClick
|
|
||||||
TabOrder = 0
|
|
||||||
end
|
|
||||||
object Bevel1: TBevel
|
|
||||||
AnchorSideLeft.Control = ButtonPanel
|
|
||||||
AnchorSideTop.Control = ButtonPanel
|
|
||||||
AnchorSideRight.Control = ButtonPanel
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 8
|
|
||||||
Height = 4
|
|
||||||
Top = 0
|
|
||||||
Width = 349
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
|
||||||
BorderSpacing.Left = 8
|
|
||||||
Shape = bsTopLine
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
object VarListLabel: TLabel
|
inherited ComputeBtn: TButton
|
||||||
AnchorSideLeft.Control = SpecsPanel
|
Left = 218
|
||||||
AnchorSideTop.Control = SpecsPanel
|
Top = 397
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
inherited ResetBtn: TButton
|
||||||
|
Left = 156
|
||||||
|
Top = 397
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
inherited HelpBtn: TButton
|
||||||
|
Left = 97
|
||||||
|
Top = 397
|
||||||
|
end
|
||||||
|
inherited ButtonBevel: TBevel
|
||||||
|
Top = 381
|
||||||
|
Width = 357
|
||||||
|
end
|
||||||
|
object VarListLabel: TLabel[5]
|
||||||
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
|
AnchorSideTop.Control = ParamsPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 8
|
Top = 0
|
||||||
Width = 97
|
Width = 97
|
||||||
BorderSpacing.Top = 8
|
|
||||||
Caption = 'Selection Variables'
|
Caption = 'Selection Variables'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object VarList: TListBox
|
object VarList: TListBox[6]
|
||||||
AnchorSideLeft.Control = SpecsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideTop.Control = VarListLabel
|
AnchorSideTop.Control = VarListLabel
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = MeasInBtn
|
AnchorSideRight.Control = MeasInBtn
|
||||||
AnchorSideBottom.Control = ButtonPanel
|
AnchorSideBottom.Control = ButtonBevel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 363
|
Height = 356
|
||||||
Top = 25
|
Top = 17
|
||||||
Width = 157
|
Width = 157
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Top = 2
|
BorderSpacing.Top = 2
|
||||||
@ -139,28 +63,28 @@ object BasicSPCForm: TBasicSPCForm
|
|||||||
OnDblClick = VarListDblClick
|
OnDblClick = VarListDblClick
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object GroupLabel: TLabel
|
object GroupLabel: TLabel[7]
|
||||||
AnchorSideLeft.Control = GroupEdit
|
AnchorSideLeft.Control = GroupEdit
|
||||||
AnchorSideTop.Control = GroupInBtn
|
AnchorSideTop.Control = GroupInBtn
|
||||||
Left = 199
|
Left = 199
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 99
|
Top = 91
|
||||||
Width = 105
|
Width = 105
|
||||||
BorderSpacing.Top = 2
|
BorderSpacing.Top = 2
|
||||||
BorderSpacing.Bottom = 2
|
BorderSpacing.Bottom = 2
|
||||||
Caption = 'Group (Lot) Variable'
|
Caption = 'Group (Lot) Variable'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object GroupEdit: TEdit
|
object GroupEdit: TEdit[8]
|
||||||
AnchorSideLeft.Control = GroupInBtn
|
AnchorSideLeft.Control = GroupInBtn
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = GroupLabel
|
AnchorSideTop.Control = GroupLabel
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = SpecsPanel
|
AnchorSideRight.Control = ParamsPanel
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 199
|
Left = 199
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 116
|
Top = 108
|
||||||
Width = 158
|
Width = 158
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
@ -170,28 +94,28 @@ object BasicSPCForm: TBasicSPCForm
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
Text = 'GroupEdit'
|
Text = 'GroupEdit'
|
||||||
end
|
end
|
||||||
object MeasLabel: TLabel
|
object MeasLabel: TLabel[9]
|
||||||
AnchorSideLeft.Control = MeasEdit
|
AnchorSideLeft.Control = MeasEdit
|
||||||
AnchorSideTop.Control = MeasInBtn
|
AnchorSideTop.Control = MeasInBtn
|
||||||
Left = 199
|
Left = 199
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 27
|
Top = 19
|
||||||
Width = 117
|
Width = 117
|
||||||
BorderSpacing.Top = 2
|
BorderSpacing.Top = 2
|
||||||
BorderSpacing.Bottom = 2
|
BorderSpacing.Bottom = 2
|
||||||
Caption = 'Measurement Variable'
|
Caption = 'Measurement Variable'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object MeasEdit: TEdit
|
object MeasEdit: TEdit[10]
|
||||||
AnchorSideLeft.Control = MeasInBtn
|
AnchorSideLeft.Control = MeasInBtn
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = MeasLabel
|
AnchorSideTop.Control = MeasLabel
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = SpecsPanel
|
AnchorSideRight.Control = ParamsPanel
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 199
|
Left = 199
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 44
|
Top = 36
|
||||||
Width = 158
|
Width = 158
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
@ -201,8 +125,8 @@ object BasicSPCForm: TBasicSPCForm
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'MeasEdit'
|
Text = 'MeasEdit'
|
||||||
end
|
end
|
||||||
object Bevel2: TBevel
|
object Bevel2: TBevel[11]
|
||||||
AnchorSideLeft.Control = SpecsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
Left = 167
|
Left = 167
|
||||||
Height = 9
|
Height = 9
|
||||||
@ -210,54 +134,54 @@ object BasicSPCForm: TBasicSPCForm
|
|||||||
Width = 23
|
Width = 23
|
||||||
Shape = bsSpacer
|
Shape = bsSpacer
|
||||||
end
|
end
|
||||||
object MeasInBtn: TSpeedButton
|
object MeasInBtn: TSpeedButton[12]
|
||||||
AnchorSideLeft.Control = SpecsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = VarList
|
AnchorSideTop.Control = VarList
|
||||||
Left = 165
|
Left = 165
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 25
|
Top = 17
|
||||||
Width = 26
|
Width = 26
|
||||||
Images = MainDataModule.ImageList
|
Images = MainDataModule.ImageList
|
||||||
ImageIndex = 1
|
ImageIndex = 1
|
||||||
OnClick = MeasInBtnClick
|
OnClick = MeasInBtnClick
|
||||||
end
|
end
|
||||||
object MeasOutBtn: TSpeedButton
|
object MeasOutBtn: TSpeedButton[13]
|
||||||
AnchorSideLeft.Control = SpecsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = MeasInBtn
|
AnchorSideTop.Control = MeasInBtn
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 165
|
Left = 165
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 55
|
Top = 47
|
||||||
Width = 26
|
Width = 26
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
Images = MainDataModule.ImageList
|
Images = MainDataModule.ImageList
|
||||||
ImageIndex = 0
|
ImageIndex = 0
|
||||||
OnClick = MeasOutBtnClick
|
OnClick = MeasOutBtnClick
|
||||||
end
|
end
|
||||||
object GroupInBtn: TSpeedButton
|
object GroupInBtn: TSpeedButton[14]
|
||||||
AnchorSideLeft.Control = SpecsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = MeasOutBtn
|
AnchorSideTop.Control = MeasOutBtn
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 165
|
Left = 165
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 97
|
Top = 89
|
||||||
Width = 26
|
Width = 26
|
||||||
BorderSpacing.Top = 16
|
BorderSpacing.Top = 16
|
||||||
Images = MainDataModule.ImageList
|
Images = MainDataModule.ImageList
|
||||||
ImageIndex = 1
|
ImageIndex = 1
|
||||||
OnClick = GroupInBtnClick
|
OnClick = GroupInBtnClick
|
||||||
end
|
end
|
||||||
object GroupOutBtn: TSpeedButton
|
object GroupOutBtn: TSpeedButton[15]
|
||||||
AnchorSideLeft.Control = SpecsPanel
|
AnchorSideLeft.Control = ParamsPanel
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = GroupInBtn
|
AnchorSideTop.Control = GroupInBtn
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 165
|
Left = 165
|
||||||
Height = 26
|
Height = 26
|
||||||
Top = 127
|
Top = 119
|
||||||
Width = 26
|
Width = 26
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
Images = MainDataModule.ImageList
|
Images = MainDataModule.ImageList
|
||||||
@ -265,31 +189,13 @@ object BasicSPCForm: TBasicSPCForm
|
|||||||
OnClick = GroupOutBtnClick
|
OnClick = GroupOutBtnClick
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object SpecsSplitter: TSplitter
|
inherited ParamsSplitter: TSplitter
|
||||||
Left = 368
|
Left = 369
|
||||||
Height = 438
|
Height = 438
|
||||||
Top = 0
|
|
||||||
Width = 5
|
|
||||||
ResizeStyle = rsPattern
|
|
||||||
end
|
end
|
||||||
object PageControl: TPageControl
|
inherited PageControl: TPageControl
|
||||||
Left = 376
|
Left = 378
|
||||||
Height = 426
|
Height = 422
|
||||||
Top = 6
|
Width = 541
|
||||||
Width = 545
|
|
||||||
ActivePage = ChartPage
|
|
||||||
Align = alClient
|
|
||||||
BorderSpacing.Left = 3
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
BorderSpacing.Right = 6
|
|
||||||
BorderSpacing.Bottom = 6
|
|
||||||
TabIndex = 1
|
|
||||||
TabOrder = 2
|
|
||||||
object ReportPage: TTabSheet
|
|
||||||
Caption = 'Report'
|
|
||||||
end
|
|
||||||
object ChartPage: TTabSheet
|
|
||||||
Caption = 'Chart'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -8,66 +8,46 @@ uses
|
|||||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||||
StdCtrls, ComCtrls, Buttons,
|
StdCtrls, ComCtrls, Buttons,
|
||||||
Globals, MainUnit, ContextHelpUnit,
|
Globals, MainUnit, ContextHelpUnit,
|
||||||
BasicStatsFormUnit, ReportFrameUnit, ChartFrameUnit;
|
BasicStatsReportAndChartFormUnit, ReportFrameUnit, ChartFrameUnit;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TBasicSPCForm }
|
{ TBasicSPCForm }
|
||||||
|
|
||||||
TBasicSPCForm = class(TBasicStatsForm)
|
TBasicSPCForm = class(TBasicStatsReportAndChartForm)
|
||||||
Bevel1: TBevel;
|
|
||||||
Bevel2: TBevel;
|
Bevel2: TBevel;
|
||||||
GroupEdit: TEdit;
|
GroupEdit: TEdit;
|
||||||
HelpBtn: TButton;
|
|
||||||
GroupLabel: TLabel;
|
GroupLabel: TLabel;
|
||||||
MeasLabel: TLabel;
|
MeasLabel: TLabel;
|
||||||
MeasEdit: TEdit;
|
MeasEdit: TEdit;
|
||||||
PageControl: TPageControl;
|
|
||||||
ResetBtn: TButton;
|
|
||||||
ComputeBtn: TButton;
|
|
||||||
CloseBtn: TButton;
|
|
||||||
SpecsPanel: TPanel;
|
|
||||||
ButtonPanel: TPanel;
|
|
||||||
SpecsSplitter: TSplitter;
|
|
||||||
ReportPage: TTabSheet;
|
|
||||||
ChartPage: TTabSheet;
|
|
||||||
MeasInBtn: TSpeedButton;
|
MeasInBtn: TSpeedButton;
|
||||||
MeasOutBtn: TSpeedButton;
|
MeasOutBtn: TSpeedButton;
|
||||||
GroupInBtn: TSpeedButton;
|
GroupInBtn: TSpeedButton;
|
||||||
GroupOutBtn: TSpeedButton;
|
GroupOutBtn: TSpeedButton;
|
||||||
VarList: TListBox;
|
VarList: TListBox;
|
||||||
VarListLabel: TLabel;
|
VarListLabel: TLabel;
|
||||||
procedure CloseBtnClick(Sender: TObject);
|
|
||||||
procedure ComputeBtnClick(Sender: TObject);
|
|
||||||
procedure FormActivate(Sender: TObject);
|
|
||||||
procedure FormCreate(Sender: TObject);
|
|
||||||
procedure GroupInBtnClick(Sender: TObject);
|
procedure GroupInBtnClick(Sender: TObject);
|
||||||
procedure GroupOutBtnClick(Sender: TObject);
|
procedure GroupOutBtnClick(Sender: TObject);
|
||||||
procedure HelpBtnClick(Sender: TObject);
|
|
||||||
procedure MeasInBtnClick(Sender: TObject);
|
procedure MeasInBtnClick(Sender: TObject);
|
||||||
procedure MeasOutBtnClick(Sender: TObject);
|
procedure MeasOutBtnClick(Sender: TObject);
|
||||||
procedure ResetBtnClick(Sender: TObject);
|
|
||||||
procedure VarListClick(Sender: TObject);
|
procedure VarListClick(Sender: TObject);
|
||||||
procedure VarListDblClick(Sender: TObject);
|
procedure VarListDblClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
FGroupsNeeded: Boolean;
|
FGroupsNeeded: Boolean;
|
||||||
|
|
||||||
protected
|
protected
|
||||||
FAutoSized: Boolean;
|
|
||||||
GrpVar: Integer;
|
GrpVar: Integer;
|
||||||
MeasVar: Integer;
|
MeasVar: Integer;
|
||||||
procedure Compute; virtual;
|
|
||||||
function GetGroups: StrDyneVec;
|
function GetGroups: StrDyneVec;
|
||||||
function GetFileName: String;
|
function GetFileName: String;
|
||||||
procedure PlotMeans(ATitle, AXTitle, AYTitle, ADataTitle, AGrandMeanTitle: String;
|
procedure PlotMeans(ATitle, AXTitle, AYTitle, ADataTitle, AGrandMeanTitle: String;
|
||||||
const Groups: StrDyneVec; const Means: DblDyneVec;
|
const Groups: StrDyneVec; const Means: DblDyneVec;
|
||||||
UCL, LCL, GrandMean, TargetSpec, LowerSpec, UpperSpec: double); virtual;
|
UCL, LCL, GrandMean, TargetSpec, LowerSpec, UpperSpec: double); virtual;
|
||||||
procedure UpdateBtnStates; virtual;
|
procedure UpdateBtnStates; override;
|
||||||
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; virtual;
|
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
FReportFrame: TReportFrame;
|
constructor Create(AOwner: TComponent); override;
|
||||||
FChartFrame: TChartFrame;
|
|
||||||
procedure Reset; override;
|
procedure Reset; override;
|
||||||
property GroupsNeeded: Boolean read FgroupsNeeded write FGroupsNeeded;
|
property GroupsNeeded: Boolean read FgroupsNeeded write FGroupsNeeded;
|
||||||
|
|
||||||
@ -84,7 +64,7 @@ implementation
|
|||||||
uses
|
uses
|
||||||
Math,
|
Math,
|
||||||
TAChartUtils, TALegend, TAChartAxisUtils, TASources, TACustomSeries, TASeries,
|
TAChartUtils, TALegend, TAChartAxisUtils, TASources, TACustomSeries, TASeries,
|
||||||
Utils, DataProcs;
|
Utils, GridProcs;
|
||||||
|
|
||||||
const
|
const
|
||||||
FORMAT_MASK = '0.000';
|
FORMAT_MASK = '0.000';
|
||||||
@ -92,95 +72,10 @@ const
|
|||||||
|
|
||||||
{ TBasicSPCForm }
|
{ TBasicSPCForm }
|
||||||
|
|
||||||
procedure TBasicSPCForm.CloseBtnClick(Sender: TObject);
|
constructor TBasicSPCForm.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
Close;
|
inherited;
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
// To be overridden by descendant forms
|
|
||||||
procedure TBasicSPCForm.Compute;
|
|
||||||
begin
|
|
||||||
//
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.ComputeBtnClick(Sender: TObject);
|
|
||||||
var
|
|
||||||
msg: String;
|
|
||||||
C: TWinControl;
|
|
||||||
i: Integer;
|
|
||||||
cellString: String;
|
|
||||||
begin
|
|
||||||
if not Validate(msg, C) then begin
|
|
||||||
C.SetFocus;
|
|
||||||
MessageDlg(msg, mtError, [mbOK], 0);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
GrpVar := -1;
|
|
||||||
MeasVar := -1;
|
|
||||||
for i := 1 to NoVariables do
|
|
||||||
begin
|
|
||||||
cellstring := OS3MainFrm.DataGrid.Cells[i, 0];
|
|
||||||
if GroupEdit.Visible and (cellstring = GroupEdit.Text) then GrpVar := i;
|
|
||||||
if MeasEdit.Visible and (cellstring = MeasEdit.Text) then MeasVar := i;
|
|
||||||
end;
|
|
||||||
if GroupsNeeded and GroupEdit.Visible and (GrpVar = -1) then
|
|
||||||
begin
|
|
||||||
GroupEdit.SetFocus;
|
|
||||||
ErrorMsg('Group variable not found.');
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
if MeasEdit.Visible and (MeasVar = -1) then
|
|
||||||
begin
|
|
||||||
MeasEdit.SetFocus;
|
|
||||||
ErrorMsg('Measurement variable not found.');
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
Compute;
|
|
||||||
|
|
||||||
UpdateBtnStates;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.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;
|
|
||||||
|
|
||||||
SpecsPanel.Constraints.MinWidth := Max(
|
|
||||||
VarListLabel.Left + VarListLabel.Width + Varlist.BorderSpacing.Right * 2 + MeasInBtn.Width + MeasLabel.Width,
|
|
||||||
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around
|
|
||||||
);
|
|
||||||
Constraints.MinHeight := MeasEdit.Top + MeasEdit.Height + MeasEdit.BorderSpacing.Bottom + ButtonPanel.Height;
|
|
||||||
|
|
||||||
Position := poDesigned;
|
|
||||||
FAutoSized := true;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.FormCreate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Assert(OS3MainFrm <> nil);
|
|
||||||
|
|
||||||
InitForm(Self);
|
|
||||||
|
|
||||||
FReportFrame := TReportFrame.Create(self);
|
|
||||||
FReportFrame.Parent := ReportPage;
|
|
||||||
FReportFrame.Align := alClient;
|
|
||||||
|
|
||||||
FChartFrame := TChartFrame.Create(self);
|
|
||||||
FChartFrame.Parent := ChartPage;
|
|
||||||
FChartFrame.Align := alClient;
|
|
||||||
FChartFrame.Chart.Legend.SymbolWidth := Scale96ToFont(30);
|
FChartFrame.Chart.Legend.SymbolWidth := Scale96ToFont(30);
|
||||||
FChartFrame.Chart.Legend.Alignment := laBottomCenter;
|
FChartFrame.Chart.Legend.Alignment := laBottomCenter;
|
||||||
FChartFrame.Chart.Legend.ColumnCount := 3;
|
FChartFrame.Chart.Legend.ColumnCount := 3;
|
||||||
@ -191,9 +86,6 @@ begin
|
|||||||
Marks.Source := TListChartSource.Create(self);
|
Marks.Source := TListChartSource.Create(self);
|
||||||
Marks.Style := smsLabel;
|
Marks.Style := smsLabel;
|
||||||
end;
|
end;
|
||||||
InitToolbar(FChartFrame.ChartToolbar, tpTop);
|
|
||||||
|
|
||||||
Reset;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -212,7 +104,7 @@ begin
|
|||||||
SetLength(Result, NoCases);
|
SetLength(Result, NoCases);
|
||||||
for i := 1 to NoCases do
|
for i := 1 to NoCases do
|
||||||
begin
|
begin
|
||||||
if not GoodRecord(i, Length(ColNoSelected), ColNoSelected) then
|
if not GoodRecord(OS3MainFrm.DataGrid, i, ColNoSelected) then
|
||||||
continue;
|
continue;
|
||||||
grp := Trim(OS3MainFrm.DataGrid.Cells[GrpVar, i]);
|
grp := Trim(OS3MainFrm.DataGrid.Cells[GrpVar, i]);
|
||||||
if IndexOfString(Result, grp) = -1 then
|
if IndexOfString(Result, grp) = -1 then
|
||||||
@ -256,14 +148,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.HelpBtnClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
if ContextHelpForm = nil then
|
|
||||||
Application.CreateForm(TContextHelpForm, ContextHelpForm);
|
|
||||||
ContextHelpForm.HelpMessage((Sender as TButton).Tag);
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.MeasInBtnClick(Sender: TObject);
|
procedure TBasicSPCForm.MeasInBtnClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
index: integer;
|
index: integer;
|
||||||
@ -371,51 +255,67 @@ procedure TBasicSPCForm.Reset;
|
|||||||
var
|
var
|
||||||
i : integer;
|
i : integer;
|
||||||
begin
|
begin
|
||||||
VarList.Clear;
|
inherited;
|
||||||
|
|
||||||
GroupEdit.Text := '';
|
GroupEdit.Text := '';
|
||||||
MeasEdit.Text := '';
|
MeasEdit.Text := '';
|
||||||
|
|
||||||
|
VarList.Clear;
|
||||||
for i := 1 to NoVariables do
|
for i := 1 to NoVariables do
|
||||||
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
|
||||||
|
|
||||||
FReportFrame.Clear;
|
if Assigned(FChartFrame) and (FChartFrame.Chart.AxisList.Count > 2) then
|
||||||
FChartFrame.Clear;
|
(FChartFrame.Chart.AxisList[2].Marks.Source as TListChartSource).Clear;
|
||||||
(FChartFrame.Chart.AxisList[2].Marks.Source as TListChartSource).Clear;
|
|
||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.ResetBtnClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Reset;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.UpdateBtnStates;
|
procedure TBasicSPCForm.UpdateBtnStates;
|
||||||
begin
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
MeasInBtn.Enabled := (VarList.ItemIndex <> -1) and (MeasEdit.Text = '');
|
MeasInBtn.Enabled := (VarList.ItemIndex <> -1) and (MeasEdit.Text = '');
|
||||||
MeasOutBtn.Enabled := (MeasEdit.Text <> '');
|
MeasOutBtn.Enabled := (MeasEdit.Text <> '');
|
||||||
GroupInBtn.Enabled := (VarList.ItemIndex <> -1) and (GroupEdit.Text = '');
|
GroupInBtn.Enabled := (VarList.ItemIndex <> -1) and (GroupEdit.Text = '');
|
||||||
GroupOutBtn.Enabled := (GroupEdit.Text <> '');
|
GroupOutBtn.Enabled := (GroupEdit.Text <> '');
|
||||||
|
|
||||||
FReportFrame.UpdateBtnStates;
|
|
||||||
FChartFrame.UpdateBtnStates;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TBasicSPCForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
|
function TBasicSPCForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
|
|
||||||
if GroupEdit.Visible and (GroupEdit.Text = '') then begin
|
if GroupEdit.Visible and (GroupEdit.Text = '') then begin
|
||||||
AMsg := 'Group variable not specified.';
|
AMsg := 'Group variable not specified.';
|
||||||
AControl := GroupEdit;
|
AControl := GroupEdit;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if MeasEdit.Visible and (MeasEdit.Text = '') then
|
if MeasEdit.Visible and (MeasEdit.Text = '') then
|
||||||
begin
|
begin
|
||||||
AMsg := 'Measurement variable not specified.';
|
AMsg := 'Measurement variable not specified.';
|
||||||
AControl := MeasEdit;
|
AControl := MeasEdit;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
GrpVar := GetVariableIndex(OS3MainFrm.DataGrid, GroupEdit.Text);
|
||||||
|
MeasVar := GetVariableIndex(OS3MainFrm.DataGrid, MeasEdit.Text);
|
||||||
|
|
||||||
|
if GroupsNeeded and GroupEdit.Visible and (GrpVar = -1) then
|
||||||
|
begin
|
||||||
|
AMsg := 'Group variable not found.';
|
||||||
|
AControl := GroupEdit;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if MeasEdit.Visible and (MeasVar = -1) then
|
||||||
|
begin
|
||||||
|
AMsg := 'Measurement variable not found.';
|
||||||
|
AControl := MeasEdit;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
Result := true;
|
Result := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -425,6 +325,7 @@ begin
|
|||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TBasicSPCForm.VarListDblClick(Sender: TObject);
|
procedure TBasicSPCForm.VarListDblClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
index: integer;
|
index: integer;
|
||||||
@ -441,5 +342,6 @@ begin
|
|||||||
UpdateBtnStates;
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -4,33 +4,11 @@ inherited CChartForm: TCChartForm
|
|||||||
HelpKeyword = 'html/DefectnonconformitycChart.htm'
|
HelpKeyword = 'html/DefectnonconformitycChart.htm'
|
||||||
Caption = 'Defects C Chart'
|
Caption = 'Defects C Chart'
|
||||||
ClientHeight = 420
|
ClientHeight = 420
|
||||||
OnActivate = FormActivate
|
inherited ParamsPanel: TPanel
|
||||||
inherited SpecsPanel: TPanel
|
|
||||||
Height = 420
|
Height = 420
|
||||||
Width = 440
|
Width = 440
|
||||||
ClientHeight = 420
|
ClientHeight = 420
|
||||||
ClientWidth = 440
|
ClientWidth = 440
|
||||||
inherited ButtonPanel: TPanel
|
|
||||||
Top = 378
|
|
||||||
Width = 440
|
|
||||||
ClientWidth = 440
|
|
||||||
TabOrder = 4
|
|
||||||
inherited CloseBtn: TButton
|
|
||||||
Left = 385
|
|
||||||
end
|
|
||||||
inherited ComputeBtn: TButton
|
|
||||||
Left = 301
|
|
||||||
end
|
|
||||||
inherited ResetBtn: TButton
|
|
||||||
Left = 239
|
|
||||||
end
|
|
||||||
inherited HelpBtn: TButton
|
|
||||||
Left = 188
|
|
||||||
end
|
|
||||||
inherited Bevel1: TBevel
|
|
||||||
Width = 432
|
|
||||||
end
|
|
||||||
end
|
|
||||||
inherited VarList: TListBox
|
inherited VarList: TListBox
|
||||||
Height = 345
|
Height = 345
|
||||||
Width = 200
|
Width = 200
|
||||||
@ -122,13 +100,4 @@ inherited CChartForm: TCChartForm
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited SpecsSplitter: TSplitter
|
|
||||||
Left = 451
|
|
||||||
Height = 420
|
|
||||||
end
|
|
||||||
inherited PageControl: TPageControl
|
|
||||||
Left = 459
|
|
||||||
Height = 408
|
|
||||||
Width = 462
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -125,11 +125,11 @@ begin
|
|||||||
try
|
try
|
||||||
SigmaOptns.AnchorSideRight.Control := nil;
|
SigmaOptns.AnchorSideRight.Control := nil;
|
||||||
VarList.Constraints.MinWidth := VarListLabel.Width;
|
VarList.Constraints.MinWidth := VarListLabel.Width;
|
||||||
SpecsPanel.Constraints.MinWidth := Max(
|
ParamsPanel.Constraints.MinWidth := Max(
|
||||||
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
||||||
SigmaOptns.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
SigmaOptns.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
||||||
);
|
);
|
||||||
Constraints.MinHeight := SigmaOptns.Top + SigmaOptns.Height + SigmaOptns.BorderSpacing.Bottom + ButtonPanel.Height;
|
// Constraints.MinHeight := SigmaOptns.Top + SigmaOptns.Height + SigmaOptns.BorderSpacing.Bottom + ButtonPanel.Height;
|
||||||
|
|
||||||
SigmaOptns.AnchorSideRight.Control := MeasEdit;
|
SigmaOptns.AnchorSideRight.Control := MeasEdit;
|
||||||
SigmaOptns.AnchorSideRight.Side := asrBottom;
|
SigmaOptns.AnchorSideRight.Side := asrBottom;
|
||||||
|
@ -6,34 +6,12 @@ inherited CUSUMChartForm: TCUSUMChartForm
|
|||||||
Caption = 'Cumulative Sum Control Chart'
|
Caption = 'Cumulative Sum Control Chart'
|
||||||
ClientHeight = 503
|
ClientHeight = 503
|
||||||
ClientWidth = 1000
|
ClientWidth = 1000
|
||||||
OnActivate = FormActivate
|
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
inherited SpecsPanel: TPanel
|
inherited ParamsPanel: TPanel
|
||||||
Height = 503
|
Height = 503
|
||||||
Width = 432
|
Width = 432
|
||||||
ClientHeight = 503
|
ClientHeight = 503
|
||||||
ClientWidth = 432
|
ClientWidth = 432
|
||||||
inherited ButtonPanel: TPanel
|
|
||||||
Top = 461
|
|
||||||
Width = 432
|
|
||||||
ClientWidth = 432
|
|
||||||
TabOrder = 5
|
|
||||||
inherited CloseBtn: TButton
|
|
||||||
Left = 377
|
|
||||||
end
|
|
||||||
inherited ComputeBtn: TButton
|
|
||||||
Left = 293
|
|
||||||
end
|
|
||||||
inherited ResetBtn: TButton
|
|
||||||
Left = 231
|
|
||||||
end
|
|
||||||
inherited HelpBtn: TButton
|
|
||||||
Left = 180
|
|
||||||
end
|
|
||||||
inherited Bevel1: TBevel
|
|
||||||
Width = 424
|
|
||||||
end
|
|
||||||
end
|
|
||||||
inherited VarList: TListBox
|
inherited VarList: TListBox
|
||||||
Height = 428
|
Height = 428
|
||||||
Width = 196
|
Width = 196
|
||||||
@ -433,13 +411,4 @@ inherited CUSUMChartForm: TCUSUMChartForm
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited SpecsSplitter: TSplitter
|
|
||||||
Left = 443
|
|
||||||
Height = 503
|
|
||||||
end
|
|
||||||
inherited PageControl: TPageControl
|
|
||||||
Left = 451
|
|
||||||
Height = 491
|
|
||||||
Width = 543
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -365,7 +365,7 @@ begin
|
|||||||
try
|
try
|
||||||
// VMaskGroup.Anchors := VMaskGroup.Anchors - [akRight];
|
// VMaskGroup.Anchors := VMaskGroup.Anchors - [akRight];
|
||||||
VarList.Constraints.MinWidth := VarListLabel.Width;
|
VarList.Constraints.MinWidth := VarListLabel.Width;
|
||||||
SpecsPanel.Constraints.MinWidth := Max(
|
ParamsPanel.Constraints.MinWidth := Max(
|
||||||
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
||||||
GroupBox2.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
GroupBox2.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
||||||
);
|
);
|
||||||
@ -373,7 +373,7 @@ begin
|
|||||||
VMaskScrollbar.BorderSpacing.Bottom + TabularGroup.Height - TabularGroup.ClientHeight;
|
VMaskScrollbar.BorderSpacing.Bottom + TabularGroup.Height - TabularGroup.ClientHeight;
|
||||||
Notebook.Constraints.MinHeight := TabularGroup.Constraints.MinHeight;
|
Notebook.Constraints.MinHeight := TabularGroup.Constraints.MinHeight;
|
||||||
Notebook.Height := 1; // Enforce notebook autosizing
|
Notebook.Height := 1; // Enforce notebook autosizing
|
||||||
Constraints.MinHeight := Notebook.Top + Notebook.Height + Notebook.BorderSpacing.Bottom + ButtonPanel.Height;
|
// Constraints.MinHeight := Notebook.Top + Notebook.Height + Notebook.BorderSpacing.Bottom + ButtonPanel.Height;
|
||||||
if Height < Constraints.MinHeight then
|
if Height < Constraints.MinHeight then
|
||||||
Height := 1; // enforce height autosizing
|
Height := 1; // enforce height autosizing
|
||||||
// VMaskGroup.Anchors := VMaskGroup.Anchors + [akRight];
|
// VMaskGroup.Anchors := VMaskGroup.Anchors + [akRight];
|
||||||
|
@ -4,30 +4,9 @@ inherited PChartForm: TPChartForm
|
|||||||
HelpType = htKeyword
|
HelpType = htKeyword
|
||||||
HelpKeyword = 'html/PControlChart.htm'
|
HelpKeyword = 'html/PControlChart.htm'
|
||||||
Caption = 'P Control Chart'
|
Caption = 'P Control Chart'
|
||||||
OnActivate = FormActivate
|
inherited ParamsPanel: TPanel
|
||||||
inherited SpecsPanel: TPanel
|
|
||||||
Width = 456
|
Width = 456
|
||||||
ClientWidth = 456
|
ClientWidth = 456
|
||||||
inherited ButtonPanel: TPanel
|
|
||||||
Width = 456
|
|
||||||
ClientWidth = 456
|
|
||||||
TabOrder = 6
|
|
||||||
inherited CloseBtn: TButton
|
|
||||||
Left = 401
|
|
||||||
end
|
|
||||||
inherited ComputeBtn: TButton
|
|
||||||
Left = 317
|
|
||||||
end
|
|
||||||
inherited ResetBtn: TButton
|
|
||||||
Left = 255
|
|
||||||
end
|
|
||||||
inherited HelpBtn: TButton
|
|
||||||
Left = 204
|
|
||||||
end
|
|
||||||
inherited Bevel1: TBevel
|
|
||||||
Width = 448
|
|
||||||
end
|
|
||||||
end
|
|
||||||
inherited VarList: TListBox
|
inherited VarList: TListBox
|
||||||
Width = 208
|
Width = 208
|
||||||
end
|
end
|
||||||
@ -175,11 +154,4 @@ inherited PChartForm: TPChartForm
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited SpecsSplitter: TSplitter
|
|
||||||
Left = 467
|
|
||||||
end
|
|
||||||
inherited PageControl: TPageControl
|
|
||||||
Left = 475
|
|
||||||
Width = 446
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -139,11 +139,11 @@ begin
|
|||||||
try
|
try
|
||||||
SigmaOpts.AnchorSideRight.Control := nil;
|
SigmaOpts.AnchorSideRight.Control := nil;
|
||||||
VarList.Constraints.MinWidth := VarListLabel.Width;
|
VarList.Constraints.MinWidth := VarListLabel.Width;
|
||||||
SpecsPanel.Constraints.MinWidth := Max(
|
ParamsPanel.Constraints.MinWidth := Max(
|
||||||
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
||||||
SigmaOpts.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
SigmaOpts.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
||||||
);
|
);
|
||||||
Constraints.MinHeight := SigmaOpts.Top + SigmaOpts.Height + SigmaOpts.BorderSpacing.Bottom + ButtonPanel.Height;
|
// Constraints.MinHeight := SigmaOpts.Top + SigmaOpts.Height + SigmaOpts.BorderSpacing.Bottom + ButtonPanel.Height;
|
||||||
|
|
||||||
SigmaOpts.AnchorSideRight.Control := MeasEdit;
|
SigmaOpts.AnchorSideRight.Control := MeasEdit;
|
||||||
SigmaOpts.AnchorSideRight.Side := asrBottom;
|
SigmaOpts.AnchorSideRight.Side := asrBottom;
|
||||||
|
@ -2,7 +2,7 @@ inherited RChartForm: TRChartForm
|
|||||||
HelpType = htKeyword
|
HelpType = htKeyword
|
||||||
HelpKeyword = 'html/RangeChart.htm'
|
HelpKeyword = 'html/RangeChart.htm'
|
||||||
Caption = 'Range Control Chart'
|
Caption = 'Range Control Chart'
|
||||||
inherited SpecsPanel: TPanel
|
inherited ParamsPanel: TPanel
|
||||||
HelpType = htKeyword
|
HelpType = htKeyword
|
||||||
HelpKeyword = 'html/RangeChart.htm'
|
HelpKeyword = 'html/RangeChart.htm'
|
||||||
end
|
end
|
||||||
|
@ -2,30 +2,9 @@ inherited UChartForm: TUChartForm
|
|||||||
HelpType = htKeyword
|
HelpType = htKeyword
|
||||||
HelpKeyword = 'html/DefectsperUnituChart.htm'
|
HelpKeyword = 'html/DefectsperUnituChart.htm'
|
||||||
Caption = 'Defects per unit U Control Chart'
|
Caption = 'Defects per unit U Control Chart'
|
||||||
OnActivate = FormActivate
|
inherited ParamsPanel: TPanel
|
||||||
inherited SpecsPanel: TPanel
|
|
||||||
Width = 432
|
Width = 432
|
||||||
ClientWidth = 432
|
ClientWidth = 432
|
||||||
inherited ButtonPanel: TPanel
|
|
||||||
Width = 432
|
|
||||||
ClientWidth = 432
|
|
||||||
TabOrder = 5
|
|
||||||
inherited CloseBtn: TButton
|
|
||||||
Left = 377
|
|
||||||
end
|
|
||||||
inherited ComputeBtn: TButton
|
|
||||||
Left = 293
|
|
||||||
end
|
|
||||||
inherited ResetBtn: TButton
|
|
||||||
Left = 231
|
|
||||||
end
|
|
||||||
inherited HelpBtn: TButton
|
|
||||||
Left = 180
|
|
||||||
end
|
|
||||||
inherited Bevel1: TBevel
|
|
||||||
Width = 424
|
|
||||||
end
|
|
||||||
end
|
|
||||||
inherited VarList: TListBox
|
inherited VarList: TListBox
|
||||||
Width = 188
|
Width = 188
|
||||||
end
|
end
|
||||||
|
@ -131,11 +131,11 @@ begin
|
|||||||
try
|
try
|
||||||
SigmaOpts.AnchorSideRight.Control := nil;
|
SigmaOpts.AnchorSideRight.Control := nil;
|
||||||
VarList.Constraints.MinWidth := VarListLabel.Width;
|
VarList.Constraints.MinWidth := VarListLabel.Width;
|
||||||
SpecsPanel.Constraints.MinWidth := Max(
|
ParamsPanel.Constraints.MinWidth := Max(
|
||||||
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
||||||
SigmaOpts.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
SigmaOpts.Width * 2 + VarList.BorderSpacing.Right + VarList.BorderSpacing.Left
|
||||||
);
|
);
|
||||||
Constraints.MinHeight := SigmaOpts.Top + SigmaOpts.Height + SigmaOpts.BorderSpacing.Bottom + ButtonPanel.Height;
|
// Constraints.MinHeight := SigmaOpts.Top + SigmaOpts.Height + SigmaOpts.BorderSpacing.Bottom + ButtonPanel.Height;
|
||||||
|
|
||||||
SigmaOpts.AnchorSideRight.Control := MeasEdit;
|
SigmaOpts.AnchorSideRight.Control := MeasEdit;
|
||||||
SigmaOpts.AnchorSideRight.Side := asrBottom;
|
SigmaOpts.AnchorSideRight.Side := asrBottom;
|
||||||
|
@ -6,77 +6,77 @@ inherited XBarChartForm: TXBarChartForm
|
|||||||
HelpKeyword = 'html/XBarChart.htm'
|
HelpKeyword = 'html/XBarChart.htm'
|
||||||
Caption = 'X-Bar Control Chart'
|
Caption = 'X-Bar Control Chart'
|
||||||
ClientHeight = 476
|
ClientHeight = 476
|
||||||
OnActivate = FormActivate
|
inherited ParamsPanel: TPanel
|
||||||
inherited SpecsPanel: TPanel
|
Height = 460
|
||||||
Height = 476
|
Width = 424
|
||||||
Width = 379
|
ClientHeight = 460
|
||||||
ClientHeight = 476
|
ClientWidth = 424
|
||||||
ClientWidth = 379
|
inherited CloseBtn: TButton
|
||||||
inherited ButtonPanel: TPanel
|
Left = 369
|
||||||
Top = 434
|
Top = 435
|
||||||
Width = 379
|
TabOrder = 8
|
||||||
ClientWidth = 379
|
end
|
||||||
TabOrder = 5
|
inherited ComputeBtn: TButton
|
||||||
inherited CloseBtn: TButton
|
Left = 285
|
||||||
Left = 324
|
Top = 435
|
||||||
end
|
end
|
||||||
inherited ComputeBtn: TButton
|
inherited ResetBtn: TButton
|
||||||
Left = 240
|
Left = 223
|
||||||
end
|
Top = 435
|
||||||
inherited ResetBtn: TButton
|
end
|
||||||
Left = 178
|
inherited HelpBtn: TButton
|
||||||
end
|
Left = 164
|
||||||
inherited HelpBtn: TButton
|
Top = 435
|
||||||
Left = 127
|
TabOrder = 7
|
||||||
end
|
end
|
||||||
inherited Bevel1: TBevel
|
inherited ButtonBevel: TBevel
|
||||||
Width = 371
|
Top = 419
|
||||||
end
|
Width = 424
|
||||||
end
|
end
|
||||||
inherited VarList: TListBox
|
inherited VarList: TListBox
|
||||||
Height = 401
|
Height = 394
|
||||||
Width = 169
|
Width = 191
|
||||||
end
|
end
|
||||||
inherited GroupLabel: TLabel
|
inherited GroupLabel: TLabel
|
||||||
Left = 209
|
Left = 233
|
||||||
end
|
end
|
||||||
inherited GroupEdit: TEdit
|
inherited GroupEdit: TEdit
|
||||||
Left = 209
|
Left = 233
|
||||||
Width = 170
|
Width = 191
|
||||||
end
|
end
|
||||||
inherited MeasLabel: TLabel
|
inherited MeasLabel: TLabel
|
||||||
Left = 209
|
Left = 233
|
||||||
end
|
end
|
||||||
inherited MeasEdit: TEdit
|
inherited MeasEdit: TEdit
|
||||||
AnchorSideRight.Control = LevelOptns
|
AnchorSideRight.Control = LevelOptns
|
||||||
Left = 209
|
Left = 233
|
||||||
Width = 170
|
Width = 191
|
||||||
end
|
end
|
||||||
inherited Bevel2: TBevel
|
inherited Bevel2: TBevel
|
||||||
Left = 178
|
Left = 201
|
||||||
end
|
end
|
||||||
inherited MeasInBtn: TSpeedButton
|
inherited MeasInBtn: TSpeedButton
|
||||||
Left = 177
|
Left = 199
|
||||||
end
|
end
|
||||||
inherited MeasOutBtn: TSpeedButton
|
inherited MeasOutBtn: TSpeedButton
|
||||||
Left = 178
|
Left = 199
|
||||||
end
|
end
|
||||||
inherited GroupInBtn: TSpeedButton
|
inherited GroupInBtn: TSpeedButton
|
||||||
Left = 177
|
Left = 199
|
||||||
end
|
end
|
||||||
inherited GroupOutBtn: TSpeedButton
|
inherited GroupOutBtn: TSpeedButton
|
||||||
Left = 178
|
Left = 199
|
||||||
end
|
end
|
||||||
object SigmaOpts: TRadioGroup[12]
|
object SigmaOpts: TRadioGroup[16]
|
||||||
AnchorSideLeft.Control = MeasInBtn
|
AnchorSideLeft.Control = MeasInBtn
|
||||||
AnchorSideTop.Control = GroupOutBtn
|
AnchorSideTop.Control = GroupOutBtn
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = LevelOptns
|
AnchorSideRight.Control = LevelOptns
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 177
|
Left = 199
|
||||||
Height = 128
|
Height = 128
|
||||||
Top = 153
|
Top = 157
|
||||||
Width = 202
|
Width = 225
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoFill = True
|
AutoFill = True
|
||||||
BorderSpacing.Top = 12
|
BorderSpacing.Top = 12
|
||||||
@ -90,7 +90,7 @@ inherited XBarChartForm: TXBarChartForm
|
|||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
ChildSizing.ControlsPerLine = 1
|
ChildSizing.ControlsPerLine = 1
|
||||||
ClientHeight = 108
|
ClientHeight = 108
|
||||||
ClientWidth = 198
|
ClientWidth = 221
|
||||||
ItemIndex = 0
|
ItemIndex = 0
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'3 Sigma'
|
'3 Sigma'
|
||||||
@ -106,7 +106,7 @@ inherited XBarChartForm: TXBarChartForm
|
|||||||
Left = 128
|
Left = 128
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 80
|
Top = 80
|
||||||
Width = 58
|
Width = 81
|
||||||
Alignment = taRightJustify
|
Alignment = taRightJustify
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
@ -114,23 +114,23 @@ inherited XBarChartForm: TXBarChartForm
|
|||||||
Text = 'XSigmaEdit'
|
Text = 'XSigmaEdit'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object LevelOptns: TGroupBox[13]
|
object LevelOptns: TGroupBox[17]
|
||||||
AnchorSideLeft.Control = MeasInBtn
|
AnchorSideLeft.Control = MeasInBtn
|
||||||
AnchorSideTop.Control = SigmaOpts
|
AnchorSideTop.Control = SigmaOpts
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = MeasEdit
|
AnchorSideRight.Control = MeasEdit
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 177
|
Left = 199
|
||||||
Height = 128
|
Height = 128
|
||||||
Top = 293
|
Top = 297
|
||||||
Width = 202
|
Width = 225
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 12
|
BorderSpacing.Top = 12
|
||||||
BorderSpacing.Bottom = 8
|
BorderSpacing.Bottom = 8
|
||||||
Caption = 'Show...'
|
Caption = 'Show...'
|
||||||
ClientHeight = 108
|
ClientHeight = 108
|
||||||
ClientWidth = 198
|
ClientWidth = 221
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
object UpperSpecChk: TCheckBox
|
object UpperSpecChk: TCheckBox
|
||||||
AnchorSideLeft.Control = LevelOptns
|
AnchorSideLeft.Control = LevelOptns
|
||||||
@ -232,13 +232,13 @@ inherited XBarChartForm: TXBarChartForm
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
inherited SpecsSplitter: TSplitter
|
inherited ParamsSplitter: TSplitter
|
||||||
Left = 390
|
Left = 436
|
||||||
Height = 476
|
Height = 476
|
||||||
end
|
end
|
||||||
inherited PageControl: TPageControl
|
inherited PageControl: TPageControl
|
||||||
Left = 398
|
Left = 445
|
||||||
Height = 464
|
Height = 460
|
||||||
Width = 523
|
Width = 474
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -41,16 +41,19 @@ type
|
|||||||
UpperSpecChk: TCheckBox;
|
UpperSpecChk: TCheckBox;
|
||||||
UpperSpecEdit: TEdit;
|
UpperSpecEdit: TEdit;
|
||||||
XSigmaEdit: TEdit;
|
XSigmaEdit: TEdit;
|
||||||
procedure FormActivate(Sender: TObject);
|
|
||||||
private
|
private
|
||||||
FAveStdDev: Double;
|
FAveStdDev: Double;
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
procedure AdjustConstraints; override;
|
||||||
procedure Compute; override;
|
procedure Compute; override;
|
||||||
procedure PlotMeans(ATitle, AXTitle, AYTitle, ADataTitle, AGrandMeanTitle: String;
|
procedure PlotMeans(ATitle, AXTitle, AYTitle, ADataTitle, AGrandMeanTitle: String;
|
||||||
const Groups: StrDyneVec; const Means: DblDyneVec;
|
const Groups: StrDyneVec; const Means: DblDyneVec;
|
||||||
UCL, LCL, GrandMean, TargetSpec, LowerSpec, UpperSpec: double); override;
|
UCL, LCL, GrandMean, TargetSpec, LowerSpec, UpperSpec: double); override;
|
||||||
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override;
|
function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override;
|
||||||
public
|
|
||||||
|
public
|
||||||
procedure Reset; override;
|
procedure Reset; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -66,40 +69,15 @@ uses
|
|||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
procedure TXBarChartForm.FormActivate(Sender: TObject);
|
procedure TXBarChartForm.AdjustConstraints;
|
||||||
var
|
|
||||||
w: Integer;
|
|
||||||
begin
|
begin
|
||||||
if FAutoSized then
|
ParamsPanel.Constraints.MinWidth := Max(
|
||||||
exit;
|
4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left,
|
||||||
|
LevelOptns.Width * 2 - MeasInBtn.Width);
|
||||||
|
|
||||||
w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]);
|
ParamsPanel.Constraints.MinHeight :=
|
||||||
HelpBtn.Constraints.MinWidth := w;
|
LevelOptns.Top + LevelOptns.Height + LevelOptns.BorderSpacing.Bottom +
|
||||||
ResetBtn.Constraints.MinWidth := w;
|
ButtonBevel.Height + CloseBtn.BorderSpacing.Top + CloseBtn.Height;
|
||||||
ComputeBtn.Constraints.MinWidth := w;
|
|
||||||
CloseBtn.Constraints.MinWidth := w;
|
|
||||||
|
|
||||||
DisableAutoSizing;
|
|
||||||
try
|
|
||||||
LevelOptns.AnchorSideRight.Control := nil;
|
|
||||||
VarList.Constraints.MinWidth := VarListLabel.Width;
|
|
||||||
SpecsPanel.Constraints.MinWidth := Max(
|
|
||||||
CloseBtn.Left + CloseBtn.Width - HelpBtn.Left + HelpBtn.BorderSpacing.Around,
|
|
||||||
LevelOptns.Width * 2 + VarList.BorderSpacing.Right //* 2 + MeasInBtn.Width
|
|
||||||
);
|
|
||||||
Constraints.MinHeight := LevelOptns.Top + LevelOptns.Height + LevelOptns.BorderSpacing.Bottom + ButtonPanel.Height;
|
|
||||||
|
|
||||||
LevelOptns.AnchorSideRight.Control := MeasEdit;
|
|
||||||
LevelOptns.AnchorSideRight.Side := asrBottom;
|
|
||||||
|
|
||||||
if Height < Constraints.MinHeight then
|
|
||||||
Height := 1; // enforce height autosizing
|
|
||||||
finally
|
|
||||||
EnableAutoSizing;
|
|
||||||
end;
|
|
||||||
|
|
||||||
Position := poDesigned;
|
|
||||||
FAutoSized := true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -123,7 +101,6 @@ var
|
|||||||
grp: String;
|
grp: String;
|
||||||
X, Xsq, prevX: Double;
|
X, Xsq, prevX: Double;
|
||||||
sigma, UCL, LCL, grandMean, grandSD, SEMean: Double;
|
sigma, UCL, LCL, grandMean, grandSD, SEMean: Double;
|
||||||
//C4Value: Double;
|
|
||||||
individualsChart: Boolean;
|
individualsChart: Boolean;
|
||||||
lReport: TStrings;
|
lReport: TStrings;
|
||||||
begin
|
begin
|
||||||
@ -345,6 +322,7 @@ begin
|
|||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TXBarChartForm.PlotMeans(
|
procedure TXBarChartForm.PlotMeans(
|
||||||
ATitle, AXTitle, AYTitle, ADataTitle, AGrandMeanTitle: String;
|
ATitle, AXTitle, AYTitle, ADataTitle, AGrandMeanTitle: String;
|
||||||
const Groups: StrDyneVec; const Means: DblDyneVec;
|
const Groups: StrDyneVec; const Means: DblDyneVec;
|
||||||
@ -377,29 +355,38 @@ end;
|
|||||||
procedure TXBarChartForm.Reset;
|
procedure TXBarChartForm.Reset;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
UpperSpecEdit.Text := '';
|
UpperSpecEdit.Text := '';
|
||||||
LowerSpecEdit.Text := '';
|
LowerSpecEdit.Text := '';
|
||||||
TargetSpecEdit.Text := '';
|
TargetSpecEdit.Text := '';
|
||||||
XSigmaEdit.Text := '';
|
XSigmaEdit.Text := '';
|
||||||
|
|
||||||
UpperSpecChk.Checked := false;
|
UpperSpecChk.Checked := false;
|
||||||
LowerSpecChk.Checked := false;
|
LowerSpecChk.Checked := false;
|
||||||
TargetChk.Checked := false;
|
TargetChk.Checked := false;
|
||||||
ZonesChk.Checked := false;
|
ZonesChk.Checked := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TXBarChartForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
|
function TXBarChartForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean;
|
||||||
var
|
var
|
||||||
x: Double;
|
x: Double;
|
||||||
begin
|
begin
|
||||||
Result := inherited;
|
Result := inherited;
|
||||||
|
|
||||||
|
if not Result then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
{
|
||||||
if (not Result) then
|
if (not Result) then
|
||||||
begin
|
begin
|
||||||
// This particular chart will handle individual data if GroupEdit is empty.
|
// This particular chart will handle individual data if GroupEdit is empty.
|
||||||
if GroupEdit.Visible and (GroupEdit.Text = '') then
|
if GroupEdit.Visible and (GroupEdit.Text = '') then
|
||||||
Result := true
|
Result := true // wp: ??? will be reset after the "if"
|
||||||
else
|
else
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
Result := false;
|
Result := false;
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Compute;
|
Compute;
|
||||||
|
UpdateBtnStates;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user