编码描述#

codedesc 类保存 AI 视觉传感器颜色代码。除非已创建两个 colordesc 对象,否则无法创建 codedesc 对象。最多可同时存储五个颜色代码,每个颜色代码最多可包含五个颜色签名。

使用以下构造函数创建颜色代码:

The codedesc(index, c1, c2, c3, c4, c5) constructor creates a codedesc object with at least 2 but up to 5 colordesc objects.

范围

描述

index

The codedesc object’s index, from 1 - 5. Note: Creating two codedesc objects with the same index number will cause the second created object to override the first.

c1

颜色代码中第一个 colordesc 对象的名称。

c2

颜色代码中第二个 colordesc 对象的名称。

c3

可选。 颜色代码中第三个 colordesc 对象的名称。

c4

可选。 颜色代码中第四个 colordesc 对象的名称。

c5

可选。 颜色代码中第五个 colordesc 对象的名称。

// Create a new Color Signature "Red" with the Colordesc class.
aivision::colordesc Red = aivision::colordesc(1, 207, 19, 25, 10.00, 0.20);
// Create a new Color Signature "Purple" with the Colordesc class.
aivision::colordesc Purple = aivision::colordesc(2, 98, 18, 227, 10.00, 0.20);
// Create a new Color Code "redPurple" with the Codedesc class.
aivision::codedesc redPurple = aivision::codedesc(1, Red, Purple);

By default, the ALL_CODES tag will return all codedesc objects with the AI Vision Sensor.