This commit is contained in:
DESKTOP-450PEFP\mainc 2026-05-13 18:28:08 +08:00
commit 3a621133c7
14 changed files with 69 additions and 26 deletions

View File

@ -1,11 +1,14 @@
#ifndef DRAWBASE_GLOBAL_H #ifndef DRAWBASE_GLOBAL_H
#define DRAWBASE_GLOBAL_H #define DRAWBASE_GLOBAL_H
#ifdef WIN32
# ifdef DRAWBASE_LIB_EXPORT # ifdef DRAWBASE_LIB_EXPORT
# define DRAWBASE_EXPORT __declspec(dllexport) # define DRAWBASE_EXPORT __declspec(dllexport)
# else # else
# define DRAWBASE_EXPORT __declspec(dllimport) # define DRAWBASE_EXPORT __declspec(dllimport)
# endif # endif
#else
#define DRAWBASE_EXPORT
#endif
#endif #endif

View File

@ -28,7 +28,7 @@ INCLUDEPATH += ../../common \
../../Workflow/WFEngine/ObjectModel/ObjectModelBase/include\ ../../Workflow/WFEngine/ObjectModel/ObjectModelBase/include\
../../Workflow/WFWidget/include ../../Workflow/WFWidget/include
# HEADERS += ../include/*.h HEADERS += ../include/*.h
SOURCES += *.cpp SOURCES += *.cpp

View File

@ -43,6 +43,7 @@ CString MemName(CString wellname,CString Curve)
wchar_t* AnsiToUnicode(const char* szStr) wchar_t* AnsiToUnicode(const char* szStr)
{ {
#ifdef WIN32
int nLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szStr, -1, NULL, 0 ); int nLen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szStr, -1, NULL, 0 );
if (nLen == 0) if (nLen == 0)
{ {
@ -51,9 +52,14 @@ wchar_t* AnsiToUnicode(const char* szStr)
wchar_t* pResult = new wchar_t[nLen]; wchar_t* pResult = new wchar_t[nLen];
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szStr, -1, pResult, nLen ); MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szStr, -1, pResult, nLen );
return pResult; return pResult;
#else
wchar_t* pResult = new wchar_t[1];
return pResult;
#endif
} }
int IsMappingMem(const char *MemName) int IsMappingMem(const char *MemName)
{ {
#ifdef WIN32
QString slf1=MemName; QString slf1=MemName;
slf1.replace("\\","/"); slf1.replace("\\","/");
slf1.replace(".","_"); slf1.replace(".","_");
@ -65,9 +71,13 @@ int IsMappingMem(const char *MemName)
// (GetLastError() == ERROR_ALREADY_EXISTS); // (GetLastError() == ERROR_ALREADY_EXISTS);
CloseHandle(hMapFile); CloseHandle(hMapFile);
return fInit; return fInit;
#else
return 0;
#endif
} }
bool MappingMem(HANDLE *hHandle,LPSTR *hMem,int len,const char* name) bool MappingMem(HANDLE *hHandle,LPSTR *hMem,int len,const char* name)
{ {
#ifdef WIN32
QString slf1=name; QString slf1=name;
slf1.replace("\\","/"); slf1.replace("\\","/");
slf1.replace(".","_"); slf1.replace(".","_");
@ -97,12 +107,19 @@ bool MappingMem(HANDLE *hHandle,LPSTR *hMem,int len,const char* name)
0); // default: map entire file 0); // default: map entire file
if (*hMem == NULL) return FALSE; if (*hMem == NULL) return FALSE;
return TRUE; return TRUE;
#else
return FALSE;
#endif
} }
void CloseView(HANDLE hMapObject,LPVOID lpvMem) void CloseView(HANDLE hMapObject,LPVOID lpvMem)
{ {
#ifdef WIN32
if(lpvMem)UnmapViewOfFile(lpvMem); if(lpvMem)UnmapViewOfFile(lpvMem);
if(hMapObject)CloseHandle(hMapObject); if(hMapObject)CloseHandle(hMapObject);
#else
return;
#endif
} }
time_t StringToTime(char * szTime) time_t StringToTime(char * szTime)

View File

@ -1,4 +1,4 @@
/** /**
* @file Turtle_globle.h * @file Turtle_globle.h
* @brief * @brief
* *
@ -10,7 +10,7 @@
namespace pai{ namespace pai{
namespace turtle { namespace turtle {
#if defined(_WINDOWS) #if defined(WIN32)
#define PAI_CURRENT_FUNCTION __FUNCSIG__ #define PAI_CURRENT_FUNCTION __FUNCSIG__
#define __func__ __FUNCTION__ #define __func__ __FUNCTION__
#define VARIABLE_IS_NOT_USED __attribute__ ((unused)) #define VARIABLE_IS_NOT_USED __attribute__ ((unused))

View File

@ -1,4 +1,4 @@
#ifdef LLToString #ifdef LLToString
#undef LLToString #undef LLToString
#endif #endif
#include <QCoreApplication> #include <QCoreApplication>
@ -30,6 +30,7 @@ using std::endl;
#include <netinet/in.h> #include <netinet/in.h>
#include <net/if.h> #include <net/if.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <signal.h>
#endif #endif
using namespace pai::turtle; using namespace pai::turtle;

View File

@ -59,6 +59,9 @@ HEADERS += \
./SysUtility/utils/include/PAIConst.h \ ./SysUtility/utils/include/PAIConst.h \
./SysUtility/configuration/include/Configure.h ./SysUtility/configuration/include/Configure.h
HEADERS += \
./SysUtility/utils/include/*.h
SOURCES += \ SOURCES += \
./Crystal/src/GlobalUtility.cpp \ ./Crystal/src/GlobalUtility.cpp \
./Crystal/src/IExtension.cpp \ ./Crystal/src/IExtension.cpp \

View File

@ -1,6 +1,6 @@
#include "memrdwt.h" #include "MemRdWt.h"
#include "math.h" #include "math.h"
#include "basefun.h" #include "BaseFun.h"
#include "appDllTest.h" #include "appDllTest.h"
#include "appDllTestDialog.h" #include "appDllTestDialog.h"
Slf_WAVE mWave[1]; Slf_WAVE mWave[1];

View File

@ -14,6 +14,8 @@
#include "PropertyWidget.h" #include "PropertyWidget.h"
#include "DrawTvd.h" #include "DrawTvd.h"
#include "DepthProgress.h" #include "DepthProgress.h"
#include "CallGlobalManage.h"
// #include "CylinderImagePlot.h"
//以下参数从配置文件读取 //以下参数从配置文件读取
extern int g_iOneWidth; //道宽 extern int g_iOneWidth; //道宽
@ -3569,7 +3571,7 @@ void FormDraw::s_AddLine_Property(QString strUuid, QString strSlfName, QString s
} }
//qDebug() << "FormDraw s_AddLine_Property"; //qDebug() << "FormDraw s_AddLine_Property";
AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property"); //AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property");
if(m_listLineName.contains(strLineName)) if(m_listLineName.contains(strLineName))
{ {
@ -3593,7 +3595,7 @@ void FormDraw::s_AddLine_Property(QString strUuid, QString strSlfName, QString s
// //
m_listLineName.push_back(strLineName); m_listLineName.push_back(strLineName);
AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property end"); //AppendConsole(PAI_INFO, "FormDraw s_AddLine_Property end");
} }
//#include "CylinderImagePlot.h" //#include "CylinderImagePlot.h"
void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName) void FormDraw::s_addWave(QString strUuid, QString strSlfName, QString strWellName, QString strTrackName, QString strWaveName)
@ -4168,7 +4170,7 @@ void FormDraw::setupSelectionDemo(QMyCustomPlot *customPlot)
double key = customPlot->graph(i)->data()->at(k)->key; double key = customPlot->graph(i)->data()->at(k)->key;
double value = customPlot->graph(i)->data()->at(k)->value; double value = customPlot->graph(i)->data()->at(k)->value;
AppendConsole(PAI_INFO, QString("曲线 %1: (%2, %3)").arg(i).arg(key).arg(value)); //AppendConsole(PAI_INFO, QString("曲线 %1: (%2, %3)").arg(i).arg(key).arg(value));
} }
}*/ }*/
} }
@ -4308,9 +4310,11 @@ void FormDraw::s_addDrawImage(QString strUuid, QString strSlfName, QString strWe
} }
// //
QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, strTrackName, strLineName);
QMyCustomPlot *curv = new QMyCustomPlot(this, strSlfName, strWellName, strTrackName, strLineName, "DrawImageObject");
//绑定m_formTrack方便关联formInfo //绑定m_formTrack方便关联formInfo
curv->m_formTrack = m_formTrack; curv->m_formTrack = m_formTrack;
curv->setScaleX(0, 264);
curv->setDepthY(m_iY1, m_iY2); curv->setDepthY(m_iY1, m_iY2);
if (nW <= 0) if (nW <= 0)
nW = g_iOneWidth; nW = g_iOneWidth;
@ -4322,8 +4326,18 @@ void FormDraw::s_addDrawImage(QString strUuid, QString strSlfName, QString strWe
QString strWaveName = ""; QString strWaveName = "";
int _nSamples = 0; int _nSamples = 0;
curv->initImage(strSlfName, strWaveName); curv->initImage(strSlfName, strWaveName);
//curv->initImage3D(strSlfName, strWaveName);
//DrawImageNew_NoFilter(curv, strSlfName, strWaveName, _nSamples); //DrawImageNew_NoFilter(curv, strSlfName, strWaveName, _nSamples);
//curv->m_colorMap->setVisible(false);
//CylindricalImageMap* cylinderMap = new CylindricalImageMap(curv->xAxis, curv->yAxis);
//cylinderMap->setData(curv->m_colorMap->data());
//cylinderMap->setCylinderRadius(2.0);
//cylinderMap->setSourceColorMap(curv->m_colorMap); // 共享梯度
//cylinderMap->setAzimuth(45);
//cylinderMap->setElevation(30);
// //
connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*))); connect(curv, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(s_mouseWheel(QWheelEvent*)));

View File

@ -47,7 +47,7 @@ QtProjectWidgets::QtProjectWidgets(QWidget *parent)
connect(ui->btnFind, &QPushButton::clicked, this, [ = ]() connect(ui->btnFind, &QPushButton::clicked, this, [ = ]()
{ {
qDebug()<<"btnFind clicked"; qDebug()<<"btnFind clicked";
AppendConsole(PAI_INFO, "btnFind clicked..."); //AppendConsole(PAI_INFO, "btnFind clicked...");
//emit CallManage::getInstance()->sig_Find(); //emit CallManage::getInstance()->sig_Find();
}); });

View File

@ -5,7 +5,7 @@
#include <QPainter> #include <QPainter>
#include <qtpropertybrowser.h> #include <qtpropertybrowser.h>
#include "ColorSchemeComboBox.h" #include "ColorSchemeComboBox.h"
#include "QtColorSchemeComboBox.h" #include "qtColorSchemeComboBox.h"
// #include "QtColorTableData.h" // #include "QtColorTableData.h"
template <class Value, class PrivateData> template <class Value, class PrivateData>
static Value getData(const QMap<const QtProperty *, PrivateData> &propertyMap, static Value getData(const QMap<const QtProperty *, PrivateData> &propertyMap,
@ -13,7 +13,7 @@ static Value getData(const QMap<const QtProperty *, PrivateData> &propertyMap,
const QtProperty *property, const Value &defaultValue = Value()) const QtProperty *property, const Value &defaultValue = Value())
{ {
typedef QMap<const QtProperty *, PrivateData> PropertyToData; typedef QMap<const QtProperty *, PrivateData> PropertyToData;
typedef PropertyToData::const_iterator PropertyToDataConstIterator; typedef typename PropertyToData::const_iterator PropertyToDataConstIterator;
const PropertyToDataConstIterator it = propertyMap.constFind(property); const PropertyToDataConstIterator it = propertyMap.constFind(property);
if (it == propertyMap.constEnd()) if (it == propertyMap.constEnd())
return defaultValue; return defaultValue;

View File

@ -1,4 +1,4 @@

#ifndef COLORSCHEMACOMOBOX_H #ifndef COLORSCHEMACOMOBOX_H
#define COLORSCHEMACOMOBOX_H #define COLORSCHEMACOMOBOX_H
@ -7,7 +7,7 @@
// #include <QtGui/QComboBox> // #include <QtGui/QComboBox>
#include "qtpropertybrowser.h" #include "qtpropertybrowser.h"
#include "qteditorfactory.h" #include "qteditorfactory.h"
#include "QtColorSchemeComboBox.h" #include "qtColorSchemeComboBox.h"
//const QSize rectSize(200,15); //const QSize rectSize(200,15);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -1,6 +1,7 @@
#include "Gradient.h" #include "Gradient.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <math.h>
//extern char *GetBinDir(char *str); //extern char *GetBinDir(char *str);
BYTE GetRValue(COLORREF colour) BYTE GetRValue(COLORREF colour)

View File

@ -24,8 +24,11 @@ typedef DWORD *LPCOLORREF;
//#define GetRValue(rgb) (LOBYTE(rgb)) //#define GetRValue(rgb) (LOBYTE(rgb))
//#define GetGValue(rgb) (LOBYTE(((WORD)(rgb)) >> 8)) //#define GetGValue(rgb) (LOBYTE(((WORD)(rgb)) >> 8))
//#define GetBValue(rgb) (LOBYTE((rgb)>>16)) //#define GetBValue(rgb) (LOBYTE((rgb)>>16))
#ifdef WIN32
typedef COLORREF (__cdecl* InterpolateFn)(COLORREF first, COLORREF second, float position, float start, float end); typedef COLORREF (__cdecl* InterpolateFn)(COLORREF first, COLORREF second, float position, float start, float end);
#else
typedef COLORREF (* InterpolateFn)(COLORREF first, COLORREF second, float position, float start, float end);
#endif
typedef struct CPeg { typedef struct CPeg {
COLORREF colour; COLORREF colour;
float position; float position;

View File

@ -1,4 +1,4 @@
/* /*
* QtColorSchemeComboBox.cpp * QtColorSchemeComboBox.cpp
* *
* Created on: 2013-5-27 * Created on: 2013-5-27
@ -12,6 +12,7 @@
#include <QTextStream> #include <QTextStream>
#include "qtColorSchemeComboBox.h" #include "qtColorSchemeComboBox.h"
#include "Gradient.h" #include "Gradient.h"
#include <math.h>
QtColorSchemeComboBox::QtColorSchemeComboBox(QWidget *parent):QtComboBox(parent), m_isShowText(true) QtColorSchemeComboBox::QtColorSchemeComboBox(QWidget *parent):QtComboBox(parent), m_isShowText(true)
{ {