The component which implements all server logic. It divides the task of profile fitting on a few subtasks of fitting on intervals. The intervals should be defined before manually or automatically. All interface methods should allow calling in arbitrary state, this should not be considered as inadmissible situation, but corresponding error code should be returned. In fitting knowledge of wavelength is not required. This is why all components TNeutronPointsSet were changed on TPointsSet. This also allows to abstract from tasks of neutron diffraction and to come to tasks from arbitrary field in which data have form of profile. It is impossible simply to replace TNeutronPointsSet on TPointsSet because at the server side methods of TFitViewer are called which require TTitlePointsSet. Moreover graphics is still implemented at server side. This requires usage of TNeutronPointsSet which supports argument recalculation. Interface methods results shows is requested operation allowed or not. Instead of EAssertionFailed the EUserException is used because it is impossible to guarantee that exception will not be thrown from library. This is acceptable only for classes which process user commands. Rest of the classes should use EAssertionFailed in the case of inadmissible state. Boundary class shoud interpret such exception as fatal error but EUserException as state errors. This implementation performs all operations in the thread of caller. It should store all the data necessary for operations including selected intervals because client can be unable to store data.
 |
constructor Create; |
 |
destructor Destroy; override; |
 |
function AsyncOper: boolean; |
 |
function ComputeBackgroundPoints: string; virtual; |
 |
function ComputeCurveBounds: string; virtual; |
 |
function ComputeCurvePositions: string; virtual; |
 |
function DoAllAutomatically: string; virtual; |
 |
function GetAbsRFactorStr: string; |
 |
function GetBackFactor: double; |
 |
function GetBackgroundPoints: TTitlePointsSet; |
 |
function GetBackgroundVariationEnabled: boolean; |
 |
function GetCalcProfilePointsSet: TTitlePointsSet; |
 |
function GetCalcTimeStr: string; |
 |
function GetCurveAttributes: TMSCRCurveList; |
 |
function GetCurveCount: longint; |
 |
function GetCurveParameterCount(SpecIndex: longint): longint; |
 |
function GetCurvePoints(SpecIndex: longint): TNamedPointsSet; |
 |
function GetCurvePositions: TTitlePointsSet; |
 |
function GetCurves: TSelfCopiedCompList; |
 |
function GetCurveScalingEnabled: boolean; |
 |
function GetCurveThresh: double; |
 |
function GetCurveType: TCurveTypeId; |
 |
function GetDeltaProfilePointsSet: TTitlePointsSet; |
 |
function GetMaxRFactor: double; |
 |
function GetProfilePointsSet: TTitlePointsSet; |
 |
function GetRFactorBounds: TTitlePointsSet; |
 |
function GetRFactorStr: string; |
 |
function GetSelectedProfileInterval: TTitlePointsSet; |
 |
function GetSpecialCurveParameters: Curve_parameters; |
 |
function GetSqrRFactorStr: string; |
 |
function GetState: TFitServerState; |
 |
function GetWaveLength: double; |
 |
function MinimizeDifference: string; virtual; |
 |
function MinimizeDifferenceAgain: string; virtual; |
 |
function MinimizeNumberOfCurves: string; virtual; |
 |
function SelectAllPointsAsCurvePositions: string; virtual; |
 |
function SelectEntireProfile: string; |
 |
function SelectProfileInterval(StartPointIndex, StopPointIndex: longint): string; |
 |
function SetBackgroundPointsSet(ABackgroundPoints: TTitlePointsSet): string; |
 |
function SetCurvePositions(ACurvePositions: TPointsSet): string; |
 |
function SetProfilePointsSet(APointsSet: TTitlePointsSet): string; |
 |
function SetRFactorBounds(ARFactorBounds: TPointsSet): string; |
 |
function SmoothProfile: string; |
 |
function ComputeBackgroundPointsActual(Data: TPointsSet): TPointsSet; |
 |
function ComputeCurvePositionsActual(SearchMinimums: boolean): TTitlePointsSet; |
 |
function CreateTaskObject: TFitTask; virtual; |
 |
function GetAllInitialized: boolean; |
 |
function GetTotalAbsRFactor: double; |
 |
function GetTotalRFactor: double; |
 |
function GetTotalSqrRFactor: double; |
 |
function Integrate(Points: TPointsSet): double; |
 |
function IntegrateWithBoundaries(Points: TPointsSet; StartPointIndex, StopPointIndex: longint): double; |
 |
procedure AbortAsyncOper; virtual; abstract; |
 |
procedure AddPointToBackground(XValue, YValue: double); |
 |
procedure AddPointToCurvePositions(XValue, YValue: double); |
 |
procedure AddPointToProfile(XValue, YValue: double); |
 |
procedure AddPointToRFactorBounds(XValue, YValue: double); |
 |
procedure CreateCurveList; |
 |
procedure GetCurveParameter(SpecIndex: longint; ParamIndex: longint; var Name: string; var Value: double; var Type_: longint); |
 |
procedure ReplacePointInBackground(PrevXValue, PrevYValue, NewXValue, NewYValue: double); |
 |
procedure ReplacePointInCurvePositions(PrevXValue, PrevYValue, NewXValue, NewYValue: double); |
 |
procedure ReplacePointInProfile(PrevXValue, PrevYValue, NewXValue, NewYValue: double); |
 |
procedure ReplacePointInRFactorBounds(PrevXValue, PrevYValue, NewXValue, NewYValue: double); |
 |
procedure SetBackFactor(ABackFactor: double); |
 |
procedure SetBackgroundVariationEnabled(AEnable: boolean); |
 |
procedure SetCurveParameter(SpecIndex: longint; ParamIndex: longint; Value: double); |
 |
procedure SetCurveScalingEnabled(AEnabled: boolean); |
 |
procedure SetCurveThresh(ACurveThresh: double); |
 |
procedure SetCurveType(ACurveTypeId: TCurveTypeId); |
 |
procedure SetMaxRFactor(AMaxRFactor: double); |
 |
procedure SetSpecialCurveParameters(ACurveExpr: string; CP: Curve_parameters); |
 |
procedure StopAsyncOper; virtual; abstract; |
 |
procedure SubtractBackground; |
 |
procedure SubtractBackground(Auto: boolean); |
 |
procedure AddCurveToList(Points: TCurvePointsSet; StartPointIndex, StopPointIndex: longint); |
 |
procedure AddPoint(var Points: TTitlePointsSet; XValue, YValue: double); |
 |
procedure ComputeBackgroundPointsAlg; |
 |
procedure ComputeBackgroundPointsDone; virtual; |
 |
procedure ComputeBackgroundPointsDoneProcActual; |
 |
procedure ComputeCurveBoundsAlg; |
 |
procedure ComputeCurveBoundsDone; virtual; |
 |
procedure ComputeCurveBoundsDoneProcActual; |
 |
procedure ComputeCurvePositionsAlg; |
 |
procedure ComputeCurvePositionsDone; virtual; |
 |
procedure ComputeCurvePositionsDoneProcActual; |
 |
procedure ComputeCurvePositionsForAutoAlg; |
 |
procedure CreateDeltaProfile; |
 |
procedure CreateParameters(ACurveExpr: string); |
 |
procedure CreateResultedCurvePositions; |
 |
procedure CreateResultedProfile; |
 |
procedure CreateTasks; |
 |
procedure DoAllAutomaticallyAlg; |
 |
procedure Done; virtual; |
 |
procedure DoneProc; virtual; |
 |
procedure FillCurveParameterList; |
 |
procedure FillCurvesList; |
 |
procedure GoToReadyForFit; |
 |
procedure InitTasks; |
 |
procedure MinimizeDifferenceAgainAlg; virtual; |
 |
procedure MinimizeDifferenceAlg; virtual; |
 |
procedure MinimizeNumberOfCurvesAlg; virtual; |
 |
procedure RecreateMainCalcThread(ACurrentTask: TThreadMethod; ADoneProc: TThreadMethod); virtual; |
 |
procedure SelectAllPointsAsCurvePositionsAlg; |
 |
procedure SelectProfileIntervalActual(Points: TPointsSet; StartPointIndex, StopPointIndex: longint); |
 |
procedure SetState(AState: TFitServerState); virtual; |
 |
procedure SetWaveLength(AWaveLength: double); |
 |
procedure ShowCurMin(Min: double); virtual; |
 |
procedure ShowCurMinInternal; virtual; |
 |
procedure ShowProfile; virtual; |
 |
procedure SmoothProfileActual(ANeutronPointsSet: TPointsSet); |
 |
procedure SubtractBackgroundLinearly(Data: TPointsSet; StartIndex: longint; EndIndex: longint); |