备份
@@ -208,8 +208,8 @@ if(ON)
|
||||
endforeach()
|
||||
|
||||
set(Qt5_DIR ${ENVPATH}/qt5/lib/cmake/Qt5)
|
||||
set(QT_DIR ${Qt5_DIR})
|
||||
set(qtlist "Core" "Widgets" "Network" "Gui" "PrintSupport" "Concurrent" "SerialPort""Sql" )
|
||||
set(QT_DIR ${Qt5_DIR})
|
||||
set(qtlist "Core" "Widgets" "Network" "Gui" "Charts" "PrintSupport" "Concurrent" "SerialPort""Sql" )
|
||||
#find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick QuickControls2 QuickLayouts REQUIRED)
|
||||
message("QT_Version :" Qt${QT_VERSION_MAJOR})
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
},
|
||||
{
|
||||
"hidden": true,
|
||||
"name": "1",
|
||||
"name": "T",
|
||||
"inherits": "Qt",
|
||||
"environment": {
|
||||
"QTDIR": "D:/Qt/QT5.12.12/5.12.12/msvc2017_64"
|
||||
"QTDIR": "D:/ds-628/env/qt5"
|
||||
},
|
||||
"architecture": {
|
||||
"strategy": "external",
|
||||
@@ -35,17 +35,7 @@
|
||||
"generator": "Ninja",
|
||||
"vendor": {
|
||||
"qt-project.org/Version": {
|
||||
"checksum": "dLSmxWmTxzMhTDrWvKaNxnGQc8o="
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"hidden": true,
|
||||
"name": "Qt-Default",
|
||||
"inherits": "12",
|
||||
"vendor": {
|
||||
"qt-project.org/Default": {
|
||||
"checksum": "s89cFlmg97AfXdRXoqFbeL5UVRk="
|
||||
"checksum": "E5+uagywx2jwhIiLSAFSbiyrNiM="
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -54,7 +44,7 @@
|
||||
"name": "12",
|
||||
"inherits": "Qt",
|
||||
"environment": {
|
||||
"QTDIR": "D:/Qt/QT5.12.12/5.12.12/msvc2017_64"
|
||||
"QTDIR": "D:/ds-628/env/qt5"
|
||||
},
|
||||
"architecture": {
|
||||
"strategy": "external",
|
||||
@@ -63,14 +53,24 @@
|
||||
"generator": "Ninja",
|
||||
"vendor": {
|
||||
"qt-project.org/Version": {
|
||||
"checksum": "QpjRswAcEITNChgZ8cRu0YyWMFM="
|
||||
"checksum": "hXZNUGAPmLqcCieREfoGZb1R80I="
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"hidden": true,
|
||||
"name": "Qt-Default",
|
||||
"inherits": "T",
|
||||
"vendor": {
|
||||
"qt-project.org/Default": {
|
||||
"checksum": "GUdpNFihrz9Et4EYDqQf1Vgr0p8="
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"vendor": {
|
||||
"qt-project.org/Presets": {
|
||||
"checksum": "qHgPL414qYgD9ayjFD/Vp7akPGE="
|
||||
"checksum": "Nmw6b/F/7ijfM6TjQ4QyFb3ylIM="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <nlohmannJson.hpp>
|
||||
#include <fstream>
|
||||
|
||||
// 读取json文件,不按顺序
|
||||
static nlohmann::json readJsonFromPath(std::string path)
|
||||
{
|
||||
nlohmann::json jsonObj;
|
||||
@@ -21,6 +22,7 @@ static nlohmann::json readJsonFromPath(std::string path)
|
||||
inputFile.close();
|
||||
return jsonObj;
|
||||
}
|
||||
// 保存json文件,不按顺序
|
||||
static bool saveJsonFromPath(std::string path, nlohmann::json& json)
|
||||
{
|
||||
std::ofstream saveFile(path);
|
||||
@@ -41,6 +43,47 @@ static bool saveJsonFromPath(std::string path, nlohmann::json& json)
|
||||
saveFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
// 读取有序 JSON 文件
|
||||
static nlohmann::ordered_json readOrderedJsonFromPath(const std::string& path)
|
||||
{
|
||||
nlohmann::ordered_json jsonObj;
|
||||
std::ifstream inputFile(path);
|
||||
if (!inputFile.is_open()) {
|
||||
std::cerr << "Could not open the file - " << path << std::endl;
|
||||
return jsonObj;
|
||||
}
|
||||
try {
|
||||
inputFile >> jsonObj;
|
||||
}
|
||||
catch (const nlohmann::json::parse_error& e) {
|
||||
std::cerr << "JSON parse error: " << e.what() << std::endl;
|
||||
return nlohmann::ordered_json();
|
||||
}
|
||||
|
||||
return jsonObj;
|
||||
}
|
||||
|
||||
// 保存有序 JSON 文件
|
||||
static bool saveOrderedJsonFromPath(const std::string& path, const nlohmann::ordered_json& json)
|
||||
{
|
||||
std::ofstream saveFile(path);
|
||||
if (!saveFile.is_open()) {
|
||||
std::cerr << "Could not open the file - " << path << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
saveFile << json.dump(4); // 缩进4空格
|
||||
}
|
||||
catch (const nlohmann::json::type_error& e) {
|
||||
std::cerr << "JSON write error: " << e.what() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void printNlohmannJson(nlohmann::json input, int depth = 0)
|
||||
{
|
||||
std::string indent_str(depth, ' ');
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#pragma execution_character_set("utf-8")
|
||||
const std::string softwareVersion = "2.0.1";
|
||||
const std::string softwareVersion = "2.0.2";
|
||||
const std::string euiJsonVersion = "1.0.5";
|
||||
#define switchToTongYongUi 1 //是否切换到通用UI界面
|
||||
#define skipLogin 1 //是否跳过登录界面
|
||||
#define sColor_Blue "51, 56, 69"
|
||||
#define sColor_BlueWithWhite "64, 68, 81"
|
||||
#define sColor_BlueWithBlack "46, 50, 52"
|
||||
@@ -25,6 +28,7 @@ const std::string softwareVersion = "2.0.1";
|
||||
|
||||
#define sColor_Black "22, 22, 22"
|
||||
#define sColor_BlackWithWhite "45, 45, 45"
|
||||
|
||||
//窗口设置
|
||||
#define windowMoveFreshRate 100//窗口移动每秒的刷新率
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ class IBackend {
|
||||
public:
|
||||
virtual ~IBackend() = default;
|
||||
virtual void test() = 0;
|
||||
virtual void init(qtFuncBridge*,nlohmann::json& json) = 0;
|
||||
virtual void init(qtFuncBridge*,nlohmann::ordered_json& json) = 0;
|
||||
virtual void cleanup() = 0;
|
||||
virtual SQLiteDB* getDatabase() = 0;
|
||||
};
|
||||
|
||||
@@ -40,6 +40,11 @@ signals:
|
||||
// 汇总数据
|
||||
void summaryData_addData(QString window, double data);
|
||||
|
||||
//数据到界面
|
||||
void pieWidgetAddNG();
|
||||
void pieWidgetAddOK();
|
||||
void histogramWidgetAddData(std::vector<std::string>);
|
||||
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// 切换界面
|
||||
|
||||
@@ -411,7 +411,7 @@ private:
|
||||
class CsvWriter
|
||||
{
|
||||
public:
|
||||
CsvWriter()
|
||||
CsvWriter(SQLiteDB* database_ptr = nullptr)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -437,7 +437,7 @@ public:
|
||||
{
|
||||
std::cerr << "readJsonFromPath error" << std::endl;
|
||||
}
|
||||
init();
|
||||
init(database_ptr);
|
||||
}
|
||||
~CsvWriter()
|
||||
{
|
||||
@@ -531,8 +531,10 @@ private:
|
||||
void init(SQLiteDB* database_ptr = nullptr)
|
||||
{
|
||||
std::lock_guard<std::mutex> locker(_mutex);
|
||||
if(database_ptr == nullptr)
|
||||
if (database_ptr == nullptr)
|
||||
_db = new SQLiteDB("./sqlDatabse/", "database");
|
||||
else
|
||||
_db = database_ptr;
|
||||
if (!_db->createTable(getLastProcessCsvName(), db_InitColumns)) {
|
||||
qDebug() << "Failed to create table " << getLastProcessCsvName();
|
||||
}
|
||||
|
||||
@@ -39,3 +39,18 @@ public:
|
||||
virtual bool run() { return true; }
|
||||
};
|
||||
|
||||
class cameraModuleBase : public QObject
|
||||
{
|
||||
public:
|
||||
bool init_flag; //是否初始化,false,true
|
||||
bool status = true; //相机状态(判断相机是否断开连接)
|
||||
std::string paras; //传输数据
|
||||
cv::Mat m_mat; //传输图片
|
||||
std::string moduleName; //模块名称
|
||||
public:
|
||||
cameraModuleBase() {}
|
||||
virtual ~cameraModuleBase() {}
|
||||
virtual bool captrue(std::vector<cv::Mat>&, QByteArray&) { return true; }
|
||||
virtual bool writeData(std::vector<cv::Mat>&, QByteArray&) { return true; }
|
||||
virtual bool initParas(QByteArray&) { return true; }
|
||||
};
|
||||
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 679 B |
|
After Width: | Height: | Size: 708 B |
|
After Width: | Height: | Size: 715 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 869 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 743 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 557 B |
|
After Width: | Height: | Size: 748 B |
|
After Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 764 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 506 B |
|
After Width: | Height: | Size: 485 B |
|
After Width: | Height: | Size: 486 B |
|
After Width: | Height: | Size: 722 B |
|
After Width: | Height: | Size: 816 B |
|
After Width: | Height: | Size: 804 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 669 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 557 B |
|
After Width: | Height: | Size: 610 B |
|
After Width: | Height: | Size: 616 B |
|
After Width: | Height: | Size: 628 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 412 B |
|
After Width: | Height: | Size: 461 B |
|
After Width: | Height: | Size: 591 B |
|
After Width: | Height: | Size: 470 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 724 B |
|
After Width: | Height: | Size: 791 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 201 B |
|
After Width: | Height: | Size: 203 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 559 B |
|
After Width: | Height: | Size: 573 B |
|
After Width: | Height: | Size: 567 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 954 B |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 977 B |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 679 B |
|
After Width: | Height: | Size: 708 B |
|
After Width: | Height: | Size: 715 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 869 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 557 B |
|
After Width: | Height: | Size: 748 B |
|
After Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 764 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |