mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
alarms: Add alarm for AHRS Communications
The AHRSComms alarm will be raised whenever the OP board is not able to communicate with the AHRS board. The navigation software on the OP board could use this alarm to trigger its best attempt at an emergency landing. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1002 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
71e491e3c1
commit
b084fc4be5
@ -33,7 +33,7 @@
|
||||
#define SYSTEMALARMS_H
|
||||
|
||||
// Object constants
|
||||
#define SYSTEMALARMS_OBJID 2311311520U
|
||||
#define SYSTEMALARMS_OBJID 2311311584U
|
||||
#define SYSTEMALARMS_NAME "SystemAlarms"
|
||||
#define SYSTEMALARMS_METANAME "SystemAlarmsMeta"
|
||||
#define SYSTEMALARMS_ISSINGLEINST 1
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
// Object data
|
||||
typedef struct {
|
||||
uint8_t Alarm[9];
|
||||
uint8_t Alarm[10];
|
||||
|
||||
} __attribute__((packed)) SystemAlarmsData;
|
||||
|
||||
@ -66,9 +66,9 @@ typedef struct {
|
||||
/* Enumeration options for field Alarm */
|
||||
typedef enum { SYSTEMALARMS_ALARM_OK=0, SYSTEMALARMS_ALARM_WARNING=1, SYSTEMALARMS_ALARM_ERROR=2, SYSTEMALARMS_ALARM_CRITICAL=3, } SystemAlarmsAlarmOptions;
|
||||
/* Array element names for field Alarm */
|
||||
typedef enum { SYSTEMALARMS_ALARM_OUTOFMEMORY=0, SYSTEMALARMS_ALARM_STACKOVERFLOW=1, SYSTEMALARMS_ALARM_CPUOVERLOAD=2, SYSTEMALARMS_ALARM_EVENTSYSTEM=3, SYSTEMALARMS_ALARM_SDCARD=4, SYSTEMALARMS_ALARM_TELEMETRY=5, SYSTEMALARMS_ALARM_MANUALCONTROL=6, SYSTEMALARMS_ALARM_ACTUATOR=7, SYSTEMALARMS_ALARM_STABILIZATION=8, } SystemAlarmsAlarmElem;
|
||||
typedef enum { SYSTEMALARMS_ALARM_OUTOFMEMORY=0, SYSTEMALARMS_ALARM_STACKOVERFLOW=1, SYSTEMALARMS_ALARM_CPUOVERLOAD=2, SYSTEMALARMS_ALARM_EVENTSYSTEM=3, SYSTEMALARMS_ALARM_SDCARD=4, SYSTEMALARMS_ALARM_TELEMETRY=5, SYSTEMALARMS_ALARM_MANUALCONTROL=6, SYSTEMALARMS_ALARM_ACTUATOR=7, SYSTEMALARMS_ALARM_STABILIZATION=8, SYSTEMALARMS_ALARM_AHRSCOMMS=9, } SystemAlarmsAlarmElem;
|
||||
/* Number of elements for field Alarm */
|
||||
#define SYSTEMALARMS_ALARM_NUMELEM 9
|
||||
#define SYSTEMALARMS_ALARM_NUMELEM 10
|
||||
|
||||
|
||||
// Generic interface functions
|
||||
|
@ -50,6 +50,7 @@ SystemAlarms::SystemAlarms(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTINGS, NAM
|
||||
AlarmElemNames.append("ManualControl");
|
||||
AlarmElemNames.append("Actuator");
|
||||
AlarmElemNames.append("Stabilization");
|
||||
AlarmElemNames.append("AHRSComms");
|
||||
QStringList AlarmEnumOptions;
|
||||
AlarmEnumOptions.append("OK");
|
||||
AlarmEnumOptions.append("Warning");
|
||||
|
@ -41,7 +41,7 @@ class UAVOBJECTS_EXPORT SystemAlarms: public UAVDataObject
|
||||
public:
|
||||
// Field structure
|
||||
typedef struct {
|
||||
quint8 Alarm[9];
|
||||
quint8 Alarm[10];
|
||||
|
||||
} __attribute__((packed)) DataFields;
|
||||
|
||||
@ -50,13 +50,13 @@ public:
|
||||
/* Enumeration options for field Alarm */
|
||||
typedef enum { ALARM_OK=0, ALARM_WARNING=1, ALARM_ERROR=2, ALARM_CRITICAL=3, } AlarmOptions;
|
||||
/* Array element names for field Alarm */
|
||||
typedef enum { ALARM_OUTOFMEMORY=0, ALARM_STACKOVERFLOW=1, ALARM_CPUOVERLOAD=2, ALARM_EVENTSYSTEM=3, ALARM_SDCARD=4, ALARM_TELEMETRY=5, ALARM_MANUALCONTROL=6, ALARM_ACTUATOR=7, ALARM_STABILIZATION=8, } AlarmElem;
|
||||
typedef enum { ALARM_OUTOFMEMORY=0, ALARM_STACKOVERFLOW=1, ALARM_CPUOVERLOAD=2, ALARM_EVENTSYSTEM=3, ALARM_SDCARD=4, ALARM_TELEMETRY=5, ALARM_MANUALCONTROL=6, ALARM_ACTUATOR=7, ALARM_STABILIZATION=8, ALARM_AHRSCOMMS=9, } AlarmElem;
|
||||
/* Number of elements for field Alarm */
|
||||
static const quint32 ALARM_NUMELEM = 9;
|
||||
static const quint32 ALARM_NUMELEM = 10;
|
||||
|
||||
|
||||
// Constants
|
||||
static const quint32 OBJID = 2311311520U;
|
||||
static const quint32 OBJID = 2311311584U;
|
||||
static const QString NAME;
|
||||
static const bool ISSINGLEINST = 1;
|
||||
static const bool ISSETTINGS = 0;
|
||||
|
@ -40,7 +40,7 @@ _fields = [ \
|
||||
uavobject.UAVObjectField(
|
||||
'Alarm',
|
||||
'b',
|
||||
9,
|
||||
10,
|
||||
[
|
||||
'OutOfMemory',
|
||||
'StackOverflow',
|
||||
@ -51,6 +51,7 @@ _fields = [ \
|
||||
'ManualControl',
|
||||
'Actuator',
|
||||
'Stabilization',
|
||||
'AHRSComms',
|
||||
],
|
||||
{
|
||||
'0' : 'OK',
|
||||
@ -64,7 +65,7 @@ _fields = [ \
|
||||
|
||||
class SystemAlarms(uavobject.UAVObject):
|
||||
## Object constants
|
||||
OBJID = 2311311520
|
||||
OBJID = 2311311584
|
||||
NAME = "SystemAlarms"
|
||||
METANAME = "SystemAlarmsMeta"
|
||||
ISSINGLEINST = 1
|
||||
|
@ -1,7 +1,7 @@
|
||||
<xml>
|
||||
<object name="SystemAlarms" singleinstance="true" settings="false">
|
||||
<field name="Alarm" units="" type="enum" options="OK,Warning,Error,Critical"
|
||||
elementnames="OutOfMemory,StackOverflow,CPUOverload,EventSystem,SDCard,Telemetry,ManualControl,Actuator,Stabilization"/>
|
||||
elementnames="OutOfMemory,StackOverflow,CPUOverload,EventSystem,SDCard,Telemetry,ManualControl,Actuator,Stabilization,AHRSComms"/>
|
||||
<access gcs="readwrite" flight="readwrite"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="periodic" period="4000"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user