mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-02 02:51:40 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import tornado.websocket
|
||||
import json
|
||||
from classes.ChameleonCamera import ChameleonCamera
|
||||
|
||||
|
||||
class ChameleonWebSocket(tornado.websocket.WebSocketHandler):
|
||||
@@ -10,17 +11,40 @@ class ChameleonWebSocket(tornado.websocket.WebSocketHandler):
|
||||
def open(self):
|
||||
self.write_message(json.dumps(
|
||||
{
|
||||
'cam1':{
|
||||
'pipeline': 1,
|
||||
'exposure': 12
|
||||
'cam1': {
|
||||
'pipelines': [
|
||||
{"id": 1, "Exposure": 45}
|
||||
]
|
||||
}
|
||||
}
|
||||
))
|
||||
print("WebSocket opened")
|
||||
|
||||
def on_message(self, message):
|
||||
print(json.loads(message))
|
||||
# print(message)
|
||||
# print(json.loads(message))
|
||||
|
||||
cams = []
|
||||
|
||||
dic = {
|
||||
'cam1': {
|
||||
'pipelines': [
|
||||
{"id": 1, "exposure": 45, "brightness": 123123},
|
||||
{"id": 2, "exposure": 12, "brightness": 123},
|
||||
{"id": 3, "exposure": 23, "brightness": 12}
|
||||
]
|
||||
},
|
||||
'cam2': {
|
||||
'pipelines': [
|
||||
{"id": 1, "exposure": 15, "brightness": 1233},
|
||||
{"id": 2, "exposure": 68, "brightness": 453}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
for cam in dic:
|
||||
cams.append(ChameleonCamera(dic[cam]))
|
||||
|
||||
print(message)
|
||||
self.write_message(message)
|
||||
|
||||
def on_close(self):
|
||||
|
||||
Reference in New Issue
Block a user