增加错误报警

This commit is contained in:
2025-10-22 10:22:54 +08:00
parent 3677d3ca8c
commit da4cf3ea20
4 changed files with 15 additions and 7 deletions
+4 -1
View File
@@ -120,7 +120,10 @@ public:
if (res1 == true && res2 == true && res3 == true) {
emit bridge->loadingWindow_appendInitLog("初始化Mission中...", "yellow");
_missionLoader.loadMission(missionJson["missionDllPath"]);
bool res = _missionLoader.loadMission(missionJson["missionDllPath"]);
if (res == false) {
emit bridge->loadingWindow_appendInitLog("初始化Mission失败!请检查路径是否正确.", "red");
}
_missionLoader.getmission(missionJson["missionDllPath"])->initBasic(
&_serviceManager,
missionJson["missionSettings"], bridge
+2 -2
View File
@@ -7,7 +7,7 @@ class MissionLoader {
bool loadMission(const std::string& missionPath) {
hDlls[missionPath] = LoadLibrary(missionPath.c_str());
if (!hDlls[missionPath]) {
std::cerr << "Failed to load DLL!" << std::endl;
std::cerr << "Failed to load Misson DLL!" << std::endl;
return false;
}
createMissionFunc createMission = (createMissionFunc)GetProcAddress(hDlls[missionPath], "createMission");
@@ -17,7 +17,7 @@ class MissionLoader {
missionMap[missionPath] = createMission();
}
else {
std::cerr << "Failed to get function pointers!" << std::endl;
std::cerr << "Failed to get Misson function pointers!" << std::endl;
return false;
}
return true;
+5
View File
@@ -16,6 +16,11 @@ void appConfig::parsingSettingJson()
loginPassWord = settingJson["loginPassWord"];
missionJson = readOrderedJsonFromPath(appWorkPath.string() + "/config/" + objectSelect +".json");
if(QFile(QString::fromStdString(missionJson)).exists() == false){
std::cout << "Mission config file not found: " << (appWorkPath.string() + "/config/" + objectSelect +".json") << std::endl;
std::cout << "任务配置文件未找到: " << (appWorkPath.string() + "/config/" + objectSelect +".json") << std::endl;
exit(1);
}
softwareTile = missionJson["softwareTile"];
imgSavePath = missionJson["backend"]["imgSaveBasePath"];
//viewer
+4 -4
View File
@@ -20,8 +20,8 @@ public:
json = jsonIn;
hDll = LoadLibrary("core.dll");
if (!hDll) {
std::cerr << "Failed to load DLL!" << std::endl;
return false;
std::cerr << "Failed to load Core DLL!" << std::endl;
exit(1);
}
CreateBackend = (CreateBackendFunc)GetProcAddress(hDll, "CreateBackend");
@@ -31,8 +31,8 @@ public:
backend = CreateBackend();
}
else {
std::cerr << "Failed to get function pointers!" << std::endl;
return false;
std::cerr << "Failed to get Core function pointers!" << std::endl;
exit(1);
}
backend->init(db,bridgeIn, jsonIn);
return true;