Double push
deps
Junior Member
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?
Comments
-
I just threw some code into a controller and DO_PUSH definitely causes 2 Input Status:Pushed notifications and I don't know why.
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. -
Probably one is the command going out from DO_PUSH, and the other is the actual event. Just an inconsistency in how the firmware reports it to notifications.
-
Trouble with feedback was in another unknown thing, just added one IF condition:
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]]
}
}
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums