Bot'n Roll ONE A+ - Raspberry Pi 5 library
 
Loading...
Searching...
No Matches
onepi.utils.monitor.Monitor Class Reference

Public Member Functions

 __init__ (self)
 
 is_process_running (self, process_name)
 
 start_monitor (self)
 
 monitor (self)
 

Public Attributes

bool onepi_running = False
 

Static Protected Attributes

str _PROCESS_NAME = "BnrOneAPlus"
 
str _MONITOR_NAME = "BnrMonitor"
 
str _MONITOR_PATH = "monitor.py"
 

Detailed Description

This class monitors the BnrOneAPlus process and takes action based on its status.
It provides the following functionalities:
1. Check if the BnrOneAPlus process is already running.
    This can be used by the parent process to decide if it should continue running or stop.
2. Start the Monitor process.
3. Stop the robot if the BnrOneAPlus process ends.

Constructor & Destructor Documentation

◆ __init__()

onepi.utils.monitor.Monitor.__init__ ( self)
Initialize the monitor

Member Function Documentation

◆ is_process_running()

onepi.utils.monitor.Monitor.is_process_running ( self,
process_name )
Check if a process with the given name is running.

◆ monitor()

onepi.utils.monitor.Monitor.monitor ( self)
Monitor the processes and take action based on their status.

◆ start_monitor()

onepi.utils.monitor.Monitor.start_monitor ( self)
Start the Monitor process.

The documentation for this class was generated from the following file: