mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-30 02:31:40 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
11
backend/app/classes/ChameleonCamera.py
Normal file
11
backend/app/classes/ChameleonCamera.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from ChameleonPipeLine import ChameleonPipeline
|
||||
|
||||
|
||||
class ChameleonCamera:
|
||||
|
||||
def __init__(self, dic):
|
||||
self.pipelines = []
|
||||
|
||||
for pipeline in dic["pipelines"]:
|
||||
self.pipelines.append(ChameleonPipeline(pipeline))
|
||||
|
||||
8
backend/app/classes/ChameleonPipeLine.py
Normal file
8
backend/app/classes/ChameleonPipeLine.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
class ChameleonPipeline:
|
||||
|
||||
def __init__(self, dic):
|
||||
self.id = dic["id"]
|
||||
self.exposure = dic["exposure"]
|
||||
self.brightness = dic["brightness"]
|
||||
0
backend/app/classes/__init__.py
Normal file
0
backend/app/classes/__init__.py
Normal file
@@ -1,15 +1,20 @@
|
||||
import tornado.websocket
|
||||
import json
|
||||
from classes.ChameleonCamera import ChameleonCamera
|
||||
|
||||
|
||||
class ChameleonWebSocket(tornado.websocket.WebSocketHandler):
|
||||
|
||||
def check_origin(self, origin):
|
||||
return True
|
||||
|
||||
def open(self):
|
||||
self.write_message(json.dumps(
|
||||
{
|
||||
'cam1':{
|
||||
'pipeline':1,
|
||||
'exposure':12
|
||||
'cam1': {
|
||||
'pipelines': [
|
||||
{"id": 1, "Exposure": 45}
|
||||
]
|
||||
}
|
||||
}
|
||||
))
|
||||
@@ -17,6 +22,28 @@ class ChameleonWebSocket(tornado.websocket.WebSocketHandler):
|
||||
|
||||
def on_message(self, 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)
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
this.openedNames = [''];
|
||||
} else {
|
||||
this.activeName = this.$refs.menu.currentActiveName;
|
||||
this.openedNames = [this.activeName.split("-")[0]];
|
||||
this.openedNames = ["/" + this.activeName.split("/")[1]];
|
||||
}
|
||||
|
||||
this.$nextTick(function() {
|
||||
|
||||
Reference in New Issue
Block a user