2024-05-11 17:43:38 +08:00
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <thread>
|
|
|
|
|
#include <codecvt>
|
|
|
|
|
#include <grpcpp/grpcpp.h>
|
|
|
|
|
#include "global.h"
|
|
|
|
|
#include "SystemInfo.h"
|
|
|
|
|
#include "Logger.h"
|
|
|
|
|
#include "Toast.h"
|
2024-05-17 10:57:17 +08:00
|
|
|
|
#include "stdafx.h"
|
2024-05-11 17:43:38 +08:00
|
|
|
|
#include <map>
|
|
|
|
|
#include "LanguageManager.h"
|
|
|
|
|
#include "../DataManage/DataHandle.h"
|
|
|
|
|
|
|
|
|
|
string g_AppPath;
|
|
|
|
|
string g_AppDisk;
|
|
|
|
|
Logger* g_log;
|
|
|
|
|
LanguageManager* g_LngManager;
|
|
|
|
|
Toast* g_Toast;
|
|
|
|
|
bool g_isDebug;
|
|
|
|
|
uint32_t g_ScanSerial;
|
|
|
|
|
string g_gno;
|
|
|
|
|
SystemInfo* g_SystemInfo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HBDSystem {
|
|
|
|
|
public:
|
|
|
|
|
HBDSystem(){}
|
|
|
|
|
|
|
|
|
|
~HBDSystem(){
|
|
|
|
|
DELP(g_log);
|
|
|
|
|
DELP(g_Toast);
|
|
|
|
|
DELP(g_SystemInfo);
|
|
|
|
|
DELP(g_LngManager);
|
|
|
|
|
//DELP(m_controller);
|
|
|
|
|
//DELP(m_win);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool init(){
|
|
|
|
|
char szFilePath[MAX_PATH + 1] = { 0 };
|
|
|
|
|
GetModuleFileName(NULL, szFilePath, MAX_PATH);
|
|
|
|
|
(strrchr(szFilePath, '\\'))[1] = 0;
|
|
|
|
|
g_AppPath = szFilePath;
|
|
|
|
|
g_AppDisk = g_AppPath.substr(0, 2);
|
|
|
|
|
|
|
|
|
|
g_isDebug = false;
|
|
|
|
|
g_log = new Logger();
|
|
|
|
|
g_log->m_LogDao->Init();
|
|
|
|
|
g_SystemInfo = new SystemInfo();
|
|
|
|
|
g_Toast = new Toast();
|
|
|
|
|
g_Lang = (char*)"zh_CN";
|
|
|
|
|
|
|
|
|
|
//g_LngManager = new LanguageManager();
|
|
|
|
|
//ChartletManager::GetInstance()->Init();
|
|
|
|
|
//g_LngManager->Init();
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
|
HBDSystem* sys = new HBDSystem();
|
|
|
|
|
sys->init();
|
|
|
|
|
|
|
|
|
|
DataHandle* dataHandle = new DataHandle();
|
|
|
|
|
dataHandle->Init();
|
|
|
|
|
dataHandle->Usage();
|
|
|
|
|
|
|
|
|
|
std::string userInput;
|
|
|
|
|
bool unknowCmd = false;
|
|
|
|
|
while (true) {
|
|
|
|
|
if (!unknowCmd)printf("*请输入命令:");
|
|
|
|
|
std::getline(std::cin, userInput); // 读取用户输入
|
|
|
|
|
unknowCmd = false;
|
2024-05-15 17:59:04 +08:00
|
|
|
|
if (userInput.empty()) continue;
|
|
|
|
|
|
|
|
|
|
if(dataHandle->Request(stoi(userInput)) < 0){
|
2024-05-11 17:43:38 +08:00
|
|
|
|
printf("未识别的命令,请重新输入命令:");
|
|
|
|
|
unknowCmd = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-17 10:57:17 +08:00
|
|
|
|
DELP(dataHandle);
|
|
|
|
|
DELP(sys);
|
|
|
|
|
|
2024-05-11 17:43:38 +08:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|