2024-03-15 12:31:34 +08:00
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <thread>
|
|
|
|
|
#include <codecvt>
|
|
|
|
|
#include <grpcpp/grpcpp.h>
|
2024-04-01 18:26:14 +08:00
|
|
|
|
#include "UI/UIWin.h"
|
|
|
|
|
#include "global.h"
|
|
|
|
|
#include "SystemInfo.h"
|
|
|
|
|
#include "Logger.h"
|
|
|
|
|
#include "Toast.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <map>
|
|
|
|
|
#include "PLC/SysParam.h"
|
|
|
|
|
#include "Machine/Machine.h"
|
|
|
|
|
#include "Machine/HBD1000.h"
|
|
|
|
|
#include "LanguageManager.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():m_win(nullptr)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
~HBDSystem()
|
|
|
|
|
{
|
|
|
|
|
//ConfigManager::GetInstance()->SaveConfig();
|
|
|
|
|
DELP(g_log);
|
|
|
|
|
DELP(g_Toast);
|
2024-04-02 17:45:03 +08:00
|
|
|
|
DELP(m_controller);
|
|
|
|
|
DELP(m_win);
|
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool init(){
|
2024-04-02 17:45:03 +08:00
|
|
|
|
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);
|
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
g_isDebug = false;
|
|
|
|
|
g_log = new Logger();
|
|
|
|
|
g_log->m_LogDao->Init();
|
|
|
|
|
g_SystemInfo = new SystemInfo();
|
|
|
|
|
g_Toast = new Toast();
|
2024-04-02 17:45:03 +08:00
|
|
|
|
g_Lang = (char*)"zh_CN";
|
|
|
|
|
|
|
|
|
|
m_controller = new Controller();
|
|
|
|
|
m_controller->Init();
|
|
|
|
|
|
|
|
|
|
DataHandle::Instance()->Init();
|
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
m_win = new UIWin();
|
|
|
|
|
if (!m_win->Init()) return false;
|
2024-04-02 17:45:03 +08:00
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void run(){
|
|
|
|
|
m_win->Display();
|
|
|
|
|
}
|
|
|
|
|
private:
|
|
|
|
|
UIWin* m_win;
|
2024-04-02 17:45:03 +08:00
|
|
|
|
Controller* m_controller;
|
2024-04-01 18:26:14 +08:00
|
|
|
|
};
|
2024-03-15 12:31:34 +08:00
|
|
|
|
|
|
|
|
|
|
2024-04-02 17:45:03 +08:00
|
|
|
|
//int main(int argc, char** argv) {
|
|
|
|
|
// printf("你好!" );
|
|
|
|
|
//
|
|
|
|
|
// DataHandle* dataHandle = new DataHandle();
|
|
|
|
|
// dataHandle->Init();
|
|
|
|
|
// printf("你好fdfdfd!");
|
|
|
|
|
// HBDSystem* system = new HBDSystem();
|
|
|
|
|
// system->init();
|
|
|
|
|
// system->run();
|
|
|
|
|
//
|
|
|
|
|
// return 0;
|
|
|
|
|
//
|
|
|
|
|
//}
|
2024-04-01 18:26:14 +08:00
|
|
|
|
|
|
|
|
|
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,_In_opt_ HINSTANCE hPrevInstance,_In_ LPWSTR lpCmdLine,_In_ int nCmdShow) {
|
2024-03-15 12:31:34 +08:00
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
HBDSystem* system = new HBDSystem();
|
|
|
|
|
system->init();
|
|
|
|
|
system->run();
|
2024-04-02 17:45:03 +08:00
|
|
|
|
|
|
|
|
|
DELP(system);
|
|
|
|
|
|
2024-04-01 18:26:14 +08:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2024-03-15 12:31:34 +08:00
|
|
|
|
|