|
@@ -12,8 +12,6 @@
|
|
|
|
|
|
#define DEVICE_NUM 3
|
|
#define DEVICE_NUM 3
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
int main(int argc, char **argv)
|
|
int main(int argc, char **argv)
|
|
{
|
|
{
|
|
// set usbfs memory to 64MB
|
|
// set usbfs memory to 64MB
|
|
@@ -22,11 +20,14 @@ int main(int argc, char **argv)
|
|
|
|
|
|
// use json to read config file
|
|
// use json to read config file
|
|
nlohmann::json config;
|
|
nlohmann::json config;
|
|
- try {
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
std::ifstream config_file("./configure/config.json");
|
|
std::ifstream config_file("./configure/config.json");
|
|
config_file >> config;
|
|
config_file >> config;
|
|
config_file.close();
|
|
config_file.close();
|
|
- } catch (std::exception &e) {
|
|
|
|
|
|
+ }
|
|
|
|
+ catch (std::exception &e)
|
|
|
|
+ {
|
|
std::cerr << "Error reading config file: " << e.what() << std::endl;
|
|
std::cerr << "Error reading config file: " << e.what() << std::endl;
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
@@ -36,9 +37,9 @@ int main(int argc, char **argv)
|
|
UsbTest::SimulateTrigger::getInstance().startTrigger();
|
|
UsbTest::SimulateTrigger::getInstance().startTrigger();
|
|
|
|
|
|
LogConfiguration LogConfig; // 日志结构体
|
|
LogConfiguration LogConfig; // 日志结构体
|
|
- LogConfig.FromFile("./configure/log.json");
|
|
|
|
|
|
+ LogConfig.FromFile("./configure/log.json");
|
|
LOG_INIT("UsbDevice", LogConfig);
|
|
LOG_INIT("UsbDevice", LogConfig);
|
|
- if (OmniLoger::CLoger::get_instance().log_sink != nullptr)
|
|
|
|
|
|
+ if (OmniLoger::CLoger::get_instance().log_sink != nullptr)
|
|
{
|
|
{
|
|
std::cout << "Log initialized successfully" << std::endl;
|
|
std::cout << "Log initialized successfully" << std::endl;
|
|
OmniLoger::CLoger::get_instance().log_sink->error("Error occurred during initialization");
|
|
OmniLoger::CLoger::get_instance().log_sink->error("Error occurred during initialization");
|
|
@@ -64,6 +65,5 @@ int main(int argc, char **argv)
|
|
// Stop all streaming
|
|
// Stop all streaming
|
|
UVCManager::getInstance().stopAllStreaming();
|
|
UVCManager::getInstance().stopAllStreaming();
|
|
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|