WeibullDataSet.GetDistrParameters: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
(Replaced content with '{{Template:API}}{{Template:APIBreadcrumb}} {{Template:InProgress}}')
Line 1: Line 1:
{{Template:APIClass|WeibullEvents Class|WeibullEvents}}
{{Template:API}}{{Template:APIBreadcrumb}}
Displays a prompt for entering customized parameters. This is called when the Calculate method is called and there is insufficient data to fit a model.
{{Template:InProgress}}
 
== Syntax ==
<ul><li>GetDistrParameters(
{{APIName|sender}}
{{APIPrefix|As}}
{{APIName|[[WeibullDataSet Class|WeibullDataSet]],}}
{{APIName|sMsg}}
{{APIPrefix|As String}}
{{APIName|,}}
{{APIName|GetOnlyOneParameter}}
{{APIPrefix|As Boolean}}
{{APIName|,}}
{{APIName|Params}}
{{APIPrefix|As}}
{{APIName|List(}}
{{APIPrefix|Of}}
{{APIName|[[ParamInputInfo Class|ParamInputInfo]] )}}
{{APIName|, Cancel}}
{{APIPrefix|As Boolean}})</li></ul>
 
Parameters
:''sender'': A [[WeibullDataSet Class|WeibullDataSet]] object.
 
:''sMsg'': The main display label.
 
:''GetOnlyOneParameter'': The prompt for only one parameter.
 
:''Params'': A list of [[ParamInputInfo Class|ParamInputInfo]] objects that would be updated by this prompt. After processing with this event handler, the Value of each ParamInputInfo object will be updated.
 
:''Cancel'': If the prompt was closed by any means other than clicking "Okay," this value will be set to True.
 
== Usage Example ==
 
{{APIComment|'Overrides requested. Create a new class, inherit WeibullEvents, and set the dataset's events.}}
  Private Class myEvents
      Inherits WeibullEvents
      Public Overrides Sub GetDistrParameters(sender As WeibullDataSet, sMsg As String,
      GetOnlyOneParamater As Boolean, Params As List(Of ParamInputInfo), ByRef Cancel As Boolean)
          MyBase.GetDistrParameters(sender, sMsg, GetOnlyOneParamater, Params, Cancel)
          MessageBox.Show("Additional overridden code here.")
      End Sub
  End Class
 
{{APIComment|'Declare the WeibullDataSet.}}
  Dim WDS as New WeibullDataSet
 
{{APIComment|'Use the created myEvents class in place of the one created by the dataset.}}
  WDS.Events = New myEvents
 
{{APIComment|'Creates a new list of [[ParamInputInfo Class|ParamInputInfo]] objects. Populate the list.}}
  Dim Params As New List(Of ParamInputInfo)
  Params.Add(New ParamInputInfo("Param1", 0, 10, False, True))
  Params.Add(New ParamInputInfo("Param2", 0, Double.MaxValue, False, True))
 
{{APIComment|'Create a Boolean for return of "Cancel" parameter.}}
  Dim wasCanceled As Boolean
 
{{APIComment|'Prompt user to input the parameters.}}
  WDS.Events.GetDistrParameters(WDS, "Message1", True, Params, wasCanceled)
 
{{APIComment|'The new Parameter values are in their respective ParamInputInfo.Value variables.}}
  Dim NewParameter1value As Double
  Dim NewParameter2value As Double
  If Not wasCanceled Then
      NewParameter1value = Params(0).Value
      NewParameter2value = Params(1).Value
  End If

Revision as of 15:26, 6 May 2016