ALTADataSet.ShowCalculationProgress: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:APIClass|ALTAEvents Class|ALTAEvents}}
{{Template:API}}{{Template:APIBreadcrumb|.[[ALTADataSet Class|ALTADataSet]]}}
{{Template:WeibullEvents.ShowCalculationProgress.Cmt}}
 
 
<onlyinclude>Occurs when the calculation process is running. Displays a progress bar.</onlyinclude>
 
 
{{Template:API_EventsNote}}


== Syntax ==
== Syntax ==
<ul><li>
'''_ShowCalculationProgress'''()
ShowCalculationProgress(
{{APIName|sender}}
{{APIPrefix|As}}
{{APIName|[[ALTADataSet Class|ALTADataSet]]}})
</li></ul>


Parameters
:''sender'': An [[ALTADataSet Class|ALTADataSet]] object.


== Usage Example ==
== Example ==
The following example provides a simple demonstration on how to customize the event procedure.
'''VBA'''
{{APIComment|'Specify a variable to handle the event.}}
  {{APIPrefix|Private WithEvents}} ads {{APIPrefix|As}} ALTADataSet
{{APIComment|'----------------------------}}
  {{APIPrefix|Sub}} Main()
  {{APIComment|'Associate the event variable with an object.}}
    {{APIPrefix|Set}} ads = {{APIPrefix|New}} ALTADataSet
  {{APIComment|'Set the application to use your event procedure.}}
    ads.UseEvents = True
  {{APIComment|'Define a stress type with a use stress level of 300.}}
    {{APIPrefix|Call}} ads.AddStressDefinition({{APIString|"Stress1"}}, , 300) 
  {{APIComment|'To trigger the event, analyze a data set.}}
    {{APIPrefix|Call}} ads.AddFailure_2(245, 1, 353)
    {{APIPrefix|Call}} ads.AddFailure_2(110, 1, 373)
    {{APIPrefix|Call}} ads.AddFailure_2(180, 1, 373) 
    {{APIPrefix|Call}} ads.AddFailure_2(50, 1, 393)
    {{APIPrefix|Call}} ads.AddFailure_2(70, 1, 393)
    ads.Calculate
    Msgbox({{APIString|"End"}})
  {{APIPrefix|End Sub}}
{{APIComment|'----------------------------}}
  {{APIPrefix|Private Sub}} ads_ShowCalculationProgress()
  {{APIComment|'<Add code here to handle the event.>}}
    MsgBox ("ShowCalculationProgress event")
  {{APIPrefix|End Sub}}


  {{APIComment|'Overrides requested. Create a new class, inherit WeibullEvents,}}
'''VB.NET'''
  {{APIComment|'and set the dataset's events.}}
  Private Class myEvents
  {{APIComment|'Specify a variable to handle the event.}}
      Inherits WeibullEvents
  {{APIPrefix|Private WithEvents}} ads {{APIPrefix|As}} ALTADataSet
      Public Overrides Sub ShowCalculationProgress(sender As ALTADataSet)
   
          MyBase.ShowCalculationProgress(sender)
{{APIComment|'----------------------------}}
          {{APIComment|'<Additional overridden code here.>}}
  {{APIPrefix|Sub}} Main()
      End Sub
  {{APIComment|'Associate the event variable with an object.}}
   End Class
    ads = {{APIPrefix|New}} ALTADataSet
 
  {{APIComment|'Set the new Events class.}}
  {{APIComment|'Set the application to use your event procedure.}}
   ADS.Events = New myEvents
    ads.UseEvents = True
 
{{APIComment|'Show calculation progress.}}
  {{APIComment|'Define a stress type with a use stress level of 300.}}
  ADS.Events.ShowCalculationProgress(ADS)
    ads.AddStressDefinition({{APIString|"Stress1"}}, , 300)
  {{APIComment|'To trigger the event, analyze a data set.}}
    ads.AddFailure(245, 1, 353)
    ads.AddFailure(110, 1, 373)
    ads.AddFailure(180, 1, 373) 
    ads.AddFailure(50, 1, 393)
    ads.AddFailure(70, 1, 393)
    ads.Calculate
    Msgbox({{APIString|"End"}})
   {{APIPrefix|End Sub}}
  {{APIComment|'----------------------------}}
   {{APIPrefix|Private Sub}} ads_ShowCalculationProgress() {{APIPrefix|Handles}} ads.ShowCalculationProgress
  {{APIComment|'<Add code here to handle the event.>}}
    MsgBox ("ShowCalculationProgress event")
  {{APIPrefix|End Sub}}

Latest revision as of 23:43, 6 September 2016

APIWiki.png


Member of: SynthesisAPI.ALTADataSet


Occurs when the calculation process is running. Displays a progress bar.


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

_ShowCalculationProgress()


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 ads As ALTADataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    Set ads = New ALTADataSet

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

   'Define a stress type with a use stress level of 300. 
    Call ads.AddStressDefinition("Stress1", , 300)  

   'To trigger the event, analyze a data set. 
    Call ads.AddFailure_2(245, 1, 353)
    Call ads.AddFailure_2(110, 1, 373)
    Call ads.AddFailure_2(180, 1, 373)  
    Call ads.AddFailure_2(50, 1, 393)
    Call ads.AddFailure_2(70, 1, 393)

    ads.Calculate
    Msgbox("End")

 End Sub

 '---------------------------- 
 Private Sub ads_ShowCalculationProgress()
   '<Add code here to handle the event.> 
    MsgBox ("ShowCalculationProgress event")
 End Sub
VB.NET

 'Specify a variable to handle the event. 
  Private WithEvents ads As ALTADataSet

 '---------------------------- 
 Sub Main()
   'Associate the event variable with an object. 
    ads = New ALTADataSet

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

   'Define a stress type with a use stress level of 300. 
    ads.AddStressDefinition("Stress1", , 300)  

   'To trigger the event, analyze a data set. 
    ads.AddFailure(245, 1, 353)
    ads.AddFailure(110, 1, 373)
    ads.AddFailure(180, 1, 373)  
    ads.AddFailure(50, 1, 393)
    ads.AddFailure(70, 1, 393)

    ads.Calculate
    Msgbox("End")

 End Sub

 '---------------------------- 
 Private Sub ads_ShowCalculationProgress() Handles ads.ShowCalculationProgress
   '<Add code here to handle the event.> 
    MsgBox ("ShowCalculationProgress event")
 End Sub