General API
Be aware of the following changes in API when upgrading from VisionPro 9.7:
- The API namespace has changed from Cognex::VisionPro to Cognex::Vision
- The prefixes Cog and Cog3D have been removed from all classes and enumerations.
- The following classes supported in previous releases have been removed:
CogToolGroup
CogUserTool
CogJob and CogJobManager
Cognex recommends you use the ToolBock class for similar functionality
-
The ICogHasChanged interface has been removed:
-
The interface supported the HasChanged property to indicate if the object has changed since this property was last set to false. This property is set to true when a changed event fires, and set to false on construction and when the object is persisted.
In this VisionPro release your application must track this manually.
-
- The IRunStatus class removes the Exception property previous supported by the ICogRunStatus interface.
-
Collection interfaces are now defined in the Cognex.Interop namespace
Your application must include the Cognex.Interop namespace when using Collection base interfaces
-
The GraphicChildren class implements IReadOnlyDictionary where it used to implement IDictionary
Your application must use the Insert or Add methods to add new items with a Key value.
-
Handler methods must use the generic eventArg type:
- The Collection prefix has been removed
- The EventArg uses a generic value type
For example a GraphicCollection Insert handler:
(earlier versions):
void HandleEvent (object sender, CogCollectionInsertEventArgs args)(this version):
void HandleEvent(object sender, InsertItemEventArgs<IGraphicParentChild> args) - This release uses a UInt32.MaxValue instead of the value -1 to represent all flags of an enumeration.
- You cannot initialize an array of function parameters or return types
- Instead of arrays of type Byte[] use arrays of type UInt32 Collection
- Instead of arrays of type double[] use arrays of type Vect2Collection
- System.ICloneable no longer supported
Only CoordinateSpaceTree supports a Clone() method
Otherwise you must use Serializer.DeepCopyObject() to perform the copy.
- GetBinary() and SetBinary() methods are removed.
Exceptions
-
Previous VisionPro releases supported two types of invalid range exceptions:
- ArgumentException
-
ArgumentOutOfRangeException
VisionPro 10.0 removes support for ArgumentException but retains support for ArgumentOutofRangeException
- Instead of creating a specific exception for every error, this VisionPro release may use standard exceptions and the message text to explain the error
-
In previous VisionPro releases the CogCaliper.Execute method could generate the exception ImageBadSelectedSpaceNameException.
In this release the Caliper.Execute method can generate any of the following exceptions:
- SpaceTreeNameNotInTreeException
- SpaceTreeInvalidNameSyntaxException
- SpaceTreeNameNotUniqueException
- ArgumentException
- Any vision applications that catch exceptions from VisionPro of type System.ArgumentException or System.ArgumentOutOfRangeException must be updated to use ArgumentException
Record Collections
- The CogRecords class has been renamed RecordCollection
- This release replaces the ICogRecords interface with ICollection<Record>
Your application can use the ICollection<Record> interface or the RecordCollection class
- This release replaces the nested CogRecord.DisplayMethod class with a non-nested RecordDisplayMethod class.
- The old CogRecords class allowed multiple entries with the same string key. The new RecordCollection class requires keys to be unique.