ledgerupdate testing fix segfault in add ledger
This commit is contained in:
@@ -2915,7 +2915,7 @@ void Set_xml_databaseinfo(char* MODEL_ID, char* TMNL_TYPE, char* FILE_PATH, char
|
||||
|
||||
QDateTime time(QDate(year, month, day), QTime(hour, minute, second));
|
||||
if (xmlinfo_list[type]->xmlbase.datetime == time) { //<2F>ն<EFBFBD><D5B6>ͺŸ<CDBA><C5B8>±<EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͺŴ<CDBA><C5B4><EFBFBD><F3A3ACB5><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD>õ<EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD><DFB8><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD>⡣<EFBFBD><E2A1A3><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>ͺź<CDBA>ӳ<EFBFBD><D3B3><EFBFBD>ļ<EFBFBD>ʱҪע<D2AA><D7A2>
|
||||
xmlinfo_list[type]->updataflag = false;
|
||||
xmlinfo_list[type]->updataflag = false; //ʱ<><CAB1>ֵһ<D6B5><D2BB>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>û<EFBFBD>и<EFBFBD><D0B8>£<EFBFBD><C2A3><EFBFBD>ǰҵ<C7B0><D2B5><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>ζ<EFBFBD><CEB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
else {
|
||||
xmlinfo_list[type]->updataflag = true;
|
||||
@@ -2933,7 +2933,6 @@ void Set_xml_databaseinfo(char* MODEL_ID, char* TMNL_TYPE, char* FILE_PATH, char
|
||||
xmlinfo_list[type]->xmlbase.FILE_PATH = filepath;
|
||||
xmlinfo_list[type]->xmlbase.FILE_NAME = name;
|
||||
|
||||
|
||||
QDateTime time(QDate(year, month, day), QTime(hour, minute, second));
|
||||
xmlinfo_list[type]->xmlbase.datetime = time;
|
||||
|
||||
@@ -3582,16 +3581,47 @@ void comflag_test()
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////lnk2024-10-21////////////////////////////////////////////////////////
|
||||
//4-<2D><><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>ļ<EFBFBD>//////////////////////////////
|
||||
void clearXmlConfigAndTopicList(Xmldata* data) {
|
||||
// <20><><EFBFBD><EFBFBD> XmlConfig
|
||||
data->xmlcfg = XmlConfig(); // ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD> xmlcfg
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> topicList
|
||||
list<CTopic*>::iterator it;
|
||||
for (it = data->topicList.begin(); it != data->topicList.end(); ++it) {
|
||||
delete *it; // <20>ͷ<EFBFBD><CDB7>ڴ<EFBFBD>
|
||||
}
|
||||
data->topicList.clear(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
//4-<2D><><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD>ļ<EFBFBD>//////////////////////////////
|
||||
void Set_xml_nodeinfo_one(char* dev_type)
|
||||
{
|
||||
bool ret = false;
|
||||
if(xmlinfo_list[QString::fromUtf8(dev_type)] != NULL){
|
||||
ret = ParseXMLConfig2(&(xmlinfo_list[QString::fromUtf8(dev_type)]->xmlcfg), &(xmlinfo_list[QString::fromUtf8(dev_type)]->topicList), xmlinfo_list[QString::fromUtf8(dev_type)]->xmlbase.MODEL_ID);
|
||||
if(!ret)
|
||||
{
|
||||
std::cout << "!!!! this ledger xml config fail!!!!" << std::endl;
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD>˲<EFBFBD><CBB2>dz<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ٽ<EFBFBD><D9BD><EFBFBD>һ<EFBFBD><D2BB>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/*
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧxml<6D>ļ<EFBFBD>ʱ<EFBFBD><CAB1>Ĭ<EFBFBD>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (!inited) //<2F><>ʼ<EFBFBD><CABC> JiangSu_Config.xml
|
||||
{
|
||||
QString path;
|
||||
path.append("not define");
|
||||
ParseXMLConfig2(&xmlcfg, &topicList, path); //<2F><><EFBFBD><EFBFBD> ParseXMLConfig() <20><><EFBFBD><EFBFBD>JiangSu_Config.xml<6D><6C><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
inited = true;
|
||||
}
|
||||
*/
|
||||
|
||||
if(xmlinfo_list[QString::fromUtf8(dev_type)] != NULL){ //ԭ<><D4AD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵Ľڵ<C4BD>
|
||||
if(xmlinfo_list[QString::fromUtf8(dev_type)]->updataflag == true){ //<2F><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>xmlcfg<66><67>topicListɾ<74><C9BE>
|
||||
clearXmlConfigAndTopicList(xmlinfo_list[QString::fromUtf8(dev_type)]);
|
||||
|
||||
ret = ParseXMLConfig2(&(xmlinfo_list[QString::fromUtf8(dev_type)]->xmlcfg), &(xmlinfo_list[QString::fromUtf8(dev_type)]->topicList), xmlinfo_list[QString::fromUtf8(dev_type)]->xmlbase.MODEL_ID);
|
||||
if(!ret)
|
||||
{
|
||||
std::cout << "!!!! this ledger xml config fail!!!!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
std::cout << "xmlinfo_list not contain this devtype" << std::endl;
|
||||
|
||||
@@ -295,8 +295,8 @@ void my_rocketmq_send(Ckafka_data_t& data)
|
||||
static std::string cfg_Evt_tp;
|
||||
static std::string cfg_Alm_tp;
|
||||
static std::string cfg_Rt_tp;
|
||||
static bool inited = false;
|
||||
if (!inited) {
|
||||
static bool init = false;
|
||||
if (!init) {
|
||||
|
||||
cfg_His_tp = TOPIC_STAT;
|
||||
cfg_PLT_tp = TOPIC_PLT;
|
||||
@@ -305,7 +305,7 @@ void my_rocketmq_send(Ckafka_data_t& data)
|
||||
cfg_Alm_tp = TOPIC_ALARM;
|
||||
cfg_Rt_tp = TOPIC_RTDATA;
|
||||
|
||||
inited = true;
|
||||
init = true;
|
||||
}
|
||||
|
||||
std::string key = data.mp_id.toStdString();
|
||||
@@ -363,8 +363,8 @@ void my_kafka_send(Ckafka_data_t& data)
|
||||
static std::string cfg_Evt_tp;
|
||||
static std::string cfg_Alm_tp;
|
||||
static std::string cfg_Sng_tp;
|
||||
static bool inited = false;
|
||||
if (!inited) {
|
||||
static bool init = false;
|
||||
if (!init) {
|
||||
|
||||
cfg_His_tp = TOPIC_STAT;
|
||||
cfg_PLT_tp = TOPIC_PLT;
|
||||
@@ -393,7 +393,7 @@ void my_kafka_send(Ckafka_data_t& data)
|
||||
else
|
||||
printf("kafka producer init Failed(%s)\n", brokerlist.c_str());
|
||||
#endif
|
||||
inited = true;
|
||||
init = true;
|
||||
}
|
||||
|
||||
char tmp_str[256];
|
||||
@@ -472,8 +472,8 @@ void my_datahub_send(Ckafka_data_t& data)
|
||||
static std::string cfg_PST_tp;
|
||||
static std::string cfg_Evt_tp;
|
||||
static std::string cfg_Alm_tp;
|
||||
static bool inited = false;
|
||||
if (!inited) {
|
||||
static bool init = false;
|
||||
if (!init) {
|
||||
//QString MyKafkaIniFilename = QString("../etc/") + QString("mykafka.ini"); //+QString::fromAscii(subdir)
|
||||
//QSettings settings(MyKafkaIniFilename, QSettings::IniFormat);
|
||||
|
||||
@@ -496,7 +496,7 @@ void my_datahub_send(Ckafka_data_t& data)
|
||||
cfg_Evt_tp = TOPIC_EVENT;
|
||||
cfg_Alm_tp = TOPIC_ALARM;
|
||||
|
||||
inited = true;
|
||||
init = true;
|
||||
}
|
||||
|
||||
std::string key = data.mp_id.toStdString();
|
||||
|
||||
@@ -240,11 +240,11 @@ private slots:
|
||||
helpText += "ud - Execute rocketmq_test_ud\n";
|
||||
helpText += "set - Execute rocketmq_test_set\n";
|
||||
helpText += "ledger <id> - Execute ledger with optional terminal_id\n";
|
||||
helpText += "value <valuename> - Execute value print with valuename : iedcount frontfun frontindex\n";
|
||||
helpText += "value <valuename> - Execute value print with valuename : iedcount frontfun frontindex remtable\n";
|
||||
helpText += "exit - Exit the shell\n";
|
||||
helpText += "help - Show this help message\n";
|
||||
clientSocket->write(helpText.toUtf8());
|
||||
clientSocket->flush();
|
||||
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD> TEST_NUM
|
||||
else if (command.startsWith("TEST_NUM=")) {
|
||||
|
||||
Reference in New Issue
Block a user