Skip to content
Commits on Source (2)
......@@ -5,7 +5,6 @@
# System modules
import configparser
import logging
import time
# Third-party modules
......
......@@ -60,6 +60,7 @@ filter_state = {
}
filter_name = {
0: "Undef.",
1: "U",
2: "B",
3: "V",
......
......@@ -169,7 +169,7 @@ Control
</label>
<div class="col-md col-1 input-group">
<input class="form-control"
data-parameter="telescopeoffset-zd"
data-parameter="telescope-offset-zd"
value="-800" type="number" >
<input class="form-control"
data-parameter="telescope-offset-az"
......
......@@ -207,7 +207,7 @@ Init panel
</label>
<div class="col-md col-1 input-group">
<input class="form-control"
data-parameter="telescopeoffset-zd"
data-parameter="telescope-offset-zd"
value="-800" type="number" >
<input class="form-control"
data-parameter="telescope-offset-az"
......
......@@ -48,16 +48,16 @@ def enable(app):
@socketio.on('connect')
def handle_connect():
print("Sending initial")
# First connection
stream.status.initial(socketio, ws_names)
print("Sent")
client_id = request.sid
client_ip = request.remote_addr
connected_clients[client_id] = client_ip
uniques = len(set(connected_clients.values()))
print(f"Sending initial to {client_id}")
# First connection
stream.status.initial(socketio, ws_names, client=client_id)
print("Sent")
print(f"Connected: {client_id} - IP: {client_ip}. Tabs: {len(connected_clients)}, IPs: {uniques}")
......
......@@ -12,15 +12,16 @@ from datetime import datetime
from astropy.io import fits
# Custom modules
from utils.logger import log
from app import app
class Status:
def __init__(self):
self.last = {}
def initial(self, socketio, names):
def initial(self, socketio, names, client):
for name in names:
socketio.emit(name, self.last[name])
socketio.emit(name, self.last[name], room=client)
status = Status()
......@@ -60,7 +61,7 @@ def send_webcam(socketio, name, url, sleep=1):
status.last[name] = bytes(img)
socketio.emit(name, bytes(img))
except AttributeError as e:
console.warning(f"Could not send webcam image: {e}")
log.warning(f"Could not send webcam image: {e}")
pass
......