COM object EvPingSubset

EvApplication > EvFileCollection > EvFile > EvVariablesCollection > EvVariableBase As EvVariableVirtual >EvVariableAcousticProperties > EvPingSubset

 

View the COM map and the COM summary.

The EvPingSubset object gives you access to settings on the Ping subset page of the Variable Properties dialog box of the acoustic virtual variable.

EvPingSubset properties:

Ranges
RangeInclusive

 

Description

Ranges

(read-write) string Ranges

Summary

Access or change the value (expressed as a text string) for the setting Range(s) on the Ping subset page.

A text string can be used for ping number, time or distance values. Distance values require a decimal point and can only be specified meters.

Notes:

  • Invalid text (which can not be interpreted as a range of pings) will result in an error being logged, and no change being made to the operator.
  • Nautical miles can be converted to meters by multiplying by 1852.0000118.
  • The COM method will fail when there is a mismatch between COM EvPingSubset Ranges type and Ping subset Ranges type.
Example
Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
Dim EvFile: Set EvFile = EvApp.EvFiles(0)
If EvFile Is Nothing Then
  Msgbox "Please open or create an EV file before running this script."
  WScript.Quit
End If
Dim EvVar: Set EvVar = EvFile.Variables.FindByName("Ping Subset 1")
If EvVar Is Nothing Then
  Msgbox "EV file contains no ping subset variable."
  Wscript.Quit
End If
Msgbox "Initial Ranges are: " & EvVar.Properties.PingSubset.Ranges
EvVar.Properties.PingSubset.Ranges = "5, 7, 9-20, 25-"
Msgbox "'5, 7, 9-20, 25-' gives " & EvVar.Properties.Pingsubset.Ranges
EvVar.Properties.Pingsubset.Ranges = "0.0-100, 200-"
Msgbox "'0.0-100, 200-' gives " & EvVar.Properties.Pingsubset.Ranges
EvVar.Properties.Pingsubset.Ranges = "2012-5-1 12 = 13, 13:10 = 13:10:10.01"
Msgbox "'2012-5-1 12 = 13, 13:10 = 13:10:10.01' gives " & EvVar.Properties.Pingsubset.Ranges
EvVar.Properties.Pingsubset.Ranges = "rubbish"
Msgbox "'rubbish' gives " & EvVar.Properties.Pingsubset.Ranges & vbCrLf & "and" & vbCrLf & EvApp.GetLastLogMessage
EvVar.Properties.Pingsubset.Ranges = "-100"
Msgbox "'-100' gives " & EvVar.Properties.Pingsubset.Ranges & vbCrLf & "and" & vbCrLf & EvApp.GetLastLogMessage
EvVar.Properties.Pingsubset.Ranges = ""
Msgbox "'' gives " & EvVar.Properties.Pingsubset.Ranges & vbCrLf & "and" & vbCrLf & EvApp.GetLastLogMessage
 Examples of ranges

"1870"

Ping number

"1870-"

Ping number range

"0.0-"

Distance range

"2012="

Time range

"1972-2-29="

Time range, leap year.

RangeInclusive

boolean RangeInclusive

Summary

Access or change the setting for Ping Inclusion on the Ping subset page. The default is True and this specifies Include the ping ranges. False specifies Exclude the ping ranges.

Example
Dim VarB: Set VarB = EvFile.Variables.FindByName("Ping subset 1")
   If VarB Is Nothing Then
       MsgBox "Failed to find ping subset variable"
   Else
       Dim VarPingSubset: Set VarPingSubset = VarB.AsVariableVirtual
       If VarPingSubset Is Nothing Then
           MsgBox "Variable is not virtual - ping subset"
       Else
           VarPingSubset.Properties.PingSubset.Ranges = "0-5, 10-15"
           MsgBox "Ping subset range changed"
           VarPingSubset.Properties.PingSubset.RangeInclusive = False
           MsgBox "Ping subset range inclusive changed to false"
       End If
   End If

See also

Scripting with COM objects
COM object hierarchy