Adds an expected output with the given key and expectedValue to the record.
Namespace: Cognex.VisionPro.InspectionAssembly: Cognex.VisionPro.Inspection (in Cognex.VisionPro.Inspection.dll) Version: 65.1.0.0 (65.1.0.0)
Syntax
Parameters
- key
- Type: System String
The key to be added to the Record's ExpectedOutput parameters. The key has to be unique
- expectedValue
- Type: System Object
The value to be assigned with the given key
Exceptions
| Exception | Condition |
|---|---|
| Exception | Thrown if the key is not unique. |
Examples
Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection
Private Sub AddProperty()
Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
mInputDatabase.Connect()
Dim mCurrentRecord As CogVerificationData = mInputDatabase.Fetch(0)
' Add additional property to the record with the name "Area" and a value of 3.1415
mCurrentRecord.Params.ExpectedOutputs.Add("Area", 3.1415)
' Change the additional property "Area"
mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords("Area").Content = 2.7182
' Update the record in the database
mInputDatabase.Replace(mCurrentRecord)
mInputDatabase.Disconnect()
End Subusing Cognex.VisionPro; using Cognex.VisionPro.Database; using Cognex.VisionPro.Inspection; private AddProperty() { CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase")); mInputDatabase.Connect(); CogVerificationData mCurrentRecord = mInputDatabase.Fetch(0); // Add additional property to the record with the name "Area" and a value of 3.1415 mCurrentRecord.Params.ExpectedOutputs.Add("Area", 3.1415); // Change the additional property "Area" mCurrentRecord.Params.ExpectedOutputs.Record.SubRecords["Area"].Content = 2.7182; // Update the record in the database mInputDatabase.Replace(mCurrentRecord); mInputDatabase.Disconnect(); }
See Also