CogVerificationParamsExpectedOutputsContainer Grade Property Cognex VisionPro 9.5
Returns the value container object for the Grade collection.

Namespace: Cognex.VisionPro.Inspection
Assembly: Cognex.VisionPro.Inspection (in Cognex.VisionPro.Inspection.dll) Version: 69.0.0.0 (69.0.0.0)
Syntax

public CogVerificationValueContainer<string> Grade { get; }

Property Value

Type: CogVerificationValueContainer String 
Examples

Imports Cognex.VisionPro
Imports Cognex.VisionPro.Database
Imports Cognex.VisionPro.Inspection

Private Sub SetGrade()
        Dim mInputDatabase As New CogVerificationDatabase(New CogDatabaseDirectory("C:\SampleDatabase"))
        mInputDatabase.Connect()

        Dim mCurrentRecord As CogVerificationData = mInputDatabase.Fetch(0)

        ' The grade which will be added
        Dim grade As String = "Good"

        ' Step one: add this grade to the metadata
        ' WARNING: If the metadata already contains this grade an exception will be thrown.
        mInputDatabase.AddGrade(grade)

        ' Step two: set the record's grade
        mCurrentRecord.Params.ExpectedOutputs.Grade.Value = grade

        ' Update the record in the database
        mInputDatabase.Replace(mCurrentRecord)

        mInputDatabase.Disconnect()
End Sub
using Cognex.VisionPro;
using Cognex.VisionPro.Database;
using Cognex.VisionPro.Inspection;

private SetGrade()
{
    CogVerificationDatabase mInputDatabase = new CogVerificationDatabase(new CogDatabaseDirectory(@"C:\SampleDatabase"));
    mInputDatabase.Connect();

    CogVerificationData mCurrentRecord = mInputDatabase.Fetch(0);

    // The grade which will be added 
    string grade = "Good";

    // Step one: add this grade to the metadata 
    // WARNING: If the metadata already contains this grade an exception will be thrown.
    mInputDatabase.AddGrade(grade);

    // Step two: set the record's grade
    mCurrentRecord.Params.ExpectedOutputs.Grade.Value = grade;

    // Update the record in the database
    mInputDatabase.Replace(mCurrentRecord);

    mInputDatabase.Disconnect();
}
See Also