2025-03-29 18:05:12 +08:00
|
|
|
#ifndef CARDBASE_H
|
|
|
|
#define CARDBASE_H
|
|
|
|
|
|
|
|
#include "data_config.h"
|
2025-04-01 15:03:59 +08:00
|
|
|
//#ifdef NAME
|
|
|
|
// #undef NAME
|
|
|
|
//#endif
|
|
|
|
//#define NAME(x) (x, #x)
|
2025-03-29 18:05:12 +08:00
|
|
|
|
|
|
|
class CardBase {
|
|
|
|
public:
|
|
|
|
CardBase() {}
|
|
|
|
~CardBase() {}
|
2025-04-01 15:03:59 +08:00
|
|
|
// void FromJson(const Json::Value &cfg) {
|
|
|
|
// version_ = cfg["version"].asInt();
|
|
|
|
// slot_ = cfg["slot"].asInt();
|
|
|
|
// card_type_ = static_cast<CardType>(cfg["type"].asInt());
|
|
|
|
// }
|
2025-03-29 18:05:12 +08:00
|
|
|
|
2025-04-01 15:03:59 +08:00
|
|
|
// Json::Value ToJson() {
|
|
|
|
// Json::Value ch;
|
|
|
|
// ch[NAME(version)] = version_;
|
|
|
|
// ch[NAME(slot)] = slot_;
|
|
|
|
// ch[NAME(type)] = card_type_;
|
|
|
|
// return ch;
|
|
|
|
// }
|
2025-03-29 18:05:12 +08:00
|
|
|
|
2025-04-01 15:03:59 +08:00
|
|
|
// protected:
|
2025-03-29 18:05:12 +08:00
|
|
|
int version_;
|
|
|
|
int slot_; // 从1~15
|
|
|
|
CardType card_type_;
|
|
|
|
};
|
|
|
|
|
|
|
|
class VariableBase {
|
|
|
|
public:
|
|
|
|
VariableBase() {}
|
|
|
|
~VariableBase() {}
|
2025-04-01 15:03:59 +08:00
|
|
|
|
2025-03-29 18:05:12 +08:00
|
|
|
int id_;
|
|
|
|
VibChannelType type_;
|
|
|
|
DirectImpl direct_;
|
|
|
|
XImpl x1_;
|
|
|
|
XImpl x2_;
|
|
|
|
RecorderOut recorder_out_;
|
2025-04-01 15:03:59 +08:00
|
|
|
Delay delay_;
|
2025-03-29 18:05:12 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// 位移
|
|
|
|
class RadialVariable : public VariableBase {
|
|
|
|
public:
|
|
|
|
bool alert_latching_;
|
|
|
|
bool danger_latching_;
|
|
|
|
RadialImpl not1x_;
|
|
|
|
RadialImpl smax_;
|
|
|
|
};
|
|
|
|
|
|
|
|
// 加速度与速度
|
|
|
|
class AccVelVariable : public VariableBase {
|
|
|
|
public:
|
|
|
|
bool alert_latching_;
|
|
|
|
bool danger_latching_;
|
|
|
|
bool timed_ok_;
|
|
|
|
bool rms_active_;
|
|
|
|
bool integrate_active_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CARDBASE_H
|