Changeset - 157985a971dc
[Not reviewed]
default
0 5 0
drewp@bigasterisk.com - 6 years ago 2019-06-05 05:29:06
drewp@bigasterisk.com
non-working WIP for vidref web
Ignore-this: e4be7b5961222bedb5ffe53c46388b3
5 files changed with 26 insertions and 29 deletions:
0 comments (0 inline, 0 general)
bin/vidref
Show inline comments
 
@@ -99,30 +99,30 @@ class Time(cyclone.web.RequestHandler):
 

	
 
#graph = SyncedGraph(networking.rdfdb.url, "vidref")
 
outVideos = videorecorder.FramesToVideoFiles(pipeline.liveImages)
 
#outVideos.save('/tmp/mov1')
 

	
 
port = networking.vidref.port
 
reactor.listenTCP(
 
    port,
 
    cyclone.web.Application(
 
        handlers=[
 
            (r'/()', cyclone.web.StaticFileHandler, {
 
                'path': 'light9/vidref',
 
                'default_filename': 'vidref.html'
 
                'default_filename': 'index.html'
 
            }),
 
            (r'/setup/()', cyclone.web.StaticFileHandler, {
 
                'path': 'light9/vidref',
 
                'default_filename': 'setup.html'
 
            }),
 
            (r'/setup/live', Live),
 
            (r'/live', Live),
 
            (r'/snapshot', Snapshot),
 
            (r'/snapshot/(.*)', SnapshotPic, {
 
                "path": snapshotDir()
 
            }),
 
            (r'/time', Time),
 
        ],
 
        debug=True,
 
    ))
 
log.info("serving on %s" % port)
 

	
 
reactor.run()
light9/vidref/index.html
Show inline comments
 
<!doctype html>
 
<html>
 
  <head>
 
    <title>picamserve</title>
 
    <title>vidref</title>
 
    <meta charset="utf-8" />
 
    <style>
 
      .tile {
 
        display: inline-block;
 
       border: 1px solid gray;
 
       margin: 3px;
 
       padding: 2px;
 
       }
 
     .tile img {
 
       }
 

	
 
     
 
    </style>
 
    <script src="/lib/jquery/dist/jquery.slim.min.js"></script>
 

	
 
    <script src="/websocket.js"></script>
 
    <script type="module"  src="/light9-vidref-live.js"></script>
 

	
 

	
 
  </head>
 
  <body>
 
    <section>
 
      Whole view
 
      <div class="tile">
 
        <img src="pic?resize=500&awb_mode=auto&exposure_mode=auto&shutter=100000">
 
      </div>
 
    </section>
 
  <section>
 
    Shutters
 
      <div data-bind="foreach: shutters">
 
        <div class="tile">
 
          <div><img data-bind="attr: {src: 'pic?res=480&resize=200&x=.5&y=.3&w=.5&h=.2&awb_mode=auto&exposure_mode=auto&shutter='+$data}"></div>
 
          <span data-bind="text: ($data / 1000) + ' ms'"></span> 
 
        </div>
 
      </div>
 
    </section>
 
    <script src="/lib/knockout/dist/knockout.js"></script>
 
    <script src="gui.js"></script>
 
    Live:
 
    <light9-vidref-live></light9-vidref-live>
 

	
 

	
 
  </body>
 
</html>
light9/web/light9-vidref-live.js
Show inline comments
 
import { LitElement, TemplateResult, html, css } from '/node_modules/lit-element/lit-element.js';
 

	
 
import { debug } from '/lib/debug/debug-build-es6.js';
 
debug.enable('*');
 
log = debug('live')
 

	
 
class Light9VidrefLive extends LitElement {
 
    
 
    static get properties() {
 
        return {
 
            description: { type: String }
 
        };
 
    }
 

	
 
    static get styles() {
 
        return css`
 
        :host {
 
@@ -17,23 +19,28 @@ class Light9VidrefLive extends LitElemen
 
        }
 
        `;
 
    }
 

	
 
    firstUpdated() {
 
        const ws = reconnectingWebSocket('live', (msg) => {
 
            this.shadowRoot.querySelector('#live').src = 'data:image/jpeg;base64,' + msg.jpeg;
 
            this.description = msg.description;
 
        });
 
        
 
    }
 

	
 
    disconnectedCallback() {
 
        log('bye');
 
        
 
    }
 
    
 
    render() {
 
        return html`
 
<div>
 
<div><img id="live" ></div>
 
<div>${this.description}</div>
 
</div>
 
`;
 

	
 
    }
 
}
 
customElements.define('light9-vidref-live', Light9VidrefLive);
makefile
Show inline comments
 
@@ -27,24 +27,27 @@ node_modules/bower/bin/bower:
 
bin/node:
 
	ln -sf `which nodejs` bin/node
 

	
 
bower: node_modules/bower/bin/bower bin/node
 
	cd light9/web/lib; nodejs ../../../node_modules/bower/bin/bower install
 

	
 
npm:
 
	npm install
 
	(cd node_modules/n3; nodejs ../browserify/bin/cmd.js --standalone N3 --require n3 -o n3-browser.js)
 
	node_modules/browserify/bin/cmd.js light9/web/lib/debug/src/browser.js -o light9/web/lib/debug/debug-build.js --standalone debug
 
	perl -pi -e "s,'lit-html,'/node_modules/lit-html,; s,lit-html',lit-html/lit-html.js'," node_modules/lit-element/lit-element.js
 
	perl -pi -e 's/module.exports = rounding/export { rounding }/' node_modules/significant-rounding/index.js
 
	node_modules/browserify/bin/cmd.js light9/web/lib/debug/src/browser.js -o light9/web/lib/debug/debug-build-es6.js
 
	node_modules/cjs-to-es6/index.js light9/web/lib/debug/debug-build-es6.js
 

	
 

	
 
bin/ascoltami2: gst_packages link_to_sys_packages
 

	
 
effect_node_setup: create_virtualenv packages binexec install_python_deps
 

	
 
tkdnd_build:
 
	# get tkdnd r95 with subversion
 
	# then apply tkdnd-patch-on-r95 to that
 
	cd tkdnd/trunk
 
	./configure
 
	make
 

	
package.json
Show inline comments
 
@@ -5,24 +5,25 @@
 
  "license": "MIT",
 
  "description": "Mini instructions:",
 
  "main": "index.js",
 
  "directories": {
 
    "test": "test"
 
  },
 
  "dependencies": {
 
    "@webcomponents/shadycss": "^1.3.1",
 
    "@webcomponents/webcomponentsjs": "^1.2.0",
 
    "bower": "^1.8.4",
 
    "browserify": "^16.2.3",
 
    "chai": "^3.5.0",
 
    "cjs-to-es6": "^1.1.1",
 
    "coffeelint": "^2.1.0",
 
    "coffeescript": "^2.3.0",
 
    "d3": "^5.1.0",
 
    "esmify": "^2.1.1",
 
    "lit-element": "^2.1.0",
 
    "lit-html": "^1.1.0",
 
    "mocha": "^2.5.3",
 
    "n3": "^1.0.0-alpha",
 
    "pixi.js": "^4.7.3",
 
    "significant-rounding": "^2.0.0",
 
    "tinycolor2": "^1.4.1"
 
  },
0 comments (0 inline, 0 general)