commit ebaa6d5a54c89fc59985dbeb913258efe90ec765
parent 30efae43c9cd85ab95da2c605d6578ecb8bc1b45
Author: rob <rob@tarina.org>
Date: Wed, 25 Jan 2023 15:30:15 +0200
sync from selected cam
Diffstat:
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/config.py b/config.py
@@ -7,4 +7,4 @@
port = 55555
#cameras = ["192.168.201.212","192.168.201.33","192.168.201.183"]
-cameras = ["10.42.0.243","10.42.0.131","10.42.0.77"]
+cameras = ["10.42.0.243","10.42.0.131","10.42.0.105","10.42.0.101"]
diff --git a/tarinactrl.py b/tarinactrl.py
@@ -72,7 +72,7 @@ def listenforclients(host, port, q):
ctrltime=time.time()
tarinatime=data.decode()
lag=ctrltime-float(tarinatime)
- status = addr[0], str(lag*1000), float(tarinatime)
+ status = addr[0], str(lag*1000), tarinatime
c.close()
q.put(status)
break
@@ -84,10 +84,16 @@ def printmenu(recording,selected,cameras,camselected,serverstatus,rectime):
print(time.time())
print(rectime)
if serverstatus != None:
- print(serverstatus[0])
- print(serverstatus[1])
- if rectime:
- print("rectime lag: "+str((rectime-serverstatus[2])*1000))
+ try:
+ print(serverstatus[0])
+ print(serverstatus[1])
+ if rectime:
+ if isinstance(serverstatus[2],float):
+ print("rectime lag: "+str((rectime-serverstatus[2])*1000))
+ if isinstance(serverstatus[2],str):
+ print(serverstatus[2])
+ except:
+ print('')
if recording != None:
print("Camera "+ str(recording)+" is recording! Shut up. And Action!")
a=0
@@ -161,11 +167,12 @@ def main(serverstatus):
sendtocamera(i,port,'PLACEHOLDER')
a=a+1
elif event == "KEY_ENTER" and menu[selected] == 'Sync SCENE':
- for p in cameras[1:]:
- if p not in camerasoff:
- if recording == None:
- sendtocamera(cameras[0],port,'SYNCIP:'+p)
- time.sleep(2)
+ #for p in cameras[1:]:
+ # if p not in camerasoff:
+ # if recording == None:
+ # sendtocamera(cameras[0],port,'SYNCIP:'+p)
+ if camselected != 0:
+ sendtocamera(cameras[0],port,'SYNCIP:'+cameras[camselected])
elif event == "KEY_ENTER" and menu[selected]=='New SCENE':
a=0
for i in cameras: