fix rt data and mult front
This commit is contained in:
@@ -202,7 +202,7 @@ std::string LEDGER_UPDATE_FN = "LedgerUpdate.log";
|
||||
const int MAX_CPUNO = 10;
|
||||
|
||||
//lnk20250121<32>ն<EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int IED_COUNT = 200; //Ĭ<><C4AC>200
|
||||
int IED_COUNT = 300; //Ĭ<><C4AC>300
|
||||
|
||||
//WW 2-23-08-20 add start
|
||||
otl_connect db; //OTL<54><4C><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD> WW 2023-08-20
|
||||
@@ -12225,7 +12225,18 @@ int parse_device_cfg_web()
|
||||
|
||||
g_node->n_clients = count_cfg;
|
||||
//<2F><><EFBFBD>↑<EFBFBD>ٵ<EFBFBD>ied<65>Ŀռ<C4BF><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>е<EFBFBD><D0B5>ն<EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250121
|
||||
g_node->clients = (ied_t**)apr_pcalloc(g_cfg_pool, IED_COUNT * sizeof(ied_t*));//g_node->clients <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD> count_cfg <20><> ied_t* <20><><EFBFBD>͵<EFBFBD>ָ<EFBFBD>루<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飩<EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EF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BFBD><EFBFBD>ն<EFBFBD><D5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>̲<EFBFBD><CCB2>־<EFBFBD><D6BE><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD>
|
||||
g_node->clients = (ied_t**)apr_pcalloc(g_cfg_pool, count_cfg * sizeof(ied_t*));
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
||||
std::cout << "!!!!!!!!!!single process can not add any ledger unless reboot!!!!!!!"<< std::endl;
|
||||
}
|
||||
else{
|
||||
g_node->clients = (ied_t**)apr_pcalloc(g_cfg_pool, IED_COUNT * sizeof(ied_t*));//g_node->clients <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4>ռ<EFBFBD><D5BC>洢<EFBFBD><E6B4A2> count_cfg <20><> ied_t* <20><><EFBFBD>͵<EFBFBD>ָ<EFBFBD>루<EFBFBD><EBA3A8>һ<EFBFBD><D2BB>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>飩<EFBFBD><E9A3A9><EFBFBD>ǣ<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>룩<EFBFBD><EBA3A9>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
|
||||
//<2F><>ied<65><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
for (int k = 0; k < count_cfg; k++){
|
||||
|
||||
@@ -1769,28 +1769,29 @@ int transfer_json_block_data(char v_wiring_type[], json_block_data *data) //json
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
////lnk2024-8-15 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD>
|
||||
if (strcmp(v_wiring_type, "01") == 0) //lnk2024-8-15 <20><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD>
|
||||
if (strcmp(v_wiring_type, "1") == 0) //lnk2024-8-15 <20><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD>
|
||||
{
|
||||
cout << "report v_wiring_type is" << v_wiring_type << endl;
|
||||
cout << "1 report v_wiring_type is" << v_wiring_type << endl;
|
||||
if (xmlinfo_list.contains(data->dev_type)) {
|
||||
cout << "transfer_json_block_data contain data->dev_type" << endl;
|
||||
ctopic_list = xmlinfo_list[data->dev_type]->topicList;
|
||||
}
|
||||
else {
|
||||
cout << "transfer_json_block_data not contain data->dev_type" << endl;
|
||||
cout << "transfer_json_block_data not contain data->dev_type:" << data->dev_type.toStdString() << " !!!!"<< endl;
|
||||
ctopic_list = topicList;
|
||||
}
|
||||
}
|
||||
else //lnk2024-8-15 <20><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD>
|
||||
{
|
||||
cout << "report v_wiring_type is" << v_wiring_type << endl;
|
||||
cout << "2 report v_wiring_type is" << v_wiring_type << endl;
|
||||
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;
|
||||
}
|
||||
else {
|
||||
cout << "transfer_json_block_data not contain data->dev_type" << endl;
|
||||
cout << "transfer_json_block_data not contain data->dev_type:" << data->dev_type.toStdString() << " !!!!"<< endl;
|
||||
ctopic_list = topicList;
|
||||
}
|
||||
}
|
||||
@@ -3733,6 +3734,13 @@ void Set_xml_databaseinfo(char* MODEL_ID, char* TMNL_TYPE, char* FILE_PATH, char
|
||||
else {
|
||||
|
||||
}*/
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (xmlinfo_list.contains(type)) {
|
||||
std::cout << "xmlinfo_list.contains" << type.toStdString() <<std::endl;
|
||||
}
|
||||
else{
|
||||
std::cout << "??????????????????xmlinfo_list not contains" << type.toStdString() <<std::endl;
|
||||
}
|
||||
}
|
||||
//zw<7A><EFBFBD> 2023-9-4 <20><>ȡװ<C8A1><D7B0><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD>Ӧ<EFBFBD><D3A6>xml<6D>ļ<EFBFBD>
|
||||
void Set_xml_nodeinfo()
|
||||
|
||||
@@ -730,7 +730,14 @@ std::string extractDataJson(const char* inputJson) {
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> messageBody <20>е<EFBFBD> JSON <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
cJSON* messageBody = cJSON_Parse(messageJson->valuestring); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
const char* messageBodyStr = messageJson->valuestring;
|
||||
if (messageBodyStr == nullptr || strlen(messageBodyStr) == 0) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON or it's empty." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
return false;
|
||||
}
|
||||
|
||||
cJSON* messageBody = cJSON_Parse(messageBodyStr); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
if (messageBody == NULL) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
@@ -793,7 +800,14 @@ bool parseJsonMessageRT(const std::string& body, std::string& devSeries, std::st
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> messageBody <20>е<EFBFBD> JSON <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
cJSON* messageBody = cJSON_Parse(messageJson->valuestring); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
const char* messageBodyStr = messageJson->valuestring;
|
||||
if (messageBodyStr == nullptr || strlen(messageBodyStr) == 0) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON or it's empty." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
return false;
|
||||
}
|
||||
|
||||
cJSON* messageBody = cJSON_Parse(messageBodyStr); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
if (messageBody == NULL) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
@@ -1030,7 +1044,14 @@ void parse_set(const std::string& json_str) {
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> messageBody <20>е<EFBFBD> JSON <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
cJSON* messageBody = cJSON_Parse(messageJson->valuestring); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
const char* messageBodyStr = messageJson->valuestring;
|
||||
if (messageBodyStr == nullptr || strlen(messageBodyStr) == 0) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON or it's empty." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
return;
|
||||
}
|
||||
|
||||
cJSON* messageBody = cJSON_Parse(messageBodyStr); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
if (messageBody == NULL) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
@@ -1053,9 +1074,9 @@ void parse_set(const std::string& json_str) {
|
||||
}
|
||||
|
||||
//<2F>ж<EFBFBD><D0B6>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>̺ţ<CCBA>
|
||||
//int index_value = index->valueint;
|
||||
string index_value_str = index->valuestring;
|
||||
int index_value = StringToInt(index_value_str);
|
||||
int index_value = index->valueint;
|
||||
//string index_value_str = index->valuestring;
|
||||
//int index_value = StringToInt(index_value_str);
|
||||
|
||||
//<2F><><EFBFBD>̺<EFBFBD>Ϊ0<CEAA>Ľ<EFBFBD><C4BD>̴<EFBFBD><CCB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><D0BF><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
if (index_value != g_front_seg_index && g_front_seg_index !=0) {
|
||||
@@ -1355,7 +1376,14 @@ void parse_control(const std::string& json_str, const std::string& output_dir) {
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> messageBody <20>е<EFBFBD> JSON <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
cJSON* messageBody = cJSON_Parse(messageJson->valuestring); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
const char* messageBodyStr = messageJson->valuestring;
|
||||
if (messageBodyStr == nullptr || strlen(messageBodyStr) == 0) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON or it's empty." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
return;
|
||||
}
|
||||
|
||||
cJSON* messageBody = cJSON_Parse(messageBodyStr); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
if (messageBody == NULL) {
|
||||
std::cerr << "Failed to parse 'messageBody' JSON." << std::endl;
|
||||
cJSON_Delete(root);
|
||||
@@ -1378,9 +1406,10 @@ void parse_control(const std::string& json_str, const std::string& output_dir) {
|
||||
}
|
||||
|
||||
//<2F>ж<EFBFBD><D0B6>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>̺ţ<CCBA>
|
||||
//int index_value = index->valueint;
|
||||
string index_value_str = index->valuestring;
|
||||
int index_value = StringToInt(index_value_str);
|
||||
int index_value = index->valueint;
|
||||
//string index_value_str = index->valuestring;
|
||||
//int index_value = StringToInt(index_value_str);
|
||||
|
||||
|
||||
//<2F><><EFBFBD>̺<EFBFBD>Ϊ0<CEAA>Ľ<EFBFBD><C4BD>̴<EFBFBD><CCB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
if (index_value != g_front_seg_index && g_front_seg_index !=0) {
|
||||
|
||||
@@ -121,10 +121,17 @@ apr_status_t init_rem_dib_table()
|
||||
struct in_addr ip;
|
||||
chnl_usr_t *chnl_usr;
|
||||
|
||||
set_rem_dib_table_size( IED_COUNT );//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ն<EFBFBD><D5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
g_pt61850app->chnl_usr = apr_pcalloc( g_init_pool,IED_COUNT*sizeof(chnl_usr_t*) );
|
||||
printf( "set_rem_dib_table_size %d \n",IED_COUNT );
|
||||
|
||||
if(IED_COUNT < g_pt61850app->chnl_counts){
|
||||
set_rem_dib_table_size( g_pt61850app->chnl_counts );//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ն<EFBFBD><D5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
g_pt61850app->chnl_usr = apr_pcalloc( g_init_pool,g_pt61850app->chnl_counts*sizeof(chnl_usr_t*) );
|
||||
printf( "set_rem_dib_table_size %d \n",g_pt61850app->chnl_counts );
|
||||
}
|
||||
else{
|
||||
set_rem_dib_table_size( IED_COUNT );//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ն<EFBFBD><D5B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
g_pt61850app->chnl_usr = apr_pcalloc( g_init_pool,IED_COUNT*sizeof(chnl_usr_t*) );
|
||||
printf( "set_rem_dib_table_size %d \n",IED_COUNT );
|
||||
}
|
||||
|
||||
for(iedno=0 ; iedno<g_node->n_clients; iedno++) {
|
||||
ied = g_node->clients[iedno];
|
||||
for(chnl_no=0 ; chnl_no<ied->chncount; chnl_no++) {
|
||||
|
||||
Reference in New Issue
Block a user