在omnet++中,在拓扑图的显示中,有时候我们需要显示不同的图片,这里有可以调用它的一个显示函数:
displayString().setTagArg("i",0,"node2");(“node2”是你小显示的图片的名字,格式是gif的)
这个函数的原型是:
/**
* Sets an argument for the given tag. The value may be NULL pointer.
* If index points beyond the last argument, the list of arguments will
* be extended by inserting intervening empty arguments if necessary.
*
* The result is true if the operation was successful. False is returned
* if the given tag doesn't exist, or index is invalid (negative or
* greater than the maximum numer of arguments, currently 16).
*/
bool setTagArg(const char *tagname, int index, const char *value)
bool cDisplayString::setTagArg(const char *tagname, int index, const char *value)
{
// may notify() twice (for insert.. and set..), but it's OK
int t = gettagindex(tagname);
if (t==-1)
t = insertTag(tagname);
return setTagArg(t, index, value);
}
存在于cdispstr.h文件中。可以详细用法可以参考omnet++的使用手册第9章
omnet图中选择显示不同的图片
最新推荐文章于 2023-07-20 11:28:47 发布