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