COM object EvCalibration

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

View the Echoview COM object hierarchyand the Echoview summary of COM objects.

The EvCalibration object gives you access to information about settings on the Calibration page of the Variable Properties dialog box of the acoustic variable via EvFileset.SetCalibrationFile and EvVariableAcousticProperties.Calibration.

The following EvCalibration methods and properties are detailed below:

Methods Properties: Collections, Classes and Members
Get
GetAllSet
GetAllUsed
GetDefault
GetLocalCalName
SetLocalCal
Transducer

EvCalibration implements the following methods:

EvCalibration methods

Description

Get

 

string Get(string Name, integer Ping)

Summary

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

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

The Get method accesses one ping at a time. To determine the pings where calibration settings change, use script/programming techiques to examine all the pings in the variable.

Parameters
Returrn

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 all the calibration settings values, for the specified ping, that are read from the data file or ECS file. Such settings are deemed as Set and are distinct from default values.

Parameters
  • Ping
  • A ping in a variable from a fileset in an EV file.
Return

The (string) array of all calibration values set for the ping in a variable.

Example

Calibration example - annotated and text versions.

GetAllUsed

string GetAllUsed(integer Ping)

Summary

Get all the calibration values, for a specified ping, that have been used in a calculation. Used values can be settings that are set and/or default values.

Parameters
  • Ping
  • A ping in a variable from a fileset in an EV file
Return

The (string) array of all calibration values used for the ping in a variable.

Example

Calibration example - annotated and text versions.

GetDefault

string GetDefault(stirng Name)

Summary

Get a default calibration value used by a varaible. A default value is used when a calculation requires a calibration setting but it can't be read from the data file or the ECS file.

Parameters
Return

The value of the default calibration setting.

Example

Calibration example - annotated and text versions.

GetLocalCalName

string GetLocalCalName()

Summary

Get the name of the LocalCal used by a variable. To specify the use of LocalCal calibration settings, the LocalCal name must be selected (manually or by SetLocalCal) on the Calibration page of the Variable Properties dialog box.

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

If successful.

Example

Calibration example - annotated and text versions.

EvCalibration implements the following properties:

EvCalibration properties

Description

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