This commit is contained in:
2026-06-16 14:20:41 +08:00
parent 3085a10af0
commit cc3f6037e7
3 changed files with 21 additions and 2 deletions
+16 -1
View File
@@ -1,7 +1,12 @@
#include "RenderAble.h" #include "RenderAble.h"
#include <QDir>
#include "base/Plot.h" #include "base/Plot.h"
#include "Axis/AbsAxis.h" #include "Axis/AbsAxis.h"
#include "plottable/HoverInfo.h" #include "plottable/HoverInfo.h"
#include "psc_global_include/export.h"
#include "psc_global_include/Fail_Fast.h"
namespace YSG { namespace YSG {
@@ -129,10 +134,20 @@ namespace YSG {
QVector<QRgb> getTurboColorGradient() { QVector<QRgb> getTurboColorGradient() {
QVector<QRgb> colors; QVector<QRgb> colors;
// std::cout << "11111111111111111111111111111111111111" << std::endl;
// for (auto s : QDir(":/").entryList())
// {
// std::cout << "QDir=============" << s.toStdString() << std::endl;
// }
//
// std::cout << "11111111111111111111111111111111111111" << std::endl;
//
QFile file(":/turbo.colorMap"); QFile file(":/turbo.colorMap");
if (!file.open(QIODevice::ReadOnly)) { if (!file.open(QIODevice::ReadOnly)) {
qDebug() << "getTurboColorGradient2: Failed to open file"; std::ostringstream oss;
oss << file.errorString().toStdString() << " getTurboColorGradient2: Failed to open file" << LOG_POS_SIMPLE << std::endl;
Psc::fail_fast(oss.str());
return colors; // 返回一个空的 std::vector return colors; // 返回一个空的 std::vector
} }
+4
View File
@@ -5,6 +5,7 @@
#include <QThread> #include <QThread>
#include <qrgb.h> #include <qrgb.h>
extern int qInitResources_resource();
namespace YSG { namespace YSG {
class LIB_DECL TimerThread : public QThread { class LIB_DECL TimerThread : public QThread {
Q_OBJECT Q_OBJECT
@@ -14,8 +15,11 @@ namespace YSG {
void run() override; void run() override;
}; };
class LIB_DECL Global : public QObject, public Psc::Singleton<Global> { class LIB_DECL Global : public QObject, public Psc::Singleton<Global> {
public: public:
int r = qInitResources_resource();
int mTimerId{}; int mTimerId{};
QMap<QString, TimerThread*> mTimerThreadMap; QMap<QString, TimerThread*> mTimerThreadMap;
int mInterval = 10; int mInterval = 10;
+1 -1
View File
@@ -10,7 +10,7 @@ endif()
set(dir "${CMAKE_CURRENT_LIST_DIR}/YSGraphic_Core") set(dir "${CMAKE_CURRENT_LIST_DIR}/YSGraphic_Core")
file(GLOB_RECURSE srcs "${dir}/*.c" "${dir}/*.cpp" "${dir}/*.h") file(GLOB_RECURSE srcs "${dir}/*.c" "${dir}/*.cpp" "${dir}/*.h" "${dir}/*.qrc")
add_library(YSGraphic_Core STATIC "${srcs}") add_library(YSGraphic_Core STATIC "${srcs}")
target_include_directories(YSGraphic_Core PUBLIC "${CMAKE_CURRENT_LIST_DIR}") target_include_directories(YSGraphic_Core PUBLIC "${CMAKE_CURRENT_LIST_DIR}")