fix qvvr
This commit is contained in:
@@ -591,6 +591,13 @@ std::string generate_json( //构造装置主动上送数据的报文
|
||||
);
|
||||
|
||||
//暂态事件接口
|
||||
bool append_qvvr_event(const std::string& terminal_id,
|
||||
int logical_seq, // 监测点序号(如 1)
|
||||
int nType, // 事件类型
|
||||
double fPersisstime_sec, // 持续时间(秒)
|
||||
double fMagnitude_pu, // 幅值(pu)
|
||||
uint64_t triggerTimeMs, // 触发时间(毫秒)
|
||||
int phase);
|
||||
int transfer_json_qvvr_data(const std::string& dev_id, ushort monitor_id,
|
||||
double mag, double dur, long long start_tm, int dis_kind,int phase,
|
||||
const std::string& wavepath);
|
||||
@@ -682,6 +689,18 @@ inline std::string trim_cstr(const char* s, size_t n) {
|
||||
return out;
|
||||
}
|
||||
|
||||
inline std::string sanitize(std::string s) {
|
||||
// 截断第一个 NUL 及其后内容
|
||||
size_t z = s.find('\0');
|
||||
if (z != std::string::npos) s.erase(z);
|
||||
// 去掉尾部不可打印字符(含 \r \n 等)
|
||||
while (!s.empty()) {
|
||||
unsigned char c = static_cast<unsigned char>(s.back());
|
||||
if (c >= 32 && c != 127) break;
|
||||
s.pop_back();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
extern int g_front_seg_index;
|
||||
extern std::string FRONT_IP;
|
||||
|
||||
Reference in New Issue
Block a user