Introduce ShimLib to project.
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/cmake-build-debug/
|
||||
/.idea/*
|
||||
/.idea/
|
||||
/.idea/
|
||||
/src/ShimLib/ShimLib.c
|
||||
|
||||
@@ -8,6 +8,7 @@ file(GLOB_RECURSE project_headers ./src/*.h)
|
||||
file(GLOB_RECURSE project_cpps ./src/*.cpp)
|
||||
file(GLOB_RECURSE project_cxx ./src/*.cxx)
|
||||
file(GLOB_RECURSE project_cc ./src/*.cc)
|
||||
file(GLOB_RECURSE project_c ./src/*.c)
|
||||
include_directories(./src/)
|
||||
|
||||
find_package(Qt5 COMPONENTS Core Widgets Gui OpenGL Sql REQUIRED)
|
||||
@@ -16,7 +17,7 @@ set(CMAKE_AUTORCC ON)
|
||||
file(GLOB project_uis ./src/*.ui)
|
||||
qt5_wrap_ui(ui_FILES ${project_uis})
|
||||
file(GLOB project_res ./src/*.qrc)
|
||||
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${ui_FILES})
|
||||
add_executable(${PROJECT_NAME} ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} ${ui_FILES})
|
||||
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL Qt5::Sql)
|
||||
|
||||
if(MSVC)
|
||||
|
||||
56
src/ShimLib/ShimLib.h
Normal file
56
src/ShimLib/ShimLib.h
Normal file
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// Created by Krad on 2021/10/12.
|
||||
//
|
||||
|
||||
#ifndef GUI_SHIMLIB_H
|
||||
#define GUI_SHIMLIB_H
|
||||
#ifdef __CPLUSPLUS
|
||||
extern "C"{
|
||||
#endif
|
||||
typedef enum
|
||||
{
|
||||
BUSY,// device is preparing for scan
|
||||
READY,// device is ready for scan
|
||||
SCANING,// device is doing scan
|
||||
ERROR// some device inner error are occured
|
||||
}DeviceStatus;
|
||||
|
||||
typedef struct StatusInfo
|
||||
{
|
||||
DeviceStatus status;// a enum represent device current status
|
||||
float progress;// percent value of operation
|
||||
}StatusInfo;
|
||||
|
||||
|
||||
|
||||
//3 kinds of scan action
|
||||
typedef enum
|
||||
{
|
||||
SCAN,// Start scan action
|
||||
PREVIEW_SCAN,// Start preview scan action
|
||||
STOP,// Stop current scan
|
||||
}ScanAction;
|
||||
|
||||
//kinds of device information
|
||||
typedef enum
|
||||
{
|
||||
MEAN_TEMPERATURE
|
||||
}DeviceInfo;
|
||||
|
||||
int InitLib(void(*)(const char * msg));
|
||||
|
||||
int ScanControl(ScanAction actionType);
|
||||
|
||||
StatusInfo GetStatus();
|
||||
|
||||
int SetScanInf(const char * jsonString);
|
||||
|
||||
const char * GetPreviewData();
|
||||
|
||||
const char * GetDeviceInf(DeviceInfo infoType);
|
||||
|
||||
#ifdef __CPLUSPLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //GUI_SHIMLIB_H
|
||||
Reference in New Issue
Block a user