为实现弹出窗口,我们为开始屏幕添加一个屏幕窗口。此时,暂不需要设置属性:
i gave it a visibility animation based on an internal tag (“bshowpopup”). i also gave it direct movement animations based on internal tags (“x_position” and “y_position”).
我给它一个基于内部标签可见性动画(“bshowpopup”)。我也把它直接运动动画基于内部标签(“x_position”和“y_position”)。
i put the actuators in screen windows to take advantage of the tag prefix. the tag prefix is used for the popup and allows for quicker assignment of all of the animations and events associated with the actuator in the screen window.
先制作好执行器的画面,然后把它放置在hmi屏幕窗口中。我把执行器放在屏幕窗口,利用标签前缀。标签前缀用于弹出,可以更快地分配所有的动画和在屏幕窗口执行相关事件。
编写如下的一段c语言脚本,将窗口的属性传递给弹出窗口。
#include "globaldefinitions.h"
void
onclick(
char
* screenname,
char
* objectname,
char
* propertyname)
{
// set the popup screen window to use the right popup
activatescreeninscreenwindow (
"main"
,
"popup_screen"
,
"motor_popup"
);
// sets tag prefix of popup to same value as the screen window that contains this screen
setpropertybyconstant(
"main"
,
"popup_screen"
,
"tagprefix"
,
getpropchar(getparentscreen(screenname), getparentscreenwindow(screenname),
"tagprefix"
));
//this sets x_postition/y_postion internal tags to move popup screenwindow
settagbyproperty (
"@notp::x_position"
, getparentscreen(screenname),
getparentscreenwindow(screenname),
"left"
, hmiwithoutoperatorevent);
settagbyproperty (
"@notp::y_position"
, getparentscreen(screenname),
getparentscreenwindow(screenname),
"top"
, hmiwithoutoperatorevent);
//unide the popup
setbit (
"@notp::bshowpopup"
);
}
第一个语句取决于正在使用的画面。本句的意思是,弹出窗口已经更新为电机弹出窗口。
the second statement of the script sets the tag prefix of the popup window to use the same tag prefix as the screen window. the function “settagbyproperty” is setting “x_position” without an operator event, with the property “top” (the top edge of the screen window), from the parent screen window in the parent screen.
这个脚本的第二句套弹出式窗口的标记前缀使用相同的标记前缀为纱窗。功能settagbyproperty”设置“x_position”没有运营商的事件,与物业的“顶”(屏幕窗口的顶部边缘),在父母的屏幕窗口的屏幕。
最后一句设置位变量“bshowpopup”,将弹出式窗口可见性设置为真。
如果你使用的是wincc专业版,使用客户机/服务器配置的话,请注意:
确保“bshowpopup”、“x_postion”、和“y_position”这些属性仅在本地触摸屏更新。如果您使用的是客户机/服务器选项,则动画将在所有的触摸屏上起作用,而不仅仅是你在用的那台触摸屏。