Double push
deps
Posts: 27
I'm writing UI module for touch panels with one page, which controls devices depending on selected room. Button event of panel calls button event of virtual device with channel, corresponding to selected room. I have troubles with feedback, and I think they are caused by one thing: i see in notifications that PUSH event of virtual button called twice:
Line 1 (18:29:14):: Input Status:Pushed [10203:1:1] - Channel 431
Line 2 (18:29:14):: Input Status:Pushed [33104:1:1] - Channel 721
Line 3 (18:29:14):: Input Status:Pushed [33104:1:1] - Channel 721
Line 4 (18:29:14):: Input Status:Released [10203:1:1] - Channel 431
Line 5 (18:29:14):: Input Status:Released [33104:1:1] - Channel 721
Line 6 (18:29:14):: Input Status:Released [33104:1:1] - Channel 721
Piece of code that processes events:
//
SHADES
BUTTON_EVENT[TP, UI_SHADES_BUT]
{ PUSH:
{
LOCAL_VAR INTEGER NUM
NUM=GET_LAST(UI_SHADES_BUT)
DO_PUSH_TIMED(VDV_UI_4, SHADE_AR[SHADEOFROOM[NROOM]][NUM], 1)
}
}
//
FEEDBACK
CHANNEL_EVENT[vdv_ui_4, SHADE_AR[SHADEOFROOM[NROOM]]]
{
ON:
{
LOCAL_VAR INTEGER cBUT
cBUT=GET_LAST(SHADE_AR[SHADEOFROOM[NROOM]])
ON[TP, UI_SHADES_BUT[cBUT]]
}
OFF:
{
LOCAL_VAR INTEGER cBUT
cBUT=GET_LAST(SHADE_AR[SHADEOFROOM[NROOM]])
OFF[TP, UI_SHADES_BUT[cBUT]]
}
}
After room selecting doing Rebuild_event().
Why Push event generates twice?
Line 1 (18:29:14):: Input Status:Pushed [10203:1:1] - Channel 431
Line 2 (18:29:14):: Input Status:Pushed [33104:1:1] - Channel 721
Line 3 (18:29:14):: Input Status:Pushed [33104:1:1] - Channel 721
Line 4 (18:29:14):: Input Status:Released [10203:1:1] - Channel 431
Line 5 (18:29:14):: Input Status:Released [33104:1:1] - Channel 721
Line 6 (18:29:14):: Input Status:Released [33104:1:1] - Channel 721
Piece of code that processes events:
//
SHADES
BUTTON_EVENT[TP, UI_SHADES_BUT]
{ PUSH:
{
LOCAL_VAR INTEGER NUM
NUM=GET_LAST(UI_SHADES_BUT)
DO_PUSH_TIMED(VDV_UI_4, SHADE_AR[SHADEOFROOM[NROOM]][NUM], 1)
}
}
//
FEEDBACK
CHANNEL_EVENT[vdv_ui_4, SHADE_AR[SHADEOFROOM[NROOM]]]
{
ON:
{
LOCAL_VAR INTEGER cBUT
cBUT=GET_LAST(SHADE_AR[SHADEOFROOM[NROOM]])
ON[TP, UI_SHADES_BUT[cBUT]]
}
OFF:
{
LOCAL_VAR INTEGER cBUT
cBUT=GET_LAST(SHADE_AR[SHADEOFROOM[NROOM]])
OFF[TP, UI_SHADES_BUT[cBUT]]
}
}
After room selecting doing Rebuild_event().
Why Push event generates twice?
0
Comments
The good news is that it doesn't cause 2 button events; I added a SEND_STRING 0 to the button event and only one line appears in Diagnostics.
Maybe it is a bug in Notifications.
CHANNEL_EVENT[vdv_ui_4, SHADE_AR[SHADEOFROOM[NROOM]]]
{
ON:
{
LOCAL_VAR INTEGER cBUT
cBUT=GET_LAST(SHADE_AR[SHADEOFROOM[NROOM]])
WAIT 1
IF([VDV_UI_4, SHADE_AR[SHADEOFROOM[NROOM]][cBUT])
ON[TP, UI_SHADES_BUT[cBUT]]
}
OFF:
{
LOCAL_VAR INTEGER cBUT
cBUT=GET_LAST(SHADE_AR[SHADEOFROOM[NROOM]])
WAIT 1
IF(![VDV_UI_4, SHADE_AR[SHADEOFROOM[NROOM]][cBUT])
OFF[TP, UI_SHADES_BUT[cBUT]]
}
}