Ovis_Decoration_Info_Template_Scalar_Element_Add()
摘要
向 Ovis 模板添加标量元素。
语法
Ovis_Decoration_Info_Template_Scalar_Element_Add (tmpl_ptr, element_name)
| 参数 | 类型 | 说明 |
|---|---|---|
tmpl_ptr |
OvisT_Info_Template * |
模板 |
element_name |
const char * |
元素名称 |
返回类型
OvisT_Compcode
若成功添加标量元素则返回 OvisC_Compcode_Success,否则返回 OvisC_Compcode_Failure。
头文件
ovis_decoration.h
详情
该函数向 Ovis 模板添加标量元素。
示例
#define INCOMING_PACKET_FIELD "Incoming"
OvisT_Info_Template * template;
OvisT_Info_Group * info;
OvisT_3D_Position pos;
template = Ovis_Decoration_Info_Template_Create ("Packet count");
Ovis_Decoration_Info_Template_Scalar_Element_Add (template, INCOMING_PACKET_FIELD);
Ovis_Position_Geodetic_Set (&pos, 0, 0, 100);
info = Ovis_Decoration_Info_Group_Create (template, pos,
prg_color_from_string ("blue"), OPC_NIL, OPC_NIL, OPC_NIL);
Ovis_Decoration_Info_Group_Scalar_Element_Value_Set (info, INCOMING_PACKET_FIELD,
10);
错误
- 模板为 NIL。
- 未提供元素名称。
- 元素
<name>已包含在该模板中。
参考
- 使用 Ovis_Decoration_Info_Group_Scalar_Element_Value_Set() 函数为该模板的实例中此元素设置值。