COM object EvCalibration

EvApplication > EvFileCollection > EvFile > EvVariablesCollection > EvVariableBase As EvVariableAcoustic > EvVariablesAcousticProperties > EvCalibration

- OR -

EvApplication > EvFileCollection > EvFile > EvVariablesCollection > EvVariableBase As EvVariableVirtual > EvVariablesAcousticProperties > EvCalibration

 

View the COM map and the COM summary.

The EvCalibration object gives you access to information about settings on the Calibration page of the Variable Properties dialog box of the acoustic or virtual variable.

EvCalibration methods and properties:

Get
GetAllSet
GetAllUsed
GetDefault
GetLocalCalName
SetLocalCal
Transducer

 

Description

Get

 

string Get(string Name, integer Ping)

Summary

Get the set value of the specified calibration setting for the specified ping. In this context, a Set means the set of calibration settings read from the data file or ECS file.

Calibration settings may or may not change with each ping in the data file. When settings don't change, the calibration for ping 0 will be representative of the calibration for all pings. If they do change, view the Calibration page of the Variable Properties dialog box, where the Used by pings section displays a ping range and the associated calibration settings.

This method accesses the calibration for one ping. Where calibration settings change, use script/programming techniques to examine all the pings in the variable.

Parameters
Return

The value of the calibration setting. An empty string means the calibration setting is not set.

Example

Annotated calibration example.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Specify these file names for your own environment
Dim strEvName: strEvName = "c:\YourEVFile.ev"
Dim strEcsName: strEcsName = "c:\COM.ecs"
Dim FSO: Set FSO = CreateObject("Scripting.FileSystemObject")
Dim Ecs: Set Ecs = FSO.OpenTextFile(strEcsName, 2, true)
Ecs.WriteLine "Version 1.0"
Ecs.WriteLine "SoundSpeed = 1490"
Ecs.WriteLine
Ecs.WriteLine "SourceCal T1"
Ecs.WriteLine "    AbsorptionCoefficient = 0.01"
Ecs.WriteLine
Ecs.WriteLine "LocalCal Local"
Ecs.WriteLine "    AbsorptionCoefficient = 0.02"
Ecs.WriteLine "    TvgRangeCorrection = None"
Ecs.Close

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Display one setting
Sub ShowSetting(EV, Var, strName)
    Dim strValue: strValue = Var.Properties.Calibration.Get(strName, 0)
    If strValue = "" Then
        EV.Log(Var.Name & " " & strName & " (default): " & Var.Properties.Calibration.GetDefault(strName))
    Else
        EV.Log(Var.Name & " " & strName & ": " & strValue)
    End If
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Display all settings set for a variable
Sub ShowSettingsSet(EV, Var)
    Dim AllSet: AllSet = Split(Var.Properties.Calibration.GetAllSet(0))
    Dim strName
    For Each strName In AllSet
       ShowSetting EV, Var, strName
    Next
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Display all settings used by a variable
Sub ShowSettingsUsed(EV, Var)
    Dim Used: Used = Split(Var.Properties.Calibration.GetAllUsed(0))
    Dim strName
    For Each strName In Used
       ShowSetting EV, Var, strName
    Next
End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Open EV and get the variable
Dim EchoviewCom: Set EchoviewCom = CreateObject("EchoviewCom.EvApplication")
Dim EvFile: Set EvFile = EchoviewCom.OpenFile(strEvName)
Dim Var1: Set Var1 = EvFile.Variables.FindByName("Sv raw pings T1")

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' What are the settings?
EchoviewCom.Log("ECS at start: '" & EvFile.Filesets(0).GetCalibrationFileName & "'")
EchoviewCom.Log("Set: ")
ShowSettingsSet EchoviewCom, Var1
EchoviewCom.Log("Used: ")
ShowSettingsUsed EchoviewCom, Var1
ShowSetting EchoviewCom, Var1, "TVGRangeCorrection"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' New ecs
EvFile.Filesets(0).SetCalibrationFile(strEcsName)
ShowSetting EchoviewCom, Var1, "SoundSpeed"
ShowSetting EchoviewCom, Var1, "AbsorptionCoefficient"
ShowSetting EchoviewCom, Var1, "TVGRangeCorrection"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Set the local cal
EchoviewCom.Log(Var1.Name & " local cal: '" & Var1.Properties.Calibration.GetLocalCalName & "'")
Var1.Properties.Calibration.SetLocalCal("Local")
EchoviewCom.Log(Var1.Name & " local cal: '" & Var1.Properties.Calibration.GetLocalCalName & "'")
ShowSetting EchoviewCom, Var1, "SoundSpeed"
ShowSetting EchoviewCom, Var1, "AbsorptionCoefficient"
ShowSetting EchoviewCom, Var1, "TVGRangeCorrection"

GetAllSet

string GetAllSet(integer Ping)

Summary

Get, for the specified ping, the names of all the calibration settings that were explicitly set by being read from either the data file or ECS file.

Parameters
  • Ping
  • The index of a ping.
Return

A string listing calibration setting names separated by spaces.

Example

Calibration example - annotated and text versions.

GetAllUsed

string GetAllUsed(integer Ping)

Summary

Get, for the specified ping, the names of all the calibration settings that have been used in a calculation. Used values may be defaults or have been explicitly set.

Parameters
  • Ping
  • The index of a ping.
Return

A string listing calibration setting names separated by spaces.

Example

Calibration example - annotated and text versions.

GetDefault

string GetDefault(string Name)

Summary

Get the default value used by the variable  for the named setting. A default value is used when a calculation requires a calibration setting that has not been read from the data file or the ECS file.

Parameters
Return

The default value as a string.

Example

Calibration example - annotated and text versions.

GetLocalCalName

string GetLocalCalName()

Summary

Get the name of the LocalCal used by a variable.

Parameters

None

Return

The LocalCal name.

Example

Calibration example - annotated and text versions.

SetLocalCal

boolean SetLocalCal( string Name)

Summary

Specify and use the LocalCal for a variable. This method requires the LocalCal name to exist.

Parameters
  • Name
  • The LocalCal name expressed as a string
Return

True, if successful.

Example

Calibration example - annotated and text versions.

Transducer

string Transducer

Summary

Specifies the Transducer for the variable, as shown on the Calibration page of the Variable Properties dialog box.

See also

Scripting with COM objects
COM object hierarchy