Beispiel #1
0
    def __init__(self, parent=None):
        super(App, self).__init__(parent)

        #### Create Gui Elements ###########
        self.mainbox = gl.GLViewWidget()
        self.setFixedSize(800, 800)
        self.setCentralWidget(self.mainbox)
        self.mainbox.setFixedSize(1600, 1200)
        self.mainbox.opts['viewport'] = (0, 0, 1600, 1200)
        self.mainbox.setWindowTitle('test')
        g = gl.GLGridItem()
        self.mainbox.addItem(g)
        pos = np.empty((21, 3))
        sizes = np.ones((21)) * 0.1
        colors = []
        colors_tpt = [[0, 1, 1, 1]]
        for i in range(5):
            colors.append(colors_tpt[0])
            colors.append(colors_tpt[0])
            colors.append(colors_tpt[0])
            colors.append(colors_tpt[0])
        colors.append([1, 0, 1, 1])

        self.sp = gl.GLScatterPlotItem(pos=pos, size=sizes, color=np.array(colors), pxMode=False)
        self.mainbox.addItem(self.sp)
        self._data_container = Data_container()
        # print(self.mainbox.getViewport())
        self._gege_client = None
        self._didi_client = None
        self._prediction_thread = None

        # Start
        self._update()
Beispiel #2
0
import flask
from flask import render_template, jsonify
import numpy as np
from io import StringIO
from PIL import Image
import requests
import socket
import base64
import json
import time
from data_container import Data_container

app = flask.Flask(__name__)
data_container = Data_container()
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)  # UDP


@app.route('/')
def index():
    return render_template("index.html")


@app.route('/get_image_1/<timestamp>', methods=['GET', 'POST'])
def get_image_1(timestamp):
    ret = requests.get(
        "http://192.168.5.178/html/cam_pic.php/?time=%s&pDelay=40000" %
        timestamp)
    ret = ret.content
    data_container.insert_image(ret, 0)
    return ret