finish ledger update code
This commit is contained in:
@@ -11752,7 +11752,7 @@ void printLedgerinshell(const ied_usr_t& ied_usr, QIODevice* outputDevice) {
|
||||
// <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>豸<EFBFBD><E8B1B8>Ϣ<EFBFBD><CFA2><EFBFBD>ض<EFBFBD><D8B6>ն<EFBFBD><D5B6><EFBFBD>Ϣ
|
||||
void ledger(const char* terminal_id, QIODevice* outputDevice) {
|
||||
outputDevice->write("print ledger in shell");
|
||||
pthread_mutex_lock(&mtx);
|
||||
pthread_mutex_lock(&mtx); std::cout << "ledger()hold lock !!!!!!!!!!!" << std::endl;
|
||||
bool found = false;
|
||||
ied_t* ied;
|
||||
ied_usr_t* ied_usr;
|
||||
@@ -11774,14 +11774,14 @@ void ledger(const char* terminal_id, QIODevice* outputDevice) {
|
||||
QByteArray msg = "<EFBFBD><EFBFBD><EFBFBD>ն˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " + QByteArray(terminal_id ? terminal_id : "NULL") + "\n";
|
||||
outputDevice->write(msg); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> QIODevice
|
||||
}
|
||||
pthread_mutex_unlock(&mtx);
|
||||
pthread_mutex_unlock(&mtx); std::cout << "ledger()free lock !!!!!!!!!!!" << std::endl;
|
||||
}
|
||||
|
||||
//lnk20250210<31><30>ӡָ<D3A1><D6B8><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
void value_print(const char *variableName, QTcpSocket *clientSocket) {
|
||||
char buffer[256]; // <20><><EFBFBD>ڴ洢<DAB4><E6B4A2><EFBFBD><EFBFBD>ֵ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
pthread_mutex_lock(&mtx);
|
||||
pthread_mutex_lock(&mtx); std::cout << "value_print hold lock !!!!!!!!!!!" << std::endl;
|
||||
// <20><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>ֵ
|
||||
|
||||
if (strcmp(variableName, "frontindex") == 0) {
|
||||
@@ -11801,7 +11801,7 @@ void value_print(const char *variableName, QTcpSocket *clientSocket) {
|
||||
} else {
|
||||
clientSocket->write("Unknown variable name\n> ");
|
||||
}
|
||||
pthread_mutex_unlock(&mtx);
|
||||
pthread_mutex_unlock(&mtx); std::cout << "value_print free lock !!!!!!!!!!!" << std::endl;
|
||||
clientSocket->flush();
|
||||
}
|
||||
|
||||
@@ -13017,10 +13017,10 @@ void OnTimerThread::run()
|
||||
int telnet_count = 0;
|
||||
if (g_node_id == RECALL_HIS_DATA_BASE_NODE_ID) {
|
||||
//<2F>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>̨<EFBFBD>˼<EFBFBD><CBBC><EFBFBD>lnk20250114
|
||||
pthread_mutex_lock(&mtx);
|
||||
pthread_mutex_lock(&mtx); std::cout << "testping hold lock !!!!!!!!!!!" << std::endl;
|
||||
init_ping_telnet(ip_count, telnet_count);
|
||||
Cout_account_information();
|
||||
pthread_mutex_unlock(&mtx);//<2F><><EFBFBD><EFBFBD>
|
||||
pthread_mutex_unlock(&mtx); std::cout << "testping free lock !!!!!!!!!!!" << std::endl;
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>ģʽ
|
||||
@@ -13073,12 +13073,9 @@ void OnTimerThread::run()
|
||||
pgflag = 1;
|
||||
}*/
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
printf("check error10 !!!!!!!!!!!!!!\n");
|
||||
|
||||
//<2F><>־<EFBFBD><D6BE>¼
|
||||
if (mp_num_hour != localTime.tm_hour) {
|
||||
pthread_mutex_lock(&mtx);//lnk20250114
|
||||
pthread_mutex_lock(&mtx); std::cout << "ontime hold lock !!!!!!!!!!!" << std::endl;
|
||||
std::string mp_num_str = "";
|
||||
mp_num_str.append("connected device count:");
|
||||
mp_num_str.append(QString::number(FRONT_MP_NUM).toStdString());//<2F><>¼<EFBFBD><C2BC><EFBFBD>ӵļ<D3B5><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -13087,10 +13084,8 @@ void OnTimerThread::run()
|
||||
|
||||
add_comm_log(const_cast<char*>(mp_num_str.c_str()));
|
||||
mp_num_hour = localTime.tm_hour;
|
||||
pthread_mutex_unlock(&mtx);//<2F><><EFBFBD><EFBFBD>
|
||||
pthread_mutex_unlock(&mtx); std::cout << "ontime free lock !!!!!!!!!!!" << std::endl;
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
printf("check error11 !!!!!!!!!!!!!!\n");
|
||||
|
||||
}
|
||||
//<2F><>ʹ<EFBFBD>õĴ<C3B5><C4B4><EFBFBD>lnk20241206
|
||||
@@ -13852,9 +13847,9 @@ void WebhttpThread::run()
|
||||
|
||||
std::cout << "recall data cfg:" << data <<std::endl;
|
||||
|
||||
pthread_mutex_lock(&mtx);
|
||||
pthread_mutex_lock(&mtx); std::cout << "recall http hold lock !!!!!!!!!!!" << std::endl;
|
||||
ret = recall_json_handle(data);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
pthread_mutex_unlock(&mtx);
|
||||
pthread_mutex_unlock(&mtx); std::cout << "recall http free lock !!!!!!!!!!!" << std::endl;
|
||||
|
||||
|
||||
threadmsgweb(1);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ݺ<EFBFBD><DDBA><EFBFBD><EFBFBD><EFBFBD>http<74><70>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>Żᴦ<C5BB><E1B4A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ѭ<EFBFBD><D1AD>
|
||||
@@ -15075,7 +15070,7 @@ void rocketmq_test_300(int mpnum,int front_index) {
|
||||
ied_usr_t* ied_usr;
|
||||
|
||||
// ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 300 <20><><EFBFBD><EFBFBD>Ϣ
|
||||
for (int i = 0; total_messages != 0 && i < g_node->n_clients; ++i) {
|
||||
for (int i = 0; (total_messages != 0 && g_front_seg_index == 1 && g_node_id == 100) && i < g_node->n_clients; ++i) {
|
||||
|
||||
ied = (ied_t*)g_node->clients[i];
|
||||
if(ied != NULL){
|
||||
|
||||
@@ -1702,12 +1702,12 @@ int myMessageCallbackrtdata(CPushConsumer* consumer, CMessageExt* msg)
|
||||
}
|
||||
|
||||
//mq<6D><71><EFBFBD><EFBFBD>ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ѯ̨<D1AF><CCA8>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pthread_mutex_lock(&mtx);
|
||||
pthread_mutex_lock(&mtx); std::cout << "update ledger xml hold lock !!!!!!!!!!!" << std::endl;
|
||||
|
||||
int dev_index = find_dev_index_from_dev_id(devid);
|
||||
int mp_index = find_mp_index_from_mp_id(line);
|
||||
|
||||
pthread_mutex_unlock(&mtx);
|
||||
pthread_mutex_unlock(&mtx); std::cout << "update ledger xml free lock !!!!!!!!!!!" << std::endl;
|
||||
|
||||
if(dev_index == 0 || mp_index == 0){
|
||||
std::cerr << "dev index or mp index is 0" << std::endl;
|
||||
@@ -1827,9 +1827,9 @@ int myMessageCallbackrecall(CPushConsumer* consumer, CMessageExt* msg)
|
||||
std::cout << "extractDataJson:"<< result.c_str() <<std::endl;
|
||||
|
||||
if (!result.empty()) {
|
||||
pthread_mutex_lock(&mtx);
|
||||
pthread_mutex_lock(&mtx); std::cout << "recall mq hold lock !!!!!!!!!!!" << std::endl;
|
||||
recall_json_handle(result.c_str()); // ʹ<><CAB9> c_str() <20><>ȡ const char* <20><><EFBFBD><EFBFBD>
|
||||
pthread_mutex_unlock(&mtx);
|
||||
pthread_mutex_unlock(&mtx); std::cout << "recall mq free lock !!!!!!!!!!!" << std::endl;
|
||||
}
|
||||
else{
|
||||
std::cerr << "recall data is NULL." << std::endl;
|
||||
|
||||
10
mms/main.c
10
mms/main.c
@@ -326,21 +326,15 @@ int main(int argc, const char **argv)
|
||||
exit(-1039);
|
||||
}
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
printf("check error12 !!!!!!!!!!!!!!\n");
|
||||
//lnk20241211 <20><><EFBFBD>Ӳ<EFBFBD><D3B2>Կ<EFBFBD><D4BF><EFBFBD>
|
||||
pthread_mutex_lock(&mtx);//<2F><><EFBFBD>̶߳<DFB3>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD>ȡ̨<C8A1>˼<EFBFBD><CBBC><EFBFBD>
|
||||
pthread_mutex_lock(&mtx); printf("main thread hold lock !!!!!!!!!!!");
|
||||
if (!G_TEST_FLAG && g_front_num_count >= 30 && g_onlyIP[0] == 0 && g_node->n_clients>10) {//30<33><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD>˴<EFBFBD><CBB4><EFBFBD>ʮ<EFBFBD><CAAE><EFBFBD>ն<EFBFBD>
|
||||
MVL_LOG_ACSE0("MYLOG: g_front_num_count>=20, so exit to restart ");
|
||||
|
||||
pthread_mutex_unlock(&mtx);
|
||||
|
||||
apr_sleep(apr_time_from_sec(10));
|
||||
exit(-1039);
|
||||
}
|
||||
pthread_mutex_unlock(&mtx);
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
printf("check error13 !!!!!!!!!!!!!!\n");
|
||||
pthread_mutex_unlock(&mtx); printf("main thread free lock !!!!!!!!!!!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -824,9 +824,9 @@ void check_3s_config()
|
||||
last_check_3s_config_time = now; //<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
|
||||
while (APR_SUCCESS==parse_3s_xml(&trigger_3s_xml)){ //<2F><><EFBFBD><EFBFBD>3<EFBFBD><33><EFBFBD>ļ<EFBFBD>
|
||||
//<2F><><EFBFBD><EFBFBD>ʵʱ<CAB5><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>lnk20250114
|
||||
pthread_mutex_lock(&mtx);
|
||||
//pthread_mutex_lock(&mtx); printf("3s hold lock !!!!!!!!!!!");
|
||||
process_3s_config(&trigger_3s_xml); //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pthread_mutex_unlock(&mtx);
|
||||
pthread_mutex_unlock(&mtx); printf("3s free lock !!!!!!!!!!!");
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1270,9 +1270,9 @@ void check_ledger_update()//lnk20250113
|
||||
print_trigger_update_xml(trigger_ledger_update_xml);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>̨<EFBFBD>˸<EFBFBD><CBB8>¼<EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>lnk20250114
|
||||
pthread_mutex_lock(&mtx);
|
||||
//pthread_mutex_lock(&mtx); printf("ledgerupdate hold lock !!!!!!!!!!!");
|
||||
process_ledger_update(trigger_ledger_update_xml); //̨<>˸<EFBFBD><CBB8><EFBFBD>
|
||||
pthread_mutex_unlock(&mtx);
|
||||
//pthread_mutex_unlock(&mtx); printf("ledgerupdate free lock !!!!!!!!!!!");
|
||||
|
||||
}
|
||||
|
||||
@@ -1571,8 +1571,6 @@ void CheckNextNotConnectedChannel()
|
||||
//}
|
||||
}
|
||||
|
||||
printf("check error94 !!!!!!!!!!!!!!\n");
|
||||
|
||||
printf("check error %s !!!!!!!!!!!!!!\n",((ied_usr_t*)chnl_usr->chnl->ied->usr_ext)->terminal_id);
|
||||
|
||||
if(chnl_usr->m_state == CHANNEL_CONNECTING)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -1761,7 +1759,7 @@ void CheckNextNotConnectedChannel()
|
||||
echo_warn2( "CHANNEL_DISCONNECTING waiting ... %s,NetInfo= %x ",chnl_usr->ip_str,chnl_usr->net_info);
|
||||
|
||||
if ( (sGetMsTime() - chnl_usr->m_StartDisconnectingTime) > 30*1000 ) // //wait 30 secs ?????
|
||||
{ printf("check error71 !!!!!!!!!!!!!!\n");
|
||||
{
|
||||
//cout<<pChannel->GetIP()<<"CHANNEL_DISCONNECTING reqCtrl->done == SD_false but time over 180 secs, close channel !!!"<<endl;
|
||||
echo_warn2( "CHANNEL_DISCONNECTING reqCtrl->doneδ<65><CEB4><EFBFBD><EFBFBD>,but time over 180 secs, close channel IP %s,NetInfo= %x ",chnl_usr->ip_str,chnl_usr->net_info);
|
||||
mvl_free_req_ctrl(chnl_usr->m_reqCtrl);
|
||||
|
||||
@@ -2153,14 +2153,11 @@ ST_RET u_iec_rpt_ind(MVL_COMM_EVENT* event)
|
||||
/* Perform 3rd decode (everything). */
|
||||
mvl_info_data_to_local(event, va_num, info_va);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
printf("check error14 !!!!!!!!!!!!!!\n");
|
||||
//<2F><><EFBFBD>洦<EFBFBD><E6B4A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250114
|
||||
pthread_mutex_lock(&mtx);
|
||||
//pthread_mutex_lock(&mtx); printf("rpt hold lock !!!!!!!!!!!");
|
||||
u_iec_rpt_ind_data(info_va, OptFldsData, InclusionData, rcb_info, va_total, event->net_info);
|
||||
pthread_mutex_unlock(&mtx);
|
||||
//<2F><><EFBFBD><EFBFBD>
|
||||
printf("check error15 !!!!!!!!!!!!!!\n");
|
||||
//pthread_mutex_unlock(&mtx); printf("rpt free lock !!!!!!!!!!!");
|
||||
|
||||
}
|
||||
|
||||
CLEANUP:
|
||||
|
||||
@@ -401,46 +401,29 @@ static void* APR_THREAD_FUNC rtdb_worker(apr_thread_t* thd, void* data)
|
||||
/* Maintenance the clients request */
|
||||
while (1) {
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>rocketmq<6D><71>Ϣ lnk10-10*/
|
||||
//producer_send0();
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error4 !!!!!!!!!!!!!!\n");
|
||||
pthread_mutex_lock(&mtx); printf("work hold lock !!!!!!!!!!!");
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error4 !!!!!!!!!!!!!!\n");
|
||||
|
||||
doCommService();//<2F><><EFBFBD><EFBFBD>61850<35><30>Ϣ
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error5 !!!!!!!!!!!!!!\n");
|
||||
|
||||
check_3s_config();//3<><33><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD>̶<EFBFBD>ȡ3<C8A1>봥<EFBFBD><EBB4A5>
|
||||
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error6 !!!!!!!!!!!!!!\n");
|
||||
|
||||
pthread_mutex_lock(&mtx);
|
||||
//pthread_mutex_lock(&mtx); printf("check connect hold lock !!!!!!!!!!!");
|
||||
CheckNextNotConnectedChannel();//<2F><><EFBFBD>г<EFBFBD><D0B3><EFBFBD><EFBFBD>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>״̬
|
||||
pthread_mutex_unlock(&mtx);
|
||||
//pthread_mutex_unlock(&mtx); printf("check connect free lock !!!!!!!!!!!");
|
||||
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error7 !!!!!!!!!!!!!!\n");
|
||||
|
||||
pthread_mutex_lock(&mtx);
|
||||
//pthread_mutex_lock(&mtx); printf("check prt hold lock !!!!!!!!!!!");
|
||||
CheckAllConnectedChannel();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>桢<EFBFBD><E6A1A2>־<EFBFBD><D6BE><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
pthread_mutex_unlock(&mtx);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error8 !!!!!!!!!!!!!!\n");
|
||||
//pthread_mutex_unlock(&mtx); printf("check prt free lock !!!!!!!!!!!");
|
||||
|
||||
//check_recall_config();//<2F><><EFBFBD>ٽ<EFBFBD><D9BD>̶<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
create_recall_xml();//<2F><><EFBFBD>ɴ<EFBFBD><C9B4><EFBFBD><EFBFBD><EFBFBD>xml<6D>ļ<EFBFBD>
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error9 !!!!!!!!!!!!!!\n");
|
||||
|
||||
check_ledger_update();//lnk20250113<31><33>ȡ̨<C8A1>˸<EFBFBD><CBB8>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD>˸<EFBFBD><CBB8><EFBFBD>
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error3 !!!!!!!!!!!!!!\n");
|
||||
pthread_mutex_unlock(&mtx); printf("work free lock !!!!!!!!!!!");
|
||||
|
||||
//Check_Recall_Config();
|
||||
/*if ((g_protect_file) && (g_pt61850app->initNum>=MIN_INIT_NUM) ) {
|
||||
@@ -449,14 +432,8 @@ static void* APR_THREAD_FUNC rtdb_worker(apr_thread_t* thd, void* data)
|
||||
//clear_old_comtrade_files();
|
||||
check_disk_quota();//<2F>жϴ<D0B6><CFB4>̿ռ<CCBF>
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error1 !!!!!!!!!!!!!!\n");
|
||||
|
||||
apr_pool_clear(g_pt61850app->tmp_pool);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
printf("check error2 !!!!!!!!!!!!!!\n");
|
||||
|
||||
g_dead_lock_counter = 0;
|
||||
g_thread_blocked_times = 0;//<2F><><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user