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):
|
||||
""" dispatches parsed osc messages to the ip cam command methods"""
|
||||
rule = re.compile("^/(.*?)/(\d+)/(.*?)$")
|
||||
res = rule.match(osc_address)
|
||||
if res:
|
||||
_, cam_id, command = res.groups()
|
||||
cam_id = int(cam_id)
|
||||
if command == "moveCam":
|
||||
|
||||
cam_id = args.pop(0)
|
||||
if osc_address == "/moveCam":
|
||||
self.move_cam(cam_id, args)
|
||||
elif command == "setCamPreset":
|
||||
elif osc_address == "/setCamPreset":
|
||||
self.set_cam_preset(cam_id, args)
|
||||
elif command == "useCamPreset":
|
||||
elif osc_address == "/useCamPreset":
|
||||
self.use_cam_preset(cam_id, args)
|
||||
elif command == "zoomCam":
|
||||
elif osc_address == "/zoomCam":
|
||||
self.zoom_cam(cam_id, args)
|
||||
elif command == "toggleNightView":
|
||||
elif osc_address == "/toggleNightView":
|
||||
self.toggle_night_view(cam_id, args)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue