remove dg102 codes

This commit is contained in:
zhangsheng 2024-11-14 20:04:24 +08:00
parent fecc3ee4b1
commit 4a7273cf43
2 changed files with 1 additions and 50 deletions

View File

@ -78,11 +78,10 @@ int main(int argc, char *argv[]) {
boost::thread uartWaveReadTh(UartStartWave); boost::thread uartWaveReadTh(UartStartWave);
uartWaveReadTh.detach(); uartWaveReadTh.detach();
#ifdef G2UL_GATEWAY
//启动 RUN LED //启动 RUN LED
boost::thread startRunLED(RunLED); boost::thread startRunLED(RunLED);
startRunLED.detach(); startRunLED.detach();
#endif
#ifdef NR5G_MODULE #ifdef NR5G_MODULE
print_info("NR5G_MODULE \n"); print_info("NR5G_MODULE \n");
@ -141,11 +140,9 @@ int main(int argc, char *argv[]) {
//int fd = OpenWatchDog(); //int fd = OpenWatchDog();
int count = 0; int count = 0;
while (GlobalConfig::QuitFlag_G) { while (GlobalConfig::QuitFlag_G) {
#ifdef G2UL_GATEWAY
gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 1); gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 1);
usleep(20000); usleep(20000);
gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 0); gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 0);
#endif
//WriteWatchDog(fd); //WriteWatchDog(fd);
sleep(20); sleep(20);
if (GlobalConfig::threadStatus == 0) { if (GlobalConfig::threadStatus == 0) {

View File

@ -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()); 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()); zlog_info(zct, "write data to filename %s", strFileName.c_str());
std::vector<float>().swap(vecData); std::vector<float>().swap(vecData);
sleep(1); sleep(1);