1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // Created by zx on 2020/6/18.
- //
- #include <iostream>
- #include "./error_code/error_code.h"
- #include "LogFiles.h"
- #include <glog/logging.h>
- #include "./communication/communication_socket_base.h"
- #include "./tool/thread_pool.h"
- #include "./system/system_communication.h"
- #include "./system/system_executor.h"
- #include "./wanji_lidar/wanji_lidar_device.h"
- #include "./tool/proto_tool.h"
- #include "./wanji_lidar/wanji_manager.h"
- #define LIVOX_NUMBER 2
- GOOGLE_GLOG_DLL_DECL void shut_down_logging(const char* data, int size)
- {
- time_t tt;
- time( &tt );
- tt = tt + 8*3600; // transform the time zone
- tm* t= gmtime( &tt );
- char buf[255]={0};
- sprintf(buf,"./%d%02d%02d-%02d%02d%02d-dump.txt",
- t->tm_year + 1900,
- t->tm_mon + 1,
- t->tm_mday,
- t->tm_hour,
- t->tm_min,
- t->tm_sec);
- FILE* tp_file=fopen(buf,"w");
- fprintf(tp_file,data,strlen(data));
- fclose(tp_file);
- }
- void test_whole_process()
- {
- System_executor::get_instance_references().execute_for_measure("key_for_test_only", 5, std::chrono::system_clock::now());
- }
- int main(int argc,char* argv[])
- {
- Error_manager t_error;
- Error_manager t_result ;
- const char* logPath = "./";
- google::InitGoogleLogging("LidarMeasurement");
- google::SetStderrLogging(google::INFO);
- google::SetLogDestination(0, logPath);
- google::SetLogFilenameExtension("zxlog");
- google::InstallFailureSignalHandler();
- google::InstallFailureWriter(&shut_down_logging);
- FLAGS_colorlogtostderr = true; // Set log color
- FLAGS_logbufsecs = 0; // Set log output speed(s)
- FLAGS_max_log_size = 1024; // Set max log file size(GB)
- FLAGS_stop_logging_if_full_disk = true;
- // std::cout << " huli test :::: " << " wanji_manager_init = " << 1 << std::endl;
- // 定义服务的终端id
- int t_terminal_id = 0;
- if ( argc == 2 )
- {
- std::cout << " huli test :::: " << " argv[1] = " << argv[1] << std::endl;
- t_terminal_id = atoi(argv[1]);
- }
- std::cout << " huli test :::: " << " t_terminal_id = " << t_terminal_id << std::endl;
- // 初始化
- Wanji_manager::get_instance_references().wanji_manager_init();
- std::cout << "wanji_manager = " << Wanji_manager::get_instance_references().check_status() << std::endl;
- System_executor::get_instance_references().system_executor_init(4, t_terminal_id);
- std::cout << "System_executor = " << System_executor::get_instance_references().get_system_executor_status() << std::endl;
- System_communication::get_instance_references().communication_init();
- // prev_test_pred_task();
- test_whole_process();
- // 反初始化
- System_communication::get_instance_references().communication_uninit();
- System_executor::get_instance_references().system_executor_uninit();
- return 0;
- }
|