fix qvvr time and fix fluc error

This commit is contained in:
lnk
2025-07-29 18:10:03 +08:00
parent 46b7603ed0
commit cc41842077
4 changed files with 100 additions and 11 deletions

View File

@@ -121,7 +121,7 @@ public:
class CDataType //数据类型类
{
public:
int iDataType; //数据类型值1-稳态 2-闪变 3-暂态
int iDataType; //数据类型值1-稳态 2-闪变 3-长闪
QString type; //参数等级type类型0-DataType 1-监测点 2-剔除标记 3-发生时刻,毫秒 4-数据链表 5-相位 6-值索引 9-实时SOE事件
int BaseFlag1; //zw修改 2023-8-25 记录基础数据总个数
int BaseFlag0; //zw修改 2023-8-25 记录非基础数据个数
@@ -385,7 +385,7 @@ bool ParseXMLConfig2(int xml_flag, XmlConfig *cfg, list<CTopic*> *ctopiclist,QSt
if (node4.isElement())
{
QString strPhase = node4.toElement().attribute("value"); //相别
if ((!xml_flag || "V" != it->strItemName) && "7" == strPhase) //⑤-①读取ABC三相数据 //lnk2024-8-14 角型判断
if ((!xml_flag || ("V" != it->strItemName && "F_S" != it->strItemName && "F_L" != it->strItemName)) && "7" == strPhase) //⑤-①读取ABC三相数据 //lnk2024-8-14 角型判断
{
for (int n = 0; n < 3; n++) //遍历 相别(ABC三相)
{
@@ -558,7 +558,7 @@ bool ParseXMLConfig2(int xml_flag, XmlConfig *cfg, list<CTopic*> *ctopiclist,QSt
}
} //⑤-①读取ABC三相数据 结束
if (xml_flag && "V" == it->strItemName && "112" == strPhase) //lnk2024-8-13角型
if (xml_flag && ("V" == it->strItemName || "F_S" == it->strItemName || "F_L" == it->strItemName) && "112" == strPhase) //lnk2024-8-13角型//lnk20250729闪变也要加上角形
{
for (int n = 0; n < 3; n++) //遍历 相别(AB、BC、CA三相)
{
@@ -965,6 +965,68 @@ QString line_to_phasic(QString qstrSeq) {
}
}
//调试用
void printCTopicList(const std::list<CTopic*>& ctopic_list) {
int topicIndex = 0;
for (const auto& topic : ctopic_list) {
printf("==== Topic[%d] ====\n", topicIndex++);
printf("Topic name: %s\n", topic->strTopic.toStdString().c_str());
int dtypeIndex = 0;
for (const auto& dtype : topic->DataTypeList) {
printf(" -- DataType[%d] --\n", dtypeIndex++);
printf(" iDataType: %d, type: %s, BaseFlag1: %d, BaseFlag0: %d\n",
dtype->iDataType,
dtype->type.toStdString().c_str(),
dtype->BaseFlag1,
dtype->BaseFlag0);
int monitorIndex = 0;
for (const auto& monitor : dtype->MonitorList) {
printf(" >> Monitor[%d] name: %s, type: %s\n",
monitorIndex++,
monitor->strMonitor.toStdString().c_str(),
monitor->type.toStdString().c_str());
int itemIndex = 0;
for (const auto& item : monitor->ItemList) {
printf(" >> Item[%d] name: %s, value: %s, type: %s\n",
itemIndex++,
item->strItemName.toStdString().c_str(),
item->strItemValue.toStdString().c_str(),
item->type.toStdString().c_str());
int seqIndex = 0;
for (const auto& seq : item->SequenceList) {
printf(" >> Sequence[%d] strSeq: %s, strSValue: %s, type: %s\n",
seqIndex++,
seq->strSeq.toStdString().c_str(),
seq->strSValue.toStdString().c_str(),
seq->type.toStdString().c_str());
int valIndex = 0;
for (const auto& val : seq->DataValueList) {
printf(" >> DataValue[%d] name: %s, value: %f\n",
valIndex++,
val->strName.toStdString().c_str(),
val->fValue);
}
}
}
}
// 如果需要打印 SOEList可加以下
/*
int soeIndex = 0;
for (const auto& soe : dtype->SOEList) {
printf(" >> SOE[%d] ... \n", soeIndex++);
// 打印 SOE 具体字段(如有定义)
}
*/
}
}
}
//20250214添加角型接线处理
int transfer_json_block_data(char v_wiring_type[], json_block_data *data) //json生成函数 zw修改 2023-8-11 调整传送json结构 目前仅限历史稳态数据
{
@@ -989,10 +1051,13 @@ int transfer_json_block_data(char v_wiring_type[], json_block_data *data) //json
if (xmlinfo_list2.contains(data->dev_type)) {
cout << "transfer_json_block_data contain data->dev_type" << endl;
ctopic_list = xmlinfo_list2[data->dev_type]->topicList;
//printCTopicList(ctopic_list);
}
else {
cout << "transfer_json_block_data not contain data->dev_type:" << data->dev_type.toStdString() << " !!!!"<< endl;
ctopic_list = topicList2;
}
}
@@ -1261,7 +1326,7 @@ int transfer_json_block_data(char v_wiring_type[], json_block_data *data) //json
if (isJump) continue; //跳出本数据类型循环
KafkaData.strText.append("}"); //拼接 json稳态数据结尾
cout<< countflag << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!send name=\"DATA_TYPE\" value=\"04\" " << num << endl;
cout<< countflag << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!send name=\"DATA_TYPE\" value=\"03\" " << num << endl;
cout << KafkaData.strText.toAscii().data() << endl;
if (countflag < num && 0 == time_sec % 7200) {
kafka_data_list_mutex.lock(); //加锁
@@ -1439,6 +1504,9 @@ int transfer_json_block_data(char v_wiring_type[], json_block_data *data) //json
if (isJump) continue; //跳出本数据类型循环
KafkaData.strText.append("}"); //拼接 json稳态数据结尾
//调试用
//cout << KafkaData.strText.toAscii().data() << endl;
kafka_data_list_mutex.lock(); //加锁
kafka_data_list.append(KafkaData); //添加 kafka发送链表
kafka_data_list_mutex.unlock(); //解锁
@@ -2136,7 +2204,7 @@ int transfer_json_block_data(char v_wiring_type[], json_block_data *data) //json
if (isJump) continue; //跳出本数据类型循环
KafkaData.strText.append("}"); //拼接 json稳态数据结尾
cout << countflag << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!send name=\"DATA_TYPE\" value=\"04\" " << num << endl;
cout << countflag << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!send name=\"DATA_TYPE\" value=\"03\" " << num << endl;
cout << KafkaData.strText.toAscii().data() << endl;
if (countflag < num && 0 == time_sec % 7200) {
kafka_data_list_mutex.lock(); //加锁