/usr/share/sitplus/sp/switch_viacam.sp is in sitplus-data 1.0.3-4build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #
# switch viacam
#
# Input pins
# image (iplimage)
#
# Output pins
# motion (float)
#
type switch_viacam
name "Switch Viacam"
# Camera source.
create camera_grabber grabber
# Camera panel
create camera_viewer viewer
connect grabber image viewer image
# Virtual switch logic
import lib/virtual_switch.sps
create virtual_switch vs1 -x 0.15 -y 0.2 -c 16711680
connect vs1 roi viewer roi
connect viewer roi vs1 roi
connect grabber image vs1 image
create virtual_switch vs2 -x 0.85 -y 0.2 -c 19711680
connect vs2 roi viewer roi
connect viewer roi vs2 roi
connect grabber image vs2 image
#
# Mouse output
#
create print p
connect vs1 action_fired p in
connect vs2 action_fired p in
create mouse_output mouse
connect vs1 action_fired mouse right_click
connect vs2 action_fired mouse left_click
#
# Click sound
#
create wav_player player -p \"$SP_DATA_DIR$/audio/click.wav\"
connect vs1 action_fired player play
connect vs2 action_fired player play
begin_gui_layout
layout_begin hbox
component viewer
layout_begin vbox "Right click"
component vs1
layout_end
layout_begin vbox "Left click"
component vs2
layout_end
layout_end
end_gui_layout
|