PX4 Firmware
PX4 Autopilot Software http://px4.io
events::status::StatusDisplay Class Reference

#include <status_display.h>

Collaboration diagram for events::status::StatusDisplay:

Public Member Functions

 StatusDisplay (const events::SubscriberHandler &subscriber_handler)
 
void process ()
 regularily called to handle state updates More...
 

Protected Member Functions

bool check_for_updates ()
 check for topic updates More...
 
void set_leds ()
 handle LED logic changes & call publish() More...
 
void publish ()
 publish LED control More...
 

Protected Attributes

struct battery_status_s _battery_status = {}
 
struct cpuload_s _cpu_load = {}
 
struct vehicle_status_s _vehicle_status = {}
 
struct vehicle_status_flags_s _vehicle_status_flags = {}
 
struct vehicle_attitude_s _vehicle_attitude = {}
 
struct led_control_s _led_control = {}
 

Private Attributes

bool _old_gps_lock_valid = false
 
bool _old_home_position_valid = false
 
bool _low_battery = false
 
bool _critical_battery = false
 
int _old_nav_state = -1
 
int _old_battery_status_warning = -1
 
uORB::PublicationQueued< led_control_s_led_control_pub {ORB_ID(led_control)}
 
const events::SubscriberHandler_subscriber_handler
 

Detailed Description

Definition at line 59 of file status_display.h.

Constructor & Destructor Documentation

◆ StatusDisplay()

events::status::StatusDisplay::StatusDisplay ( const events::SubscriberHandler subscriber_handler)

Definition at line 51 of file status_display.cpp.

References _led_control, led_control_s::color, led_control_s::led_mask, led_control_s::mode, led_control_s::num_blinks, led_control_s::priority, and publish().

Here is the call graph for this function:

Member Function Documentation

◆ check_for_updates()

bool events::status::StatusDisplay::check_for_updates ( )
protected

check for topic updates

Returns
true if one or more topics got updated

Definition at line 65 of file status_display.cpp.

References _battery_status, _cpu_load, _subscriber_handler, _vehicle_status, _vehicle_status_flags, events::SubscriberHandler::battery_status_updated(), cpuload, events::SubscriberHandler::cpuload_updated(), events::SubscriberHandler::get_battery_status_sub(), events::SubscriberHandler::get_cpuload_sub(), events::SubscriberHandler::get_vehicle_status_flags_sub(), events::SubscriberHandler::get_vehicle_status_sub(), orb_copy(), ORB_ID, events::SubscriberHandler::vehicle_status_flags_updated(), and events::SubscriberHandler::vehicle_status_updated().

Referenced by process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process()

void events::status::StatusDisplay::process ( )

regularily called to handle state updates

Definition at line 92 of file status_display.cpp.

References check_for_updates(), and set_leds().

Referenced by events::SendEvent::cycle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ publish()

void events::status::StatusDisplay::publish ( )
protected

publish LED control

Definition at line 101 of file status_display.cpp.

References _led_control, _led_control_pub, hrt_absolute_time(), uORB::PublicationQueued< T >::publish(), and led_control_s::timestamp.

Referenced by StatusDisplay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_leds()

void events::status::StatusDisplay::set_leds ( )
protected

handle LED logic changes & call publish()

Definition at line 48 of file set_leds.cpp.

Referenced by process().

Here is the caller graph for this function:

Member Data Documentation

◆ _battery_status

struct battery_status_s events::status::StatusDisplay::_battery_status = {}
protected

Definition at line 84 of file status_display.h.

Referenced by check_for_updates().

◆ _cpu_load

struct cpuload_s events::status::StatusDisplay::_cpu_load = {}
protected

Definition at line 85 of file status_display.h.

Referenced by check_for_updates().

◆ _critical_battery

bool events::status::StatusDisplay::_critical_battery = false
private

Definition at line 96 of file status_display.h.

◆ _led_control

struct led_control_s events::status::StatusDisplay::_led_control = {}
protected

Definition at line 90 of file status_display.h.

Referenced by publish(), and StatusDisplay().

◆ _led_control_pub

uORB::PublicationQueued<led_control_s> events::status::StatusDisplay::_led_control_pub {ORB_ID(led_control)}
private

Definition at line 100 of file status_display.h.

Referenced by publish().

◆ _low_battery

bool events::status::StatusDisplay::_low_battery = false
private

Definition at line 95 of file status_display.h.

◆ _old_battery_status_warning

int events::status::StatusDisplay::_old_battery_status_warning = -1
private

Definition at line 98 of file status_display.h.

◆ _old_gps_lock_valid

bool events::status::StatusDisplay::_old_gps_lock_valid = false
private

Definition at line 93 of file status_display.h.

◆ _old_home_position_valid

bool events::status::StatusDisplay::_old_home_position_valid = false
private

Definition at line 94 of file status_display.h.

◆ _old_nav_state

int events::status::StatusDisplay::_old_nav_state = -1
private

Definition at line 97 of file status_display.h.

◆ _subscriber_handler

const events::SubscriberHandler& events::status::StatusDisplay::_subscriber_handler
private

Definition at line 102 of file status_display.h.

Referenced by check_for_updates().

◆ _vehicle_attitude

struct vehicle_attitude_s events::status::StatusDisplay::_vehicle_attitude = {}
protected

Definition at line 88 of file status_display.h.

◆ _vehicle_status

struct vehicle_status_s events::status::StatusDisplay::_vehicle_status = {}
protected

Definition at line 86 of file status_display.h.

Referenced by check_for_updates().

◆ _vehicle_status_flags

struct vehicle_status_flags_s events::status::StatusDisplay::_vehicle_status_flags = {}
protected

Definition at line 87 of file status_display.h.

Referenced by check_for_updates().


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