SLFAsciiConvertor 适配linux
This commit is contained in:
parent
3f9dd8a9c3
commit
8a449628fa
|
|
@ -495,7 +495,7 @@ void CGradient::Serialize(QString strCfg)//CArchive &ar)
|
||||||
//GetBinDir(str);
|
//GetBinDir(str);
|
||||||
memset(str, '\0', sizeof (str));
|
memset(str, '\0', sizeof (str));
|
||||||
strcat(str, QCoreApplication::applicationDirPath().toStdString().c_str());
|
strcat(str, QCoreApplication::applicationDirPath().toStdString().c_str());
|
||||||
strcat(str,"\\color\\");
|
strcat(str,"/color/");
|
||||||
strcat(str,strCfg.toStdString().c_str());
|
strcat(str,strCfg.toStdString().c_str());
|
||||||
//strcat(str,"_clr.cfg");
|
//strcat(str,"_clr.cfg");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -231,6 +231,7 @@ int getPaiSystemColorNumber(QStringList &names)
|
||||||
fclose(fp1);
|
fclose(fp1);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getPaiSystemColor(int nIndex,QVector<QtColorItem> &colorList,bool inpolation)
|
int getPaiSystemColor(int nIndex,QVector<QtColorItem> &colorList,bool inpolation)
|
||||||
{
|
{
|
||||||
colorList.clear();
|
colorList.clear();
|
||||||
|
|
@ -239,6 +240,7 @@ int getPaiSystemColor(int nIndex,QVector<QtColorItem> &colorList,bool inpolation
|
||||||
QString strPathTmp = QCoreApplication::applicationDirPath() + QDir::separator();
|
QString strPathTmp = QCoreApplication::applicationDirPath() + QDir::separator();
|
||||||
strImagePath = QDir::toNativeSeparators( strPathTmp );
|
strImagePath = QDir::toNativeSeparators( strPathTmp );
|
||||||
QString filecfg=strImagePath+"image"+QDir::separator()+"colortable"+QDir::separator()+"colortable.cfg";
|
QString filecfg=strImagePath+"image"+QDir::separator()+"colortable"+QDir::separator()+"colortable.cfg";
|
||||||
|
|
||||||
FILE *fp1=fopen(filecfg.toStdString().c_str(),"rt");
|
FILE *fp1=fopen(filecfg.toStdString().c_str(),"rt");
|
||||||
if(!fp1) return -1;
|
if(!fp1) return -1;
|
||||||
char buf[100];
|
char buf[100];
|
||||||
|
|
@ -254,7 +256,9 @@ int getPaiSystemColor(int nIndex,QVector<QtColorItem> &colorList,bool inpolation
|
||||||
}
|
}
|
||||||
fclose(fp1);
|
fclose(fp1);
|
||||||
if(str.isEmpty()) return -1;
|
if(str.isEmpty()) return -1;
|
||||||
|
str = str.replace('\\', '/');
|
||||||
QString filename=strImagePath+"image"+QDir::separator()+"colortable"+QDir::separator()+str;
|
QString filename=strImagePath+"image"+QDir::separator()+"colortable"+QDir::separator()+str;
|
||||||
|
|
||||||
FILE *fp=fopen(filename.toStdString().c_str(),"rt");
|
FILE *fp=fopen(filename.toStdString().c_str(),"rt");
|
||||||
if(!fp) return -1;
|
if(!fp) return -1;
|
||||||
float r,g,b;
|
float r,g,b;
|
||||||
|
|
@ -394,31 +398,31 @@ bool QtColorTableData::LoadScheme(bool IsReLoad)
|
||||||
{
|
{
|
||||||
m_SharedMemory.setKey(m_modulName);
|
m_SharedMemory.setKey(m_modulName);
|
||||||
}
|
}
|
||||||
{
|
// {
|
||||||
if(m_SharedMemory.isAttached()) m_SharedMemory.detach();
|
// if(m_SharedMemory.isAttached()) m_SharedMemory.detach();
|
||||||
m_SharedMemory.create(sizeof(QtScheme_Color)*m_colorSchemeList.size()+sizeof(int));
|
// m_SharedMemory.create(sizeof(QtScheme_Color)*m_colorSchemeList.size()+sizeof(int));
|
||||||
if(!m_SharedMemory.isAttached()) m_SharedMemory.attach();
|
// if(!m_SharedMemory.isAttached()) m_SharedMemory.attach();
|
||||||
char *buffer=(char*)m_SharedMemory.data();
|
// char *buffer=(char*)m_SharedMemory.data();
|
||||||
*(int *)buffer=m_colorSchemeList.size();
|
// *(int *)buffer=m_colorSchemeList.size();
|
||||||
int size=m_colorSchemeList.size();
|
// int size=m_colorSchemeList.size();
|
||||||
for(int i=0;i<size;i++) {
|
// for(int i=0;i<size;i++) {
|
||||||
QtScheme_Color sc;
|
// QtScheme_Color sc;
|
||||||
memset(&sc,0,sizeof(QtScheme_Color));
|
// memset(&sc,0,sizeof(QtScheme_Color));
|
||||||
sc.isCustom=m_colorSchemeList[i].isCustom;
|
// sc.isCustom=m_colorSchemeList[i].isCustom;
|
||||||
sc.isDirty=m_colorSchemeList[i].isDirty;
|
// sc.isDirty=m_colorSchemeList[i].isDirty;
|
||||||
sc.currentIndex=m_colorSchemeList[i].currentIndex;
|
// sc.currentIndex=m_colorSchemeList[i].currentIndex;
|
||||||
sc.isCustom=m_colorSchemeList[i].isCustom;
|
// sc.isCustom=m_colorSchemeList[i].isCustom;
|
||||||
strcpy(sc.schemeName,m_colorSchemeList[i].schemeName.toStdString().c_str());
|
// strcpy(sc.schemeName,m_colorSchemeList[i].schemeName.toStdString().c_str());
|
||||||
sc.size=m_colorSchemeList[i].colorList.size();
|
// sc.size=m_colorSchemeList[i].colorList.size();
|
||||||
for(int j=0;j<m_colorSchemeList[i].colorList.size();j++) {
|
// for(int j=0;j<m_colorSchemeList[i].colorList.size();j++) {
|
||||||
sc.colorList[j].color=m_colorSchemeList[i].colorList[j].color.rgb();
|
// sc.colorList[j].color=m_colorSchemeList[i].colorList[j].color.rgb();
|
||||||
sc.colorList[j].fromValue=m_colorSchemeList[i].colorList[j].fromValue;
|
// sc.colorList[j].fromValue=m_colorSchemeList[i].colorList[j].fromValue;
|
||||||
sc.colorList[j].toValue=m_colorSchemeList[i].colorList[j].toValue;
|
// sc.colorList[j].toValue=m_colorSchemeList[i].colorList[j].toValue;
|
||||||
strcpy(sc.colorList[j].strComments,m_colorSchemeList[i].colorList[j].strComments.toStdString().c_str());
|
// strcpy(sc.colorList[j].strComments,m_colorSchemeList[i].colorList[j].strComments.toStdString().c_str());
|
||||||
}
|
// }
|
||||||
memmove(&buffer[4]+i*sizeof(QtScheme_Color),&sc,sizeof(QtScheme_Color));
|
// memmove(&buffer[4]+i*sizeof(QtScheme_Color),&sc,sizeof(QtScheme_Color));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -431,7 +435,7 @@ int QtColorTableData::getColorConfig(QVector <QString> &qFiles)
|
||||||
|
|
||||||
//GetBinDir(str);
|
//GetBinDir(str);
|
||||||
qstr = QCoreApplication::applicationDirPath();//QString(QLatin1String(str)); //char*=>QString
|
qstr = QCoreApplication::applicationDirPath();//QString(QLatin1String(str)); //char*=>QString
|
||||||
qstr += "\\color\\colorConfig.list";
|
qstr += "/color/colorConfig.list";
|
||||||
qFiles.clear();
|
qFiles.clear();
|
||||||
QFile f(qstr);
|
QFile f(qstr);
|
||||||
if (!f.open(QIODevice::ReadOnly | QIODevice::Text))
|
if (!f.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ TIME WF
|
||||||
// #include "WellBaseInfo.h"
|
// #include "WellBaseInfo.h"
|
||||||
#include <qstringlist.h>
|
#include <qstringlist.h>
|
||||||
#include "geometryutils.h"
|
#include "geometryutils.h"
|
||||||
#include "..\\..\\TexOutFun\\TxtOutFun.cpp"
|
#include "../../TexOutFun/TxtOutFun.cpp"
|
||||||
extern int HeadLineNum;//文件头行数
|
extern int HeadLineNum;//文件头行数
|
||||||
#pragma warning( pop)
|
#pragma warning( pop)
|
||||||
BEGIN_OSGGRAPHICS_NAMESPACE;
|
BEGIN_OSGGRAPHICS_NAMESPACE;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ INCLUDEPATH += $(OSGHOME)/include \
|
||||||
../../../Slfio/include\
|
../../../Slfio/include\
|
||||||
../../../ConvertorManager/include\
|
../../../ConvertorManager/include\
|
||||||
../../../OSGDataModel/include\
|
../../../OSGDataModel/include\
|
||||||
../../../Workflow/include\
|
win32 {
|
||||||
|
INCLUDEPATH += ../../../Workflow/include
|
||||||
|
}
|
||||||
../../../Workflow/WFCrystal/Crystal/include\
|
../../../Workflow/WFCrystal/Crystal/include\
|
||||||
../../../Workflow/WFCrystal/Plugin/include\
|
../../../Workflow/WFCrystal/Plugin/include\
|
||||||
../../../Workflow/WFCrystal/SysUtility/utils/include\
|
../../../Workflow/WFCrystal/SysUtility/utils/include\
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include "basefun.h"
|
#include "BaseFun.h"
|
||||||
#include "memrdwt.h"
|
#include "MemRdWt.h"
|
||||||
#include "CStringType.h"
|
#include "CStringType.h"
|
||||||
#include "DepthProgress.h"
|
#include "DepthProgress.h"
|
||||||
#include "GeometryUtils.h"
|
#include "geometryutils.h"
|
||||||
QString cfg;
|
QString cfg;
|
||||||
QList<double>dates;
|
QList<double>dates;
|
||||||
QList<double>depths;
|
QList<double>depths;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user