updates from session

This commit is contained in:
ori agranat
2019-03-29 18:20:40 +03:00
parent b86af0abea
commit 5dfb468831
7 changed files with 38 additions and 36 deletions

View File

@@ -4,8 +4,10 @@ from .ChameleonPipeLine import ChameleonPipeline
class ChameleonCamera:
def __init__(self, dic):
self.pipelines = []
self.pipelines = {}
for pipeline in dic["pipelines"]:
self.pipelines.append(ChameleonPipeline(pipeline))
for pipeline_id in dic["pipelines"]:
self.pipelines[pipeline_id] = ChameleonPipeline(dic[pipeline_id])
def change_value(self, pipline_id, key, value):
self.pipelines[pipline_id][key] = value

View File

@@ -5,4 +5,4 @@ class ChameleonPipeline:
def __init__(self, dic):
self.id = dic["id"]
self.exposure = dic["exposure"]
self.brightness = dic["brightness"]
self.brightness = dic["brightness"]

View File

@@ -9,35 +9,36 @@ class ChameleonWebSocket(tornado.websocket.WebSocketHandler):
return True
def open(self):
self.write_message(json.dumps(
{
'cam1': {
'pipelines': [
{"id": 1, "Exposure": 45}
]
}
}
))
# TODO: read setting from default file store them
setting = json.load("file.json")
self.cam_name = setting["curr_cam"]
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")
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}
]
'pipelines': {
"1": {"exposure": 45, "brightness": 123123},
"2": {"exposure": 12, "brightness": 123},
"3": {"exposure": 23, "brightness": 12}
}
},
'cam2': {
'pipelines': [
{"id": 1, "exposure": 15, "brightness": 1233},
{"id": 2, "exposure": 68, "brightness": 453}
]
'pipelines': {
"1": {"exposure": 15, "brightness": 1233},
"2": {"exposure": 68, "brightness": 453}
}
}
}

View File

@@ -3,10 +3,10 @@
<Header id="main-header">
<Row type="flex" justify="start" align="middle" :gutter="10">
<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 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>
</Row>
</Header>

View File

@@ -19,12 +19,12 @@
<script>
export default {
name: 'ch-range',
props:{title:'',
Xkey:''
props:{
title:String,
Xkey:String
},
data() {
return {
value
}
},
methods: {

View File

@@ -15,13 +15,13 @@
export default {
name: 'ch-select',
props:{
title:'',
list:[],
Xkey:''
title: String,
list: Array,
Xkey: String
},
data() {
return {
value
}
},
methods: {

View File

@@ -17,12 +17,11 @@
export default {
name: 'ch-slider',
props:{
title:'',
Xkey:''
title:String,
Xkey:String
},
data() {
return {
value
}
},
methods: {