Commit eb7601f1 authored by Aitor Henry's avatar Aitor Henry
Browse files

Some last changes, also push the webpack bundle which is use. Renamed...

Some last changes, also push the webpack bundle which is use. Renamed webserver.py. Create a README for documentation.
parent c7afd83e
node_modules/
webpack_output/
reset.sh
==============
Bpm-webserver
==============
Repository for the BeamViewer using the new Bpm_
.. _Bpm: https://gitlab.esrf.fr/limagroup/Lima-tango-python/blob/1-bpm-device/plugins/Bpm.py
Description
------------
This project is a BeamViewer using web technologies, it can be open from a browser and display images and informations. All camera running new Bpm plugin are accessible from url @host.esrf.fr:8066.
The webserver interact with camera hardware through TANGO device servers.
Dependencies
------------
System : Linux Debian 8.11 (Jessie)
Was working with following versions
**Python**
- bottle : 0.12.13
- gevent : 1.0.1
- PyTango : 9.2.0
- struct
**JavaScript**
- node : 6.14.2
- npm : 6.1.0
other dependencies are listed in package.json, and they are installed in a node_modules directory when you run "npm install" in the package.json directory.
Run
------------
Launch webserver with python "python bpm-webserver.py". Then you can open your broswer and go to url "host_name.esrf.fr:8066", the index page will display all camera found with new BPM plugin, and display the name in green if the camera is running.
......@@ -7,7 +7,6 @@ import bottle
import socket
import PyTango
import struct
import logging
import sys
# patch socket module
......@@ -143,7 +142,7 @@ class BVWebserver:
try:
self.cameras_running[camera][0].image_roi = (int(bottle.request.query.x),int(bottle.request.query.y),int(bottle.request.query.w),int(bottle.request.query.h))
except:
logging.exception("Could not set roi")
print "Could not set roi"
else:
pass
......
......@@ -3,7 +3,7 @@
"start": "npm run dev",
"dev": "webpack-dev-server"
},
"name": "test-React-Webpack-Redux",
"name": "bpm-webserver-packages",
"version": "0.1.0",
"repository": {
"type": "git",
......
......@@ -18,7 +18,7 @@ export function update_calibration_apply(){ // Set calibration in Bpm device
return (dispatch,getState) => {
const state = getState()
fetch('/'+state.bpmState.client_id+'/api/update_calibration?x='+state.options.calib_x+'&y='+state.options.calib_y)
fetch('/'+state.bpmState.client_id+'/api/update_calibration?calib_x='+state.options.calib_x+'&calib_y='+state.options.calib_y)
.then((response) => {
if(!response.ok){
throw Error(response.statusText);
......
......@@ -203,9 +203,6 @@ class Video extends React.Component {
}
/*
*/
function mapStateToProps(state) {
return {
......
module.exports ={
entry:{ //Le fichier d'entrer qui nous interesse
entry:{
main: ['./index.js']
},
output: { //Le fichier en sortie
output: {
path: __dirname + '/webpack_output',
filename: 'bundle.js' //Le fichier en sortie sera bundle.js
},
devServer: {
host: "0.0.0.0",
historyApiFallback:true,
proxy: {
'/api/*': {
target: "http://localhost:8066",
xfwd: true
},
'/bcu_basler/api/image_channel':{
target: "ws://localhost:8066",
ws: true,
secure: false
}
}
filename: 'bundle.js'
},
module: {
......@@ -72,16 +56,7 @@ module.exports ={
test: /\.(woff(2)?|ttf|eot|svg)(\?v=[a-z0-9]\.[a-z0-9]\.[a-z0-9])?$/,
loader: 'url-loader?limit=100000'
},
/*{
test: /\.html$/,
use: [ {
loader: 'html-loader',
options: {
minimize: true
}
}
]
},*/
]
}
......
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment