WAPlots Class: Difference between revisions
Jump to navigation
Jump to search
Chris Kahn (talk | contribs) |
Chris Kahn (talk | contribs) |
||
Line 80: | Line 80: | ||
NewPlotSettings.PlotYTolerance = 6 | NewPlotSettings.PlotYTolerance = 6 | ||
NewPlotSettings.ConfBounds_TypesSelected = ConfBoundsTypes.None | NewPlotSettings.ConfBounds_TypesSelected = ConfBoundsTypes.None | ||
{{APIComment|'Add the WeibullDataSet to the WAPlots object.}} | {{APIComment|'Add the WeibullDataSet to the WAPlots object.}} | ||
WeibullALTAPlot.AddDataset(WDS) | WeibullALTAPlot.AddDataset(WDS) |
Revision as of 17:35, 28 April 2014
Creates a plot based on a fitted model in a WeibullDataSet or ALTADataSet object.
Constructors
- WAPlots Creates a new WAPlots object.
Methods
- AddDataset( WADataSet ) Adds the specified WeibullDataSet or ALTADataSet object that the plot will be based on.
- CreatePlot( WAPlotType, [WAPlotSettings], [Integer], [Integer] ) Returns a bitmap object with the specified plot. Not for use with VB6/VBA.
- CreatePlotVB6( WAPlotType, [WAPlotSettings], [Integer], [Integer] ) Returns an IPicture object with the specified plot. For VBA/VB6 only.
- Clear Removes the added WeibullDataSet/ALTADataSet object. (Required before a new data set can be added.)
Properties
- ErrorHappened (as boolean) Whether an error happened during the creation of the plot.
- ErrorMessage (as string) The error that happened during the creation of the plot. Set only if ErrorHappened is true.
Usage Example
This example demonstrates how to fit a times-to-failure data set to a life distribution and then use the fitted distribution to create a plot. Full application examples are available at Synthesis_API_Reference#Application_Examples.
'Initialize a new WeibullDataSet object. See WeibullDataSet. Dim ADS As New WeibullDataSet("DataSet1") 'Set the life distribution. WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter 'Set the applicable analysis settings. WDS.AnalysisSettings.Analysis = WeibullSolverMethod.MLE WDS.AnalysisSettings.RankingMethod = WeibullSolverRankMethod.Median WDS.AnalysisSettings.UseRSRegression = False WDS.AnalysisSettings.ConfBounds = WeibullSolverCBMethod.FisherMatrix WDS.AnalysisSettings.SortBeforeCalculations = True WDS.AnalysisSettings.UngroupGroupedData = False 'Set the Application Setup options. WDS.AnalysisSettings.UseSpecialSort = True WDS.GeneralSettings.AllowBiasingNormal = False WDS.GeneralSettings.DiscardNegLocation = False WDS.GeneralSettings.ResetExpLocation = False WDS.GeneralSettings.Use3PTrueMLE = False WDS.GeneralSettings.UseExtendedGGamma = False WDS.GeneralSettings.UsePlottedYPoints = False WDS.GeneralSettings.WarnNegLocation = False 'Add failure times. WDS.AddFailure(16, 1) WDS.AddFailure(34, 1) WDS.AddFailure(53, 1) WDS.AddFailure(75, 1) WDS.AddFailure(93, 1) WDS.AddFailure(120, 1) 'Add 4 suspensions. WDS.AddFailure(120, 4) 'Fit failure times to the specified distribution. WDS.Calculate() 'Create a WAPlots object. See WAPlots. Dim WeibullALTAPlot As New WAPlots 'Initialize a new WAPlotSettings object with customized plot settings. See WAPlotSettings. Dim NewPlotSettings As New WAPlotSettings NewPlotSettings.UserName = User Name NewPlotSettings.UserCompany = Company NewPlotSettings.AutoscaleX = True NewPlotSettings.AutoscaleY = True NewPlotSettings.ShowTargetReliability = False NewPlotSettings.ShowTargetTime = False NewPlotSettings.ShowTargetMarker = False NewPlotSettings.ShowSuspensionPoints = True NewPlotSettings.ShowLeftCensoredPoints = True NewPlotSettings.ShowLinesAroundInterval = True NewPlotSettings.AdjustMLEPoints = True NewPlotSettings.StraightenGammaLine = True NewPlotSettings.ShowNumberInGroup = True NewPlotSettings.PlotXPrecision = 3 NewPlotSettings.PlotyPrecision = 3 NewPlotSettings.PlotXTolerance = 6 NewPlotSettings.PlotYTolerance = 6 NewPlotSettings.ConfBounds_TypesSelected = ConfBoundsTypes.None 'Add the WeibullDataSet to the WAPlots object. WeibullALTAPlot.AddDataset(WDS) 'Define an image object to store the plot picture. Dim PlotPicture as Image 'Create an image of a reliability vs. time plot and save 'it in PlotPicture using the customized plot settings. PlotPicture = WeibullALTAPlot.CreatePlot(WAPlotType.Reliability, NewPlotSettings)