aboutsummaryrefslogtreecommitdiff
path: root/NeoRuntime/Runtime
diff options
context:
space:
mode:
authorJakob Stendahl <jakobste@uio.no>2021-10-21 22:14:58 +0200
committerJakob Stendahl <jakobste@uio.no>2021-10-21 22:14:58 +0200
commitf6d2fa6faee7ca5482711c2737170f61e8342425 (patch)
tree7a1ba56a88b4967d3b0d31d8f38ae33d326a9860 /NeoRuntime/Runtime
parent7366ae92038e94e74472cb21a02b24124b72dd93 (diff)
downloadLuxcena-Neo-f6d2fa6faee7ca5482711c2737170f61e8342425.tar.gz
Luxcena-Neo-f6d2fa6faee7ca5482711c2737170f61e8342425.zip
:lipstick: Improve simulation by changing to using a svg. and some small fixes
Diffstat (limited to 'NeoRuntime/Runtime')
-rw-r--r--NeoRuntime/Runtime/neo_runtime.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/NeoRuntime/Runtime/neo_runtime.py b/NeoRuntime/Runtime/neo_runtime.py
index 3057f3c..caa367e 100644
--- a/NeoRuntime/Runtime/neo_runtime.py
+++ b/NeoRuntime/Runtime/neo_runtime.py
@@ -69,7 +69,7 @@ class NeoRuntime:
self.__module_th = exec_module(self.__module_loop)
# This will run in this thread.
- print("> Starting to listen on stdin")
+ print("> Starting IPC socket server")
self.__s = None
try:
self.__bind_socket()
@@ -81,6 +81,7 @@ class NeoRuntime:
finally:
self.__close_socket()
+
def __bind_socket(self):
if path.exists(self.__socket_file):
remove(self.__socket_file)
@@ -89,6 +90,7 @@ class NeoRuntime:
self.__s.bind(self.__socket_file)
self.__s.listen(1)
+
def __socket_listener(self):
self.__s_clients = []
last_send = time.perf_counter()
@@ -118,7 +120,7 @@ class NeoRuntime:
last_send = time.perf_counter()
if self.__send_strip_buffer:
- time.sleep(0.001)
+ time.sleep(0.05)
buffer = [2]
for p in self.__strip.COLORSTATE:
buffer.append((p & 0x00FF0000) >> 16)
@@ -153,6 +155,7 @@ class NeoRuntime:
except Exception as e:
traceback.print_exc()
+
def __close_socket(self):
if (self.__s is None): return
r, w, e = select.select([self.__s, *self.__s_clients], self.__s_clients, [], 0)
@@ -166,7 +169,6 @@ class NeoRuntime:
self.__s.close()
-
def __execute_command(self, command):
"""
command should be of type bytes