add monitor
This commit is contained in:
parent
e86ef2f8de
commit
97e6eab5df
32
src/nodes/Monitor.py
Normal file
32
src/nodes/Monitor.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import logging
|
||||||
|
import struct
|
||||||
|
import subprocess
|
||||||
|
import time
|
||||||
|
|
||||||
|
import zmq
|
||||||
|
|
||||||
|
from BusClient import BusClient
|
||||||
|
from config import LIVE_REP_SOCKET, CONFIG, DEVICE_CONFIG
|
||||||
|
from nodes.Node import Node
|
||||||
|
from utils.Msg import ImageArgMsg, KillMsg, SetDeviceConnectedMsg, SetDeviceEnabledMsg, DeviceEnabledMsg, \
|
||||||
|
DeviceConnectedMsg, SetDeviceConfigMsg, DeviceOnlineMsg, DeviceConfigListMsg, RequestRfFrameMsg, RfFrameMsg, \
|
||||||
|
RfFrameWithMetaMsg
|
||||||
|
from utils.RfMeta import RfFrameMeta
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class Monitor(Node):
|
||||||
|
def __init__(self, level=logging.INFO):
|
||||||
|
super(Monitor, self).__init__(level=level)
|
||||||
|
self.c2: BusClient = None
|
||||||
|
|
||||||
|
def custom_setup(self):
|
||||||
|
self.c2 = BusClient()
|
||||||
|
self.device_rep_socket = self.context.socket(zmq.REQ)
|
||||||
|
self.device_rep_socket.connect(f"tcp://{LIVE_REP_SOCKET}")
|
||||||
|
|
||||||
|
def loop(self):
|
||||||
|
while True:
|
||||||
|
msg = self.c2.recv()
|
||||||
|
print(type(msg))
|
||||||
Loading…
Reference in New Issue
Block a user