debug recall
This commit is contained in:
@@ -203,6 +203,7 @@ const int MAX_CPUNO = 10;
|
||||
|
||||
//lnk20250121<32>ն<EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
int IED_COUNT = 300; //Ĭ<><C4AC>300
|
||||
|
||||
extern int INITFLAG;
|
||||
|
||||
//WW 2-23-08-20 add start
|
||||
@@ -217,9 +218,6 @@ std::string g_strOTLConnect = "postgres/bmdev@123@pgsql"; //OTL
|
||||
//lnk2024-8-14<31><34><EFBFBD>ӽ<EFBFBD><D3BD>ͽ<EFBFBD><CDBD>߱<EFBFBD>־,0<><30><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><DABD>ν<EFBFBD><CEBD>ߣ<EFBFBD>1<EFBFBD><31><EFBFBD>ڽ<EFBFBD><DABD>ν<EFBFBD><CEBD><EFBFBD>
|
||||
int isdelta_flag = 0;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ն<EFBFBD><D5B6><EFBFBD><EFBFBD><EFBFBD>
|
||||
bool g_stopTelnetTest = false;
|
||||
|
||||
//////CZY 2023-09-06 config
|
||||
//<2F><>ǰ<EFBFBD><C7B0>flag:1Ϊ<31><CEAA><EFBFBD><EFBFBD>,0Ϊ<30>ر<EFBFBD>
|
||||
int MULTIPLE_NODE_FLAG = 1;
|
||||
@@ -1180,17 +1178,22 @@ void pingPrint(QTcpSocket* clientSocket, const std::string &msg) {
|
||||
clientSocket->flush();
|
||||
}
|
||||
}
|
||||
int init_ping_telnet(QTcpSocket* clientSocket, int& ip_count, int& telnet_count) {
|
||||
int Worker::init_ping_telnet(QTcpSocket* clientSocket, int& ip_count, int& telnet_count) {
|
||||
pingPrint(clientSocket, "start test ping telnet");
|
||||
ied_t* ied = NULL;
|
||||
int iedno;
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>豸
|
||||
for (iedno = 0; iedno < g_node->n_clients; iedno++) {
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ
|
||||
if (g_stopTelnetTest) {
|
||||
pingPrint(clientSocket, "Telnet test stopped by user.");
|
||||
break;
|
||||
for (iedno = 0; iedno < g_node->n_clients && !g_stopTelnetTest; iedno++) {
|
||||
// **1. <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ``` <20>˳<EFBFBD>**
|
||||
if (clientSocket->waitForReadyRead(100)) { // ? <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
QByteArray input = clientSocket->readAll().trimmed();
|
||||
if (input == "`") { // ? <20>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> ```<60><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>־ģʽ
|
||||
std::cout << "Received '`' from shell socket! Exiting viewlog...\n";
|
||||
g_stopTelnetTest = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ied = g_node->clients[iedno];
|
||||
if (ied) {
|
||||
if (g_onlyIP[0] != 0 && (strcmp(g_onlyIP, ied->channel[0].addr_str) != 0)) {
|
||||
@@ -4981,7 +4984,7 @@ void process_recall_config(recall_xml_t* recall_xml)
|
||||
|
||||
//lnk20241030<33><30><EFBFBD>䲹<EFBFBD><E4B2B9><EFBFBD><EFBFBD>̬<EFBFBD><CCAC>̬<EFBFBD><CCAC>־<EFBFBD><D6BE>ÿ<EFBFBD><C3BF><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>кܶ<D0BA><DCB6><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>¼
|
||||
LD_info->autorecall[j]->need_steady = recall[j].need_steady;
|
||||
LD_info->autorecall[j]->need_steady = recall[j].need_voltage;
|
||||
LD_info->autorecall[j]->need_voltage = recall[j].need_voltage;
|
||||
|
||||
}
|
||||
LD_info->autorecallflag = 0;
|
||||
@@ -11740,6 +11743,16 @@ void printLedgerinshell(const ied_usr_t& ied_usr, QIODevice* outputDevice) {
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- rptcount: " + QByteArray::number(ied_usr.LD_info[i].rptcount) + "\n");
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- logcount: " + QByteArray::number(ied_usr.LD_info[i].logcount) + "\n");
|
||||
|
||||
//recall
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- autorecallflag: " + QByteArray::number(ied_usr.LD_info[i].autorecallflag) + "\n");
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- autorecallcount: " + QByteArray::number(ied_usr.LD_info[i].autorecallcount) + "\n");
|
||||
for (int j = 0; j < ied_usr.LD_info[i].autorecallcount && ied_usr.LD_info->autorecall[j] != NULL; j++){
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- autorecall_t[" + QByteArray::number(j) + "]:\n");
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- start_time: " + QByteArray::number(ied_usr.LD_info->autorecall[j]->start) + "\n");
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- end_time: " + QByteArray::number(ied_usr.LD_info->autorecall[j]->end) + "\n");
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- need_steady: " + QByteArray::number(ied_usr.LD_info->autorecall[j]->need_steady) + "\n");
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- need_voltage: " + QByteArray::number(ied_usr.LD_info->autorecall[j]->need_voltage) + "\n");
|
||||
}
|
||||
// rpt
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- rptRecvFlag: " + QByteArray::number(ied_usr.LD_info[i].rptRecvFlag) + "\n");
|
||||
outputDevice->write("\r\x1B[K");outputDevice->write(" |-- rptRecvCheckFlag: " + QByteArray::number(ied_usr.LD_info[i].rptRecvCheckFlag) + "\n");
|
||||
@@ -15645,13 +15658,12 @@ void echo_msg_debugexy(const char *file_name, int line_no, const char *fmt, ...)
|
||||
}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void telnetetst(QTcpSocket* clientSocket) {
|
||||
void Worker::telnetetst(QTcpSocket* clientSocket) {
|
||||
int ip_count = 0;
|
||||
int telnet_count = 0;
|
||||
g_stopTelnetTest = false;
|
||||
//<2F>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>̨<EFBFBD>˼<EFBFBD><CBBC><EFBFBD>lnk20250114
|
||||
pthread_mutex_lock(&mtx); std::cout << "testping hold lock !!!!!!!!!!!" << std::endl;
|
||||
init_ping_telnet(clientSocket,ip_count, telnet_count);
|
||||
Worker::init_ping_telnet(clientSocket,ip_count, telnet_count);
|
||||
Cout_account_information();
|
||||
pthread_mutex_unlock(&mtx); std::cout << "testping free lock !!!!!!!!!!!" << std::endl;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ extern int G_TEST_NUM;
|
||||
extern void ledger(const char* terminal_id = NULL,QIODevice* outputDevice = NULL);
|
||||
extern void value_print(const char *variableName, QTcpSocket *clientSocket);
|
||||
extern int TEST_PORT;
|
||||
extern void telnetetst(QTcpSocket* clientSocket);
|
||||
|
||||
extern void redirectErrorOutput(bool enable);
|
||||
extern void redirectWarnOutput(bool enable);
|
||||
@@ -154,8 +153,8 @@ public:
|
||||
TEST_NUM(G_TEST_NUM),
|
||||
timer(NULL),
|
||||
historyIndex(-1),
|
||||
stopViewLog(false),
|
||||
g_stopTelnetTest(false),
|
||||
stopViewLog(true),
|
||||
g_stopTelnetTest(true),
|
||||
activeClient(NULL)
|
||||
{
|
||||
}
|
||||
@@ -166,6 +165,8 @@ public:
|
||||
}
|
||||
|
||||
void handleViewLogCommand(const QString& command, QTcpSocket* clientSocket);
|
||||
int init_ping_telnet(QTcpSocket* clientSocket, int& ip_count, int& telnet_count);
|
||||
void telnetetst(QTcpSocket* clientSocket);
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -479,6 +480,7 @@ private:
|
||||
}
|
||||
}
|
||||
else if (cmd.startsWith("telnettest")) {
|
||||
g_stopTelnetTest = false;
|
||||
telnetetst(clientSocket);
|
||||
clientSocket->write("\r\x1B[K");
|
||||
clientSocket->write("Executed telnettest warning!!! it woont stop until finish!!!\r\n");
|
||||
|
||||
@@ -111,7 +111,6 @@ int parse_device_cfg_json();
|
||||
int parse_device_cfg_pg();
|
||||
int parse_line_cfg_pg();
|
||||
void init_config();
|
||||
int init_ping_telnet();
|
||||
int GetServerIndexFromDB();
|
||||
|
||||
int parse_device_cfg();
|
||||
|
||||
@@ -213,30 +213,71 @@ static ST_RET process_jou_entry(loginfo_t *loginfo,apr_time_t t,
|
||||
|
||||
length_FCDA = strlen(mms_ref);
|
||||
if (('$' == mms_ref[length_FCDA - 2]) && ('t' == mms_ref[length_FCDA - 1])) {
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("readtime = 1");
|
||||
readtime = 1;
|
||||
t = convert_btime6_to_apr_time(&(mms_dec_data.data_item[ii].u.data_bTime6));
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ṹ<EFBFBD>屣<EFBFBD><E5B1A3>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Ϣ
|
||||
apr_time_exp_t xt;
|
||||
|
||||
// ʹ<>ñ<EFBFBD><C3B1><EFBFBD>ʱ<EFBFBD><CAB1>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> apr_time_exp_gmt(&xt, t) <20>õ<EFBFBD> GMT ʱ<>䣩
|
||||
if (apr_time_exp_lt(&xt, t) == APR_SUCCESS) {
|
||||
// tm_year <20><>ʾ<EFBFBD><CABE> 1900 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD> 1900<30><30>tm_mon <20><>ΧΪ 0~11<31><31><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA> 1
|
||||
printf("Converted time: %04d-%02d-%02d %02d:%02d:%02d.%06d\n",
|
||||
xt.tm_year + 1900,
|
||||
xt.tm_mon + 1,
|
||||
xt.tm_mday,
|
||||
xt.tm_hour,
|
||||
xt.tm_min,
|
||||
xt.tm_sec,
|
||||
xt.tm_usec);
|
||||
} else {
|
||||
printf("Failed to convert apr_time_t\n");
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
if (('$' == mms_ref[length_FCDA - 2]) && ('q' == mms_ref[length_FCDA - 1])) {
|
||||
if (log_data_type == STEADY_DATA) {
|
||||
readquailty = 1;
|
||||
char* q = mms_dec_data.data_item[ii].u.data_str;
|
||||
if (q[0] == '0' && q[1] == '0')
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("q[0] = %c ,q[1] = %c !!!!!",q[0],q[1]);
|
||||
|
||||
if (q[0] == '0' && q[1] == '0'){
|
||||
quality = 0;
|
||||
else
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("quality = 0");
|
||||
|
||||
}else{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("quality = 1");
|
||||
quality = 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (readtime == 1 && readquailty == 1) {
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("readtime == 1 && readquailty = 1");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (readtime == 1 && readquailty == 1) {
|
||||
if (quality == 1) {
|
||||
if (quality == 0) {//<2F><><EFBFBD>ԣ<EFBFBD>Ҫ<EFBFBD>Ļ<EFBFBD>1
|
||||
timeflag = TRUE;
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("readtime == 1 && readquailty = 1 && quality == 1 continue");
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("readtime == 1 && readquailty = 1 && quality == 0 log");
|
||||
|
||||
timeflag = FALSE;
|
||||
if (process_jou_entry_t == 0) {
|
||||
process_jou_entry_t = t;
|
||||
@@ -322,14 +363,26 @@ static ST_RET process_jou_entry(loginfo_t *loginfo,apr_time_t t,
|
||||
//set_db_value(LOG_IDX,mms_ref,v,FALSE);
|
||||
length_FCDA = strlen( mms_ref );
|
||||
if ( ('$'==mms_ref[length_FCDA-2]) && ('q'==mms_ref[length_FCDA-1]) ) {
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("going q");
|
||||
|
||||
if(not_set_log_q_this && ( log_data_type == STEADY_DATA )) {
|
||||
int quality = 0;
|
||||
char* q = mms_dec_data.data_item[ii].u.data_str;
|
||||
if (q[0]=='0'&& q[1]=='0')
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("q[0] = %c ,q[1] = %c !!!!!",q[0],q[1]);
|
||||
|
||||
if (q[0]=='0'&& q[1]=='0'){
|
||||
printf("quality = 0");
|
||||
quality = 0;
|
||||
else
|
||||
}else{
|
||||
printf("quality = 1");
|
||||
quality = 1;
|
||||
if (quality == 1) {
|
||||
}
|
||||
if (quality == 0) {//<2F><><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD>Ҫ<EFBFBD>Ļ<EFBFBD>1
|
||||
printf("quality = 1 continue");
|
||||
continue;
|
||||
}
|
||||
//set_log_QualityFlag(quality);
|
||||
@@ -346,6 +399,10 @@ static ST_RET process_jou_entry(loginfo_t *loginfo,apr_time_t t,
|
||||
}
|
||||
}
|
||||
else if ( ('$'==mms_ref[length_FCDA-2]) && ('t'==mms_ref[length_FCDA-1]) ) {
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("going t");
|
||||
|
||||
if (not_set_log_t_this) {
|
||||
apr_time_t t = convert_btime6_to_apr_time(&(mms_dec_data.data_item[ii].u.data_bTime6));
|
||||
if ( log_data_type == QVVR_DATA ) {
|
||||
@@ -373,6 +430,9 @@ static ST_RET process_jou_entry(loginfo_t *loginfo,apr_time_t t,
|
||||
}
|
||||
}
|
||||
else {
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>lnk20250307
|
||||
printf("going v");
|
||||
|
||||
if ( log_data_type == QVVR_DATA ){
|
||||
processQVVR_data(loginfo->LD_info,mms_ref,v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user