User:Kate Racaza/test page: Difference between revisions
Kate Racaza (talk | contribs) No edit summary |
Kate Racaza (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
==Prerequisites== | ==Prerequisites== | ||
In this tutorial, you'll use a Windows Form application to create a button that, when clicked, analyzes a Weibull++ data set and displays the resulting plot. Before you begin, be sure to create a Windows Form Application project, and | In this tutorial, you'll use a Windows Form application to create a button that, when clicked, analyzes a Weibull++ data set and displays the resulting plot. Before you begin, be sure to create a Windows Form Application project, and add a '''button''' and a '''picturebox''' control to the form. You can rename the button to "Create Plot," if desired. | ||
Need help with creating Windows Forms? See this [https://msdn.microsoft.com/en-us/library/b201w61t%28v=vs.100%29.aspx Microsoft tutorial]. | Need help with creating Windows Forms? See this [https://msdn.microsoft.com/en-us/library/b201w61t%28v=vs.100%29.aspx Microsoft tutorial]. | ||
==Tutorial: W++/ALTA Plots == | ==Tutorial: W++/ALTA Plots == | ||
The following example demonstrates how to use the Synthesis API to create a plot and display it in a Windows application. A discussion of the example follows. | The following example demonstrates how to use the Synthesis API to create a Weibull++ probability plot and display it in a Windows application. A discussion of the example follows. | ||
'''VB.NET''' | '''VB.NET''' | ||
Line 43: | Line 43: | ||
WPlot.AddDataset(WDS) | WPlot.AddDataset(WDS) | ||
{{APIComment|'Create a probability plot and display it in the | {{APIComment|'Create a probability plot and display it in the PictureBox.}} | ||
PictureBox1.Image =WPlot.CreatePlot(WAPlotType.Probability) | PictureBox1.Image = WPlot.CreatePlot(WAPlotType.Probability) | ||
PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize | PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize | ||
Line 53: | Line 53: | ||
==Discussion== | ==Discussion== | ||
The | The Synthesis API can create plots only from analyzed data sets. In this example, the first three sections of code demonstrate how to create and analyze a simple Weibull++ data set (for a full discussion, see [[Perform_Life_Data_Analysis_on_External_Data_Source|this tutorial]]). | ||
{{APIComment|'Create a Weibull++ data set.}} | |||
{{APIPrefix|Dim}} WDS {{APIPrefix|As New}} WeibullDataSet | |||
WDS.AddFailure(16, 1) | |||
WDS.AddFailure(34, 1) | |||
WDS.AddFailure(53, 1) | |||
WDS.AddFailure(75, 1) | |||
WDS.AddFailure(93, 1) | |||
WDS.AddSuspension(120, 5) | |||
{{APIComment|'Analyze the data set using the 2-parameter Weibull distribution and}} | |||
{{APIComment|'the RRX analysis method. Keep all other analysis settings at default.}} | |||
WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull | |||
WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter | |||
WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX | |||
{{APIComment|'Analyze the data set.}} | |||
WDS.Calculate() | |||
The [[WAPlots Class|WAPlots]] object represents a plot based on the fitted model of a Weibull++ or ALTA data set. Use the [[WAPlots.AddDataset|AddDataset]] method to assign the data set (in this case, a WeibullDataSet object) to the plot. | |||
{{APIComment|'Declare a new WAPlots object.}} | |||
{{APIPrefix|Dim}} WPlot {{APIPrefix|As New}} WAPlots | |||
{{APIComment|'Add the analyzed data set to the plot.}} | |||
WPlot.AddDataset(WDS) | |||
Use the [[WAPlots.CreatePlot|CreatePlot]] method to create the plot. To display the plot, assign it to the <code>Image</code> property of the PictureBox. The <code>SizeMode</code> property is optional; it resizes the PictureBox to fit the image. | |||
Use the [[ | |||
The <code> | |||
{{APIComment|' | {{APIComment|'Create a probability plot and display it in the PictureBox.}} | ||
PictureBox1.Image = WPlot.CreatePlot(WAPlotType.Probability) | |||
PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize | |||
==References== | |||
*[[ | *[[WAPlots Class]] | ||
* | **[[WAPlots.AddDataset|WAPlots.AddDataset Method]] | ||
**[[WAPlots.CreatePlot|WAPlots.CreatePlot Method]] | |||
*[[ | |||
* | |||
*[[ | |||
Revision as of 23:12, 12 May 2016
DRAFT
xxx
Prerequisites
In this tutorial, you'll use a Windows Form application to create a button that, when clicked, analyzes a Weibull++ data set and displays the resulting plot. Before you begin, be sure to create a Windows Form Application project, and add a button and a picturebox control to the form. You can rename the button to "Create Plot," if desired.
Need help with creating Windows Forms? See this Microsoft tutorial.
Tutorial: W++/ALTA Plots
The following example demonstrates how to use the Synthesis API to create a Weibull++ probability plot and display it in a Windows application. A discussion of the example follows.
VB.NET Imports SynthesisAPI Module Module1 Sub Main() 'Create a Weibull++ data set. Dim WDS As New WeibullDataSet WDS.AddFailure(16, 1) WDS.AddFailure(34, 1) WDS.AddFailure(53, 1) WDS.AddFailure(75, 1) WDS.AddFailure(93, 1) WDS.AddSuspension(120, 5) 'Analyze the data set using the 2-parameter Weibull distribution and 'the RRX analysis method. Keep all other analysis settings at default. WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX 'Analyze the data set. WDS.Calculate() 'Declare a new WAPlots object. Dim WPlot As New WAPlots 'Add the analyzed data set to the plot. WPlot.AddDataset(WDS) 'Create a probability plot and display it in the PictureBox. PictureBox1.Image = WPlot.CreatePlot(WAPlotType.Probability) PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize End Sub End Module
Discussion
The Synthesis API can create plots only from analyzed data sets. In this example, the first three sections of code demonstrate how to create and analyze a simple Weibull++ data set (for a full discussion, see this tutorial).
'Create a Weibull++ data set. Dim WDS As New WeibullDataSet WDS.AddFailure(16, 1) WDS.AddFailure(34, 1) WDS.AddFailure(53, 1) WDS.AddFailure(75, 1) WDS.AddFailure(93, 1) WDS.AddSuspension(120, 5) 'Analyze the data set using the 2-parameter Weibull distribution and 'the RRX analysis method. Keep all other analysis settings at default. WDS.AnalysisSettings.Distribution = WeibullSolverDistribution.Weibull WDS.AnalysisSettings.Parameters = WeibullSolverNumParameters.MS_2Parameter WDS.AnalysisSettings.Analysis = WeibullSolverMethod.RRX 'Analyze the data set. WDS.Calculate()
The WAPlots object represents a plot based on the fitted model of a Weibull++ or ALTA data set. Use the AddDataset method to assign the data set (in this case, a WeibullDataSet object) to the plot.
'Declare a new WAPlots object. Dim WPlot As New WAPlots 'Add the analyzed data set to the plot. WPlot.AddDataset(WDS)
Use the CreatePlot method to create the plot. To display the plot, assign it to the Image
property of the PictureBox. The SizeMode
property is optional; it resizes the PictureBox to fit the image.
'Create a probability plot and display it in the PictureBox.
PictureBox1.Image = WPlot.CreatePlot(WAPlotType.Probability)
PictureBox1.SizeMode = PictureBoxSizeMode.AutoSize