diff --git a/main.cpp b/main.cpp index a24f799..f127c0a 100644 --- a/main.cpp +++ b/main.cpp @@ -78,11 +78,10 @@ int main(int argc, char *argv[]) { boost::thread uartWaveReadTh(UartStartWave); uartWaveReadTh.detach(); -#ifdef G2UL_GATEWAY //启动 RUN LED boost::thread startRunLED(RunLED); startRunLED.detach(); -#endif + #ifdef NR5G_MODULE print_info("NR5G_MODULE \n"); @@ -141,11 +140,9 @@ int main(int argc, char *argv[]) { //int fd = OpenWatchDog(); int count = 0; while (GlobalConfig::QuitFlag_G) { -#ifdef G2UL_GATEWAY gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 1); usleep(20000); gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 0); -#endif //WriteWatchDog(fd); sleep(20); if (GlobalConfig::threadStatus == 0) { diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index fdce1a1..4dc2089 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -999,52 +999,6 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan zlog_warn(zct, "send data , filename %s,size = %d\n", strFileName.c_str(), vecData.size()); } -#ifdef G2UL_GATEWAY //存储6条波形数据 - char whereCon[1024] = {0x00}; - char updateSql[1024] = {0x00}; - char tmpWhere[128] = {0x00}; - sprintf(tmpWhere, "channelID = '%s' and save = 1 ", strChannelID.c_str()); - int count = sqlite_db_ctrl::instance().GetTableRows("t_data_waveSend", tmpWhere); - zlog_info(zct, "save channlID %s dat count = %d\n", strChannelID.c_str(), count); - if (count <= 5) { - sprintf(whereCon, "channelID='%s' and timeStamp = '%s' ", strChannelID.c_str(), nowTimetamp.c_str()); - sprintf(updateSql, "save = 1 "); - sqlite_db_ctrl::instance().UpdateTableData("t_data_waveSend", updateSql, whereCon); - std::string strFileName_save = strFileName + "_" + nowTimetamp + "_save"; - char tmpCmd[128] = {0x00}; - sprintf(tmpCmd, "cp %s %s", strFileName.c_str(), strFileName_save.c_str()); - system(tmpCmd); - } else { - memset(tmpWhere, 0x00, sizeof(tmpWhere)); - memset(updateSql, 0x00, sizeof(updateSql)); - sprintf(tmpWhere, " save = 1 and channelID='%s' ORDER BY timeStamp ASC LIMIT 0,1", strChannelID.c_str()); - vec_t vecRet = sqlite_db_ctrl::instance().GetDataSingleLine("t_data_waveSend", "*", tmpWhere); - memset(tmpWhere, 0x00, sizeof(tmpWhere)); - sprintf(tmpWhere, " save = 1 and timeStamp = '%s' and channelID = '%s' ", vecRet[2].c_str(), vecRet[0].c_str()); - sprintf(updateSql, "save = 0 "); - sqlite_db_ctrl::instance().UpdateTableData("t_data_waveSend", updateSql, tmpWhere); - memset(tmpWhere, 0x00, sizeof(tmpWhere)); - memset(updateSql, 0x00, sizeof(updateSql)); - sprintf(whereCon, "channelID='%s' and timeStamp = '%s' ", strChannelID.c_str(), nowTimetamp.c_str()); - sprintf(updateSql, "save = 1"); - sqlite_db_ctrl::instance().UpdateTableData("t_data_waveSend", updateSql, whereCon); - - std::string strFileName_save = strFileName + "_" + nowTimetamp + "_save"; - char tmpCmd[128] = {0x00}; - sprintf(tmpCmd, "cp %s %s", strFileName.c_str(), strFileName_save.c_str()); - system(tmpCmd); - - memset(tmpWhere, 0x00, sizeof(tmpWhere)); - sprintf(tmpWhere, " channelID = '%s' and save = 1 ", strChannelID.c_str()); - sqlite_db_ctrl::instance().GetTableRows("t_data_waveSend", tmpWhere); - - memset(tmpCmd, 0x00, sizeof(tmpCmd)); - sprintf(tmpCmd, "rm %s ", (vecRet[1] + "_save").c_str()); - system(tmpCmd); - zlog_info(zct, "rm dat file %s ", tmpCmd); - } - -#endif zlog_info(zct, "write data to filename %s", strFileName.c_str()); std::vector().swap(vecData); sleep(1);