better osc message cmds
This commit is contained in:
parent
1c6b7157e8
commit
099cb06741
|
@ -113,20 +113,17 @@ class OSC2CamServer(SimpleOSCServer):
|
||||||
|
|
||||||
def dispatchMessage(self, osc_address, typetags, args, packet, client_address):
|
def dispatchMessage(self, osc_address, typetags, args, packet, client_address):
|
||||||
""" dispatches parsed osc messages to the ip cam command methods"""
|
""" dispatches parsed osc messages to the ip cam command methods"""
|
||||||
rule = re.compile("^/(.*?)/(\d+)/(.*?)$")
|
|
||||||
res = rule.match(osc_address)
|
cam_id = args.pop(0)
|
||||||
if res:
|
if osc_address == "/moveCam":
|
||||||
_, cam_id, command = res.groups()
|
|
||||||
cam_id = int(cam_id)
|
|
||||||
if command == "moveCam":
|
|
||||||
self.move_cam(cam_id, args)
|
self.move_cam(cam_id, args)
|
||||||
elif command == "setCamPreset":
|
elif osc_address == "/setCamPreset":
|
||||||
self.set_cam_preset(cam_id, args)
|
self.set_cam_preset(cam_id, args)
|
||||||
elif command == "useCamPreset":
|
elif osc_address == "/useCamPreset":
|
||||||
self.use_cam_preset(cam_id, args)
|
self.use_cam_preset(cam_id, args)
|
||||||
elif command == "zoomCam":
|
elif osc_address == "/zoomCam":
|
||||||
self.zoom_cam(cam_id, args)
|
self.zoom_cam(cam_id, args)
|
||||||
elif command == "toggleNightView":
|
elif osc_address == "/toggleNightView":
|
||||||
self.toggle_night_view(cam_id, args)
|
self.toggle_night_view(cam_id, args)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue