Ovis_Decoration_Info_Template_Create()
摘要
创建模板,该模板决定在创建组实例时哪些元素将填充 Ovis 组。
语法
Ovis_Decoration_Info_Template_Create (name)
| 参数 | 类型 | 说明 |
|---|---|---|
name |
const char * |
模板名称 |
返回类型
OvisT_Info_Template *
Ovis 模板
头文件
ovis_decoration.h
详情
此函数创建模板,该模板决定在通过 Ovis_Decoration_Info_Group_Create() 创建组实例时哪些元素将填充 Ovis 组。要向模板添加属性,使用 Ovis_Decoration_Info_Template_Graph_Element_Add()、Ovis_Decoration_Info_Template_Range_Element_Add() 或 Ovis_Decoration_Info_Template_Scalar_Element_Add()。
示例
#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);
错误
- 未提供模板名称。
参考
- 使用函数
Ovis_Decoration_Info_Template_Scalar_Element_Add()、Ovis_Decoration_Info_Template_Range_Element_Add()和Ovis_Decoration_Info_Template_Graph_Element_Add()设置模板的各个分量。 - 使用函数
Ovis_Decoration_Info_Group_Create()基于模板生成信息组。 - 使用函数
Ovis_Decoration_Info_Group_Scalar_Element_Value_Set()和Ovis_Decoration_Info_Group_Vector_Element_Value_Set()更新信息组中的数据。