mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-04 03:11:40 +00:00
updates from session
This commit is contained in:
@@ -4,8 +4,10 @@ from .ChameleonPipeLine import ChameleonPipeline
|
|||||||
class ChameleonCamera:
|
class ChameleonCamera:
|
||||||
|
|
||||||
def __init__(self, dic):
|
def __init__(self, dic):
|
||||||
self.pipelines = []
|
self.pipelines = {}
|
||||||
|
|
||||||
for pipeline in dic["pipelines"]:
|
for pipeline_id in dic["pipelines"]:
|
||||||
self.pipelines.append(ChameleonPipeline(pipeline))
|
self.pipelines[pipeline_id] = ChameleonPipeline(dic[pipeline_id])
|
||||||
|
|
||||||
|
def change_value(self, pipline_id, key, value):
|
||||||
|
self.pipelines[pipline_id][key] = value
|
||||||
@@ -5,4 +5,4 @@ class ChameleonPipeline:
|
|||||||
def __init__(self, dic):
|
def __init__(self, dic):
|
||||||
self.id = dic["id"]
|
self.id = dic["id"]
|
||||||
self.exposure = dic["exposure"]
|
self.exposure = dic["exposure"]
|
||||||
self.brightness = dic["brightness"]
|
self.brightness = dic["brightness"]
|
||||||
|
|||||||
@@ -9,35 +9,36 @@ class ChameleonWebSocket(tornado.websocket.WebSocketHandler):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def open(self):
|
def open(self):
|
||||||
self.write_message(json.dumps(
|
|
||||||
{
|
# TODO: read setting from default file store them
|
||||||
'cam1': {
|
setting = json.load("file.json")
|
||||||
'pipelines': [
|
self.cam_name = setting["curr_cam"]
|
||||||
{"id": 1, "Exposure": 45}
|
self.pipe_line = setting["curr_pipeline"]
|
||||||
]
|
|
||||||
}
|
# TODO: get current camera pipeline file
|
||||||
}
|
curr_setting = json.load(self.cam_name + "/" + self.pipe_line)
|
||||||
))
|
|
||||||
|
# TODO: wrtie current pipeline setting to client
|
||||||
|
self.write_message(curr_setting)
|
||||||
|
|
||||||
print("WebSocket opened")
|
print("WebSocket opened")
|
||||||
|
|
||||||
def on_message(self, message):
|
def on_message(self, message):
|
||||||
# print(json.loads(message))
|
|
||||||
|
|
||||||
cams = []
|
cams = []
|
||||||
|
|
||||||
dic = {
|
dic = {
|
||||||
'cam1': {
|
'cam1': {
|
||||||
'pipelines': [
|
'pipelines': {
|
||||||
{"id": 1, "exposure": 45, "brightness": 123123},
|
"1": {"exposure": 45, "brightness": 123123},
|
||||||
{"id": 2, "exposure": 12, "brightness": 123},
|
"2": {"exposure": 12, "brightness": 123},
|
||||||
{"id": 3, "exposure": 23, "brightness": 12}
|
"3": {"exposure": 23, "brightness": 12}
|
||||||
]
|
}
|
||||||
},
|
},
|
||||||
'cam2': {
|
'cam2': {
|
||||||
'pipelines': [
|
'pipelines': {
|
||||||
{"id": 1, "exposure": 15, "brightness": 1233},
|
"1": {"exposure": 15, "brightness": 1233},
|
||||||
{"id": 2, "exposure": 68, "brightness": 453}
|
"2": {"exposure": 68, "brightness": 453}
|
||||||
]
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
<Header id="main-header">
|
<Header id="main-header">
|
||||||
<Row type="flex" justify="start" align="middle" :gutter="10">
|
<Row type="flex" justify="start" align="middle" :gutter="10">
|
||||||
<Col span="12">
|
<Col span="12">
|
||||||
<chselect title="camera" :list="[1,2,3]" Xkey="camera"></chselect>
|
<chselect title="camera" :list="['1','2','3']" Xkey="camera"></chselect>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span="12">
|
<Col span="12">
|
||||||
<chselect title="pipline" :list="[0,1,2,3,4,5,6,7,8,9]" Xkey="pipeline"></chselect>
|
<chselect title="pipline" :list="['0','1','2','3','4','5','6','7','8','9']" Xkey="pipeline"></chselect>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Header>
|
</Header>
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'ch-range',
|
name: 'ch-range',
|
||||||
props:{title:'',
|
props:{
|
||||||
Xkey:''
|
title:String,
|
||||||
|
Xkey:String
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'ch-select',
|
name: 'ch-select',
|
||||||
props:{
|
props:{
|
||||||
title:'',
|
title: String,
|
||||||
list:[],
|
list: Array,
|
||||||
Xkey:''
|
Xkey: String
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -17,12 +17,11 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'ch-slider',
|
name: 'ch-slider',
|
||||||
props:{
|
props:{
|
||||||
title:'',
|
title:String,
|
||||||
Xkey:''
|
Xkey:String
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user