Modify & transmit params via CAN
This commit is contained in:
@ -6,13 +6,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// We want to automatically count the number of data field types for the
|
||||
// description array. This is wacky preprocessor magic that allows us to do just
|
||||
// that. Unfortunately, it doesn't work with enum classes, so we have to use
|
||||
// C-style enums.
|
||||
#define CountedEnum(NAME, TYPE, ...) \
|
||||
enum NAME : TYPE { __VA_ARGS__ }; \
|
||||
constexpr size_t NAME##_COUNT = sizeof((int[]){__VA_ARGS__}) / sizeof(int);
|
||||
#include "util.h"
|
||||
|
||||
CountedEnum(DataFieldType, size_t, DF_TSState, DF_ASState, DF_ActiveMission,
|
||||
DF_R2DProgress, DF_INVLReady, DF_INVRReady, DF_SDC, DF_ERR,
|
||||
@ -20,8 +14,6 @@ CountedEnum(DataFieldType, size_t, DF_TSState, DF_ASState, DF_ActiveMission,
|
||||
DF_TireTempRL, DF_TireTempRR, DF_MinCellVolt, DF_MaxCellTemp,
|
||||
DF_TSSoC, DF_LVSoC, DF_TSCurrent, DF_TSVoltageBat, DF_TSVoltageVeh,
|
||||
DF_Speed, DF_BBal);
|
||||
CountedEnum(ParamFieldType, size_t, PF_BBAL, PF_TC1, PF_TC2, PF_TORQUEMAP,
|
||||
PF_TEST1, PF_TEST2, PF_TEST3, PF_TEST4);
|
||||
|
||||
enum class NamedFieldKind { Float, Bool, Text, Int };
|
||||
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
#include "gui/common/NamedField.hpp"
|
||||
#include <gui_generated/containers/ConfigItemBase.hpp>
|
||||
|
||||
class ConfigItem : public ConfigItemBase, public NamedField<ParamFieldType> {
|
||||
#include "params.h"
|
||||
|
||||
class ConfigItem : public ConfigItemBase, public NamedField<ParamType> {
|
||||
public:
|
||||
ConfigItem();
|
||||
virtual ~ConfigItem() {}
|
||||
|
||||
Reference in New Issue
Block a user