#include "mainwindow.h" #include "qmessagebox.h" #include #include "Process.h" #include "src/pathcreator.h" void InitGlog() { time_t tt = time(0);//时间cuo struct tm* t = localtime(&tt); char strYear[255]={0}; char strMonth[255]={0}; char strDay[255]={0}; sprintf(strYear,"%04d", t->tm_year+1900); sprintf(strMonth,"%02d", t->tm_mon); sprintf(strDay,"%02d", t->tm_mday); char buf[255]={0}; getcwd(buf,255); char strdir[255]={0}; sprintf(strdir,"%s/log/%s/%s/%s", buf,strYear,strMonth,strDay); PathCreator creator; creator.Mkdir(strdir); char logPath[255] = { 0 }; sprintf(logPath, "%s/", strdir); FLAGS_max_log_size = 100; FLAGS_logbufsecs = 0; google::InitGoogleLogging("GarageMeasurement"); google::SetLogDestination(0, logPath); //google::InstallFailureSignalHandler(); //google::InstallFailureWriter(0); } bool ReadProtoParam(std::string path, ::google::protobuf::Message& param) { int fd = open(path.c_str(), O_RDONLY); if (fd == -1) return false; FileInputStream* input = new FileInputStream(fd); bool success = google::protobuf::TextFormat::Parse(input, ¶m); delete input; close(fd); return success; } Automatic::stCalibParam m_laser_calib_param; CProcess* m_pProcess=0; int main(int argc, char *argv[]) { std::cout<<" --------- Start ----------"<Init()==false) { QMessageBox::about(NULL, "Error", m_pProcess->LastError().c_str()); } return a.exec(); }