Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ case class ComponentCommands (
private def getOpcodes = linesClassMember(
Line.blank ::
line(s"//! Command opcodes") ::
wrapInEnum(sortedCmds.flatMap(writeOpcodeConstant))
wrapInNamedEnum("Opcode", sortedCmds.flatMap(writeOpcodeConstant))
)

private def writeOpcodeConstant(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ case class ComponentEvents (
linesClassMember(
List.concat(
Line.blank :: lines(s"//! Event IDs"),
wrapInEnum(
wrapInNamedEnum(
"EventId",
sortedEvents.flatMap((id, event) =>
writeEnumConstant(
eventIdConstantName(event.getName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ case class ComponentParameters (
private def getParamIds = linesClassMember(
List.concat(
Line.blank :: lines(s"//! Parameter IDs"),
wrapInEnum(sortedParams.flatMap(writeParamIdConstant))
wrapInNamedEnum("ParamId", sortedParams.flatMap(writeParamIdConstant))
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case class ComponentTelemetry(
Line.blank ::
List.concat(
lines(s"//! Channel IDs"),
wrapInEnum(channelIds)
wrapInNamedEnum("ChannelId", channelIds)
)
)
guardedList(hasChannels)(List(member))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ActiveCommandsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
Comment thread
bocchino marked this conversation as resolved.
Resolved
OPCODE_CMD_SYNC = 0x0, //!< A sync command with no params
OPCODE_CMD_SYNC_PRIMITIVE = 0x10, //!< An async command with primitive params
OPCODE_CMD_SYNC_STRING = 0x11, //!< A sync command with string params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ActiveEventsComponentBase :
};

//! Event IDs
enum {
enum EventId {
EVENTID_EVENTACTIVITYHIGH = 0x0, //!< An activity high event with no params
EVENTID_EVENTACTIVITYLOWTHROTTLED = 0x10, //!< An activity low, throttled event with primitive params
EVENTID_EVENTCOMMAND = 0x11, //!< A command event with string params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ActiveExternalParamsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_PARAMI32EXT_SET = 0x0, //!< Opcode to set parameter ParamI32Ext
OPCODE_PARAMI32EXT_SAVE = 0x1, //!< Opcode to save parameter ParamI32Ext
OPCODE_PARAMF64EXT_SET = 0x2, //!< Opcode to set parameter ParamF64Ext
Expand All @@ -134,7 +134,7 @@ class ActiveExternalParamsComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMI32EXT = 0x0, //!< An externally stored parameter with I32 data
//!< Second line of annotation
PARAMID_PARAMF64EXT = 0x1, //!< An externally stored parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ActiveOverflowComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_HOOK = 0x0, //!< A command with queue full 'hook' behavior
OPCODE_CMD_PARAMS_PRIORITY_HOOK = 0x1, //!< A command with params, priority, and queue full 'hook' behavior
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ActiveParamsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_PARAMU32_SET = 0x0, //!< Opcode to set parameter ParamU32
OPCODE_PARAMU32_SAVE = 0x1, //!< Opcode to save parameter ParamU32
OPCODE_PARAMF64_SET = 0x2, //!< Opcode to set parameter ParamF64
Expand All @@ -133,7 +133,7 @@ class ActiveParamsComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMU32 = 0x0, //!< A parameter with U32 data
//!< Second line of annotation
PARAMID_PARAMF64 = 0x1, //!< A parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ActiveSerialComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_SYNC = 0x0, //!< A sync command with no params
OPCODE_CMD_SYNC_PRIMITIVE = 0x10, //!< An async command with primitive params
OPCODE_CMD_SYNC_STRING = 0x11, //!< A sync command with string params
Expand Down Expand Up @@ -188,7 +188,7 @@ class ActiveSerialComponentBase :
};

//! Event IDs
enum {
enum EventId {
EVENTID_EVENTACTIVITYHIGH = 0x0, //!< An activity high event with no params
EVENTID_EVENTACTIVITYLOWTHROTTLED = 0x10, //!< An activity low, throttled event with primitive params
EVENTID_EVENTCOMMAND = 0x11, //!< A command event with string params
Expand All @@ -208,7 +208,7 @@ class ActiveSerialComponentBase :
};

//! Channel IDs
enum {
enum ChannelId {
CHANNELID_CHANNELU32FORMAT = 0x0, //!< Channel ID for ChannelU32Format
CHANNELID_CHANNELF32FORMAT = 0x1, //!< Channel ID for ChannelF32Format
CHANNELID_CHANNELSTRINGFORMAT = 0x2, //!< Channel ID for ChannelStringFormat
Expand All @@ -224,7 +224,7 @@ class ActiveSerialComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMU32 = 0x0, //!< A parameter with U32 data
//!< Second line of annotation
PARAMID_PARAMF64 = 0x1, //!< A parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ActiveTelemetryComponentBase :
};

//! Channel IDs
enum {
enum ChannelId {
CHANNELID_CHANNELU32FORMAT = 0x0, //!< Channel ID for ChannelU32Format
CHANNELID_CHANNELF32FORMAT = 0x1, //!< Channel ID for ChannelF32Format
CHANNELID_CHANNELSTRINGFORMAT = 0x2, //!< Channel ID for ChannelStringFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace M {
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_SYNC = 0x0, //!< A sync command with no params
OPCODE_CMD_SYNC_PRIMITIVE = 0x10, //!< An async command with primitive params
OPCODE_CMD_SYNC_STRING = 0x11, //!< A sync command with string params
Expand Down Expand Up @@ -178,7 +178,7 @@ namespace M {
};

//! Event IDs
enum {
enum EventId {
EVENTID_EVENTACTIVITYHIGH = 0x0, //!< An activity high event with no params
EVENTID_EVENTACTIVITYLOWTHROTTLED = 0x10, //!< An activity low, throttled event with primitive params
EVENTID_EVENTCOMMAND = 0x11, //!< A command event with string params
Expand All @@ -198,7 +198,7 @@ namespace M {
};

//! Channel IDs
enum {
enum ChannelId {
CHANNELID_CHANNELU32FORMAT = 0x0, //!< Channel ID for ChannelU32Format
CHANNELID_CHANNELF32FORMAT = 0x1, //!< Channel ID for ChannelF32Format
CHANNELID_CHANNELSTRINGFORMAT = 0x2, //!< Channel ID for ChannelStringFormat
Expand All @@ -214,7 +214,7 @@ namespace M {
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMU32 = 0x0, //!< A parameter with U32 data
//!< Second line of annotation
PARAMID_PARAMF64 = 0x1, //!< A parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class PassiveCommandsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_SYNC = 0x0, //!< A sync command with no params
OPCODE_CMD_SYNC_PRIMITIVE = 0x10, //!< An async command with primitive params
OPCODE_CMD_SYNC_STRING = 0x11, //!< A sync command with string params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PassiveEventsComponentBase :
};

//! Event IDs
enum {
enum EventId {
EVENTID_EVENTACTIVITYHIGH = 0x0, //!< An activity high event with no params
EVENTID_EVENTACTIVITYLOWTHROTTLED = 0x10, //!< An activity low, throttled event with primitive params
EVENTID_EVENTCOMMAND = 0x11, //!< A command event with string params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PassiveExternalParamsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_PARAMI32EXT_SET = 0x0, //!< Opcode to set parameter ParamI32Ext
OPCODE_PARAMI32EXT_SAVE = 0x1, //!< Opcode to save parameter ParamI32Ext
OPCODE_PARAMF64EXT_SET = 0x2, //!< Opcode to set parameter ParamF64Ext
Expand All @@ -128,7 +128,7 @@ class PassiveExternalParamsComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMI32EXT = 0x0, //!< An externally stored parameter with I32 data
//!< Second line of annotation
PARAMID_PARAMF64EXT = 0x1, //!< An externally stored parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class PassiveParamsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_PARAMU32_SET = 0x0, //!< Opcode to set parameter ParamU32
OPCODE_PARAMU32_SAVE = 0x1, //!< Opcode to save parameter ParamU32
OPCODE_PARAMF64_SET = 0x2, //!< Opcode to set parameter ParamF64
Expand All @@ -127,7 +127,7 @@ class PassiveParamsComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMU32 = 0x0, //!< A parameter with U32 data
//!< Second line of annotation
PARAMID_PARAMF64 = 0x1, //!< A parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class PassiveSerialComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_SYNC = 0x0, //!< A sync command with no params
OPCODE_CMD_SYNC_PRIMITIVE = 0x10, //!< An async command with primitive params
OPCODE_CMD_SYNC_STRING = 0x11, //!< A sync command with string params
Expand Down Expand Up @@ -172,7 +172,7 @@ class PassiveSerialComponentBase :
};

//! Event IDs
enum {
enum EventId {
EVENTID_EVENTACTIVITYHIGH = 0x0, //!< An activity high event with no params
EVENTID_EVENTACTIVITYLOWTHROTTLED = 0x10, //!< An activity low, throttled event with primitive params
EVENTID_EVENTCOMMAND = 0x11, //!< A command event with string params
Expand All @@ -192,7 +192,7 @@ class PassiveSerialComponentBase :
};

//! Channel IDs
enum {
enum ChannelId {
CHANNELID_CHANNELU32FORMAT = 0x0, //!< Channel ID for ChannelU32Format
CHANNELID_CHANNELF32FORMAT = 0x1, //!< Channel ID for ChannelF32Format
CHANNELID_CHANNELSTRINGFORMAT = 0x2, //!< Channel ID for ChannelStringFormat
Expand All @@ -208,7 +208,7 @@ class PassiveSerialComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMU32 = 0x0, //!< A parameter with U32 data
//!< Second line of annotation
PARAMID_PARAMF64 = 0x1, //!< A parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class PassiveTelemetryComponentBase :
};

//! Channel IDs
enum {
enum ChannelId {
CHANNELID_CHANNELU32FORMAT = 0x0, //!< Channel ID for ChannelU32Format
CHANNELID_CHANNELF32FORMAT = 0x1, //!< Channel ID for ChannelF32Format
CHANNELID_CHANNELSTRINGFORMAT = 0x2, //!< Channel ID for ChannelStringFormat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class PassiveTestComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_SYNC = 0x0, //!< A sync command with no params
OPCODE_CMD_SYNC_PRIMITIVE = 0x10, //!< An async command with primitive params
OPCODE_CMD_SYNC_STRING = 0x11, //!< A sync command with string params
Expand Down Expand Up @@ -164,7 +164,7 @@ class PassiveTestComponentBase :
};

//! Event IDs
enum {
enum EventId {
EVENTID_EVENTACTIVITYHIGH = 0x0, //!< An activity high event with no params
EVENTID_EVENTACTIVITYLOWTHROTTLED = 0x10, //!< An activity low, throttled event with primitive params
EVENTID_EVENTCOMMAND = 0x11, //!< A command event with string params
Expand All @@ -184,7 +184,7 @@ class PassiveTestComponentBase :
};

//! Channel IDs
enum {
enum ChannelId {
CHANNELID_CHANNELU32FORMAT = 0x0, //!< Channel ID for ChannelU32Format
CHANNELID_CHANNELF32FORMAT = 0x1, //!< Channel ID for ChannelF32Format
CHANNELID_CHANNELSTRINGFORMAT = 0x2, //!< Channel ID for ChannelStringFormat
Expand All @@ -200,7 +200,7 @@ class PassiveTestComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMU32 = 0x0, //!< A parameter with U32 data
//!< Second line of annotation
PARAMID_PARAMF64 = 0x1, //!< A parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class QueuedCommandsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_SYNC = 0x0, //!< A sync command with no params
OPCODE_CMD_SYNC_PRIMITIVE = 0x10, //!< An async command with primitive params
OPCODE_CMD_SYNC_STRING = 0x11, //!< A sync command with string params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class QueuedEventsComponentBase :
};

//! Event IDs
enum {
enum EventId {
EVENTID_EVENTACTIVITYHIGH = 0x0, //!< An activity high event with no params
EVENTID_EVENTACTIVITYLOWTHROTTLED = 0x10, //!< An activity low, throttled event with primitive params
EVENTID_EVENTCOMMAND = 0x11, //!< A command event with string params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class QueuedExternalParamsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_PARAMI32EXT_SET = 0x0, //!< Opcode to set parameter ParamI32Ext
OPCODE_PARAMI32EXT_SAVE = 0x1, //!< Opcode to save parameter ParamI32Ext
OPCODE_PARAMF64EXT_SET = 0x2, //!< Opcode to set parameter ParamF64Ext
Expand All @@ -134,7 +134,7 @@ class QueuedExternalParamsComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMI32EXT = 0x0, //!< An externally stored parameter with I32 data
//!< Second line of annotation
PARAMID_PARAMF64EXT = 0x1, //!< An externally stored parameter with F64 data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class QueuedOverflowComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_CMD_HOOK = 0x0, //!< A command with queue full 'hook' behavior
OPCODE_CMD_PARAMS_PRIORITY_HOOK = 0x1, //!< A command with params, priority, and queue full 'hook' behavior
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class QueuedParamsComponentBase :
};

//! Command opcodes
enum {
enum Opcode {
OPCODE_PARAMU32_SET = 0x0, //!< Opcode to set parameter ParamU32
OPCODE_PARAMU32_SAVE = 0x1, //!< Opcode to save parameter ParamU32
OPCODE_PARAMF64_SET = 0x2, //!< Opcode to set parameter ParamF64
Expand All @@ -133,7 +133,7 @@ class QueuedParamsComponentBase :
};

//! Parameter IDs
enum {
enum ParamId {
PARAMID_PARAMU32 = 0x0, //!< A parameter with U32 data
//!< Second line of annotation
PARAMID_PARAMF64 = 0x1, //!< A parameter with F64 data
Expand Down
Loading
Loading