WeibullDataSet.GetDistrParameters: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(37 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Template:AWEAPIClass}}
{{Template:API}}{{Template:APIBreadcrumb|.[[WeibullDataSet Class|WeibullDataSet]]}}


Displays a prompt for customized parameters.


== Weibull Declaration  ==
<onlyinclude>Occurs when there is insufficient data to fit a model. Displays a prompt for entering the parameters of the distribution.</onlyinclude>


{{APIPrefix|Public Overridable Sub}}
{{APIName|GetDistrParameters(}}
{{APIPrefix|ByVal}}
{{APIName|sender}}
{{APIPrefix|As}}
{{APIName|[[WeibullDataSet Class|WeibullDataSet]],}}
{{APIPrefix|ByVal}}
{{APIName|sMsg}}
{{APIPrefix|As String}}
{{APIName|,}}
{{APIPrefix|ByVal}}
{{APIName|GetOnlyOneParameter}}
{{APIPrefix|As Boolean}}
{{APIName|,}}
{{APIPrefix|ByVal}}
{{APIName|Params}}
{{APIPrefix|As}}
{{APIName|List(}}
{{APIPrefix|Of}}
{{APIName|ParamInputInfo),}}
{{APIPrefix|ByRef}}
{{APIName|Cancel}}
{{APIPrefix|As Boolean}}
{{APIName|)}}


{{APIComment|Called by ‘sender’ when additional input is required.}}
{{Template:API_EventsNote}}


== Parameters ==
== Syntax ==
'''sender'''
'''_GetDistrParameters'''(''sMsg'', ''InputInfo'', {{APIPrefix|ByRef}} ''Cancel'')
An WeibullDataSet object


'''sMsg'''
===Parameters===
The main display label.
''sMsg''
: Required. String. The message to display.
''InputInfo''
: Required. An array of [[DistrParametersInput Class|DistrParametersInput()]] type objects that represent the model's parameters.
''Cancel''
: Required. Boolean. Indicates whether the input was cancelled. Default value = False.


'''GetOnlyOneParameter'''
Prompt for only one parameter


'''Params'''
== Example ==
A list of Parameter input information classes, ParamInputInfo, that would be updated by this prompt.
The following example provides a simple demonstration on how to customize the event procedure.
          '''ParamInputInfo Class
'''VBA'''
              Public Name As String
 
              Public Min As Double
{{APIComment|'Specify a variable to handle the event.}}
              Public Max As Double
  {{APIPrefix|Private WithEvents}} wds {{APIPrefix|As}} WeibullDataSet
              Public CanEqualMin As Boolean
              Public CanEqualMax As Boolean
{{APIComment|'----------------------------}}
              Public Value As Double
  {{APIPrefix|Private Sub}} Main()
          '''ParamInputInfo Declaration
  {{APIComment|'Associate the event variable with an object.}}
              New(ByVal Name As String, ByVal Min As Double, ByVal Max As Double, ByVal CanEqualMin As Boolean, ByVal CanEqualMax As Boolean)
    {{APIPrefix|Set}} wds = {{APIPrefix|New}} WeibullDataSet
          '''ParamInputInfo Usage
              {{APIComment|After processing with [[GetDistrParameters]], the '''Value''' of each parameter will be updated.}}
  {{APIComment|'Set the application to use your event procedure.}}
'''Cancel'''
    wds.UseEvents = True
If the prompt was closed by any means other than clicking the "Okay", this value would be set to True.
  {{APIComment|'To trigger the event, call the Calculate method without defining a data set. }}
    wds.Calculate
    Msgbox({{APIString|"End"}})
  {{APIPrefix|End Sub}}
{{APIComment|'----------------------------}}
  {{APIPrefix|Private Sub}} wds_GetDistrParameters({{APIPrefix|ByVal}} sMsg {{APIPrefix|As String}}, _
                                    {{APIPrefix|ByVal}} InputInfo {{APIPrefix|As SynthesisAPI.DistrParametersInput}}, _
                                    Cancel {{APIPrefix|As Boolean}})
  {{APIComment|'<Add code here to handle the event.>}}
    MsgBox (sMsg)
  {{APIPrefix|End Sub}}


== Usage Example ==
'''VB.NET'''
 
{{APIComment|Declare the WeibullEvents.}}<br>
{{APIComment|'Specify a variable to handle the event.}}
{{APIComment|Declare the WeibullDataSet.}}<br>
  {{APIPrefix|Private WithEvents}} wds {{APIPrefix|As}} WeibullDataSet
{{APIComment|Note: The WeibullDataSet constructor already creates a new WeibullEvents, which could be used in place of WEvents in the example below.}}
        Dim WEvents As New WeibullEvents
{{APIComment|'----------------------------}}
        Dim WDS As New WeibullDataSet  
  {{APIPrefix|Private Sub}} Main()
 
  {{APIComment|'Associate the event variable with an object.}}
{{APIComment|Creates a new list of ParamInputInfoPopulate the list.}}
    wds = {{APIPrefix|New}} WeibullDataSet
        Dim Params As New List(Of ParamInputInfo)
        Params.Add(New ParamInputInfo("Param1", 0, 10, False, True))
  {{APIComment|'Set the application to use your event procedure.}}
        Params.Add(New ParamInputInfo("Param2", 0, Double.MaxValue, False, True))
    wds.UseEvents = True
 
   
{{APIComment|Prompt user to input the parameters.}}
  {{APIComment|'To trigger the event, call the Calculate method without defining a data set. }}
        WEvents.GetDistrParameters(WDS, "Message1", True, Params, True)
    wds.Calculate
 
    Msgbox({{APIString|"End"}})
{{APIComment|The new Parameter values are in their respective ParamInputInfo.Value variables.}}
  {{APIPrefix|End Sub}}
        Dim NewParameter1value As Double = Params(0).Value
        Dim NewParameter2value As Double = Params(1).Value
{{APIComment|'----------------------------}}
  {{APIPrefix|Private Sub}} wds_GetDistrParameters(sMsg {{APIPrefix|As String}}, _
                                    InputInfo {{APIPrefix|As DistrParametersInput}}, _
                                    {{APIPrefix|ByRef}} Cancel {{APIPrefix|As Boolean}}) {{APIPrefix|Handles}} wds.GetDistrParameters
    {{APIComment|'<Add code here to handle the event.>}}
    MsgBox (sMsg)
  {{APIPrefix|End Sub}}

Latest revision as of 23:40, 6 September 2016

APIWiki.png


Member of: SynthesisAPI.WeibullDataSet


Occurs when there is insufficient data to fit a model. Displays a prompt for entering the parameters of the distribution.


Remarks: To hide the messages or write your own code for the event procedure, set the UseEvents property of the object to True. The event is raised by the class methods.

Syntax

_GetDistrParameters(sMsg, InputInfo, ByRef Cancel)

Parameters

sMsg

Required. String. The message to display.

InputInfo

Required. An array of DistrParametersInput() type objects that represent the model's parameters.

Cancel

Required. Boolean. Indicates whether the input was cancelled. Default value = False.


Example

The following example provides a simple demonstration on how to customize the event procedure.

VBA
 
 'Specify a variable to handle the event. 
  Private WithEvents wds As WeibullDataSet

 '----------------------------  
 Private Sub Main()
   'Associate the event variable with an object. 
    Set wds = New WeibullDataSet

   'Set the application to use your event procedure. 
    wds.UseEvents = True

   'To trigger the event, call the Calculate method without defining a data set.  
    wds.Calculate
    Msgbox("End")
 End Sub

 '---------------------------- 
 Private Sub wds_GetDistrParameters(ByVal sMsg As String, _
                                    ByVal InputInfo As SynthesisAPI.DistrParametersInput, _
                                    Cancel As Boolean)
   '<Add code here to handle the event.> 
    MsgBox (sMsg)
 End Sub
VB.NET

 'Specify a variable to handle the event. 
  Private WithEvents wds As WeibullDataSet

 '---------------------------- 
 Private Sub Main()
   'Associate the event variable with an object. 
    wds = New WeibullDataSet

   'Set the application to use your event procedure. 
    wds.UseEvents = True

   'To trigger the event, call the Calculate method without defining a data set.  
    wds.Calculate
    Msgbox("End")
 End Sub

 '---------------------------- 
 Private Sub wds_GetDistrParameters(sMsg As String, _
                                    InputInfo As DistrParametersInput, _
                                    ByRef Cancel As Boolean) Handles wds.GetDistrParameters
    '<Add code here to handle the event.> 
    MsgBox (sMsg)
 End Sub