This commit is contained in:
DESKTOP-450PEFP\mainc 2026-04-10 10:25:38 +08:00
commit 942de1c603
21 changed files with 3870 additions and 127 deletions

View File

@ -19,6 +19,8 @@
#define REPR_USHORT 9
#define REPR_UINT 10
#define REPR_ULONG 11
#pragma execution_character_set("utf-8")
void removeStr(char* sdes,QString b,QString e)
{
QString des=sdes;

View File

@ -1,5 +1,7 @@
#include "CStringType.h"
#include <QLabel>
#pragma execution_character_set("utf-8")
char *m_temp=NULL;
CString::CString(const char *str)
{

View File

@ -4455,10 +4455,11 @@ void PropertyWidget::changedPlObjectProperty(QString strProperty, QVariant varVa
variantMap["m_pl_dataType"] = this->m_formInfo->m_pl_dataType;
variantMap["m_pl_azimuthCurve"] = this->m_formInfo->m_pl_azimuthCurve;
variantMap["m_pl_inclinationCurve"] = this->m_formInfo->m_pl_inclinationCurve;
// 控制曲线
variantMap["m_pl_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
variantMap["m_pl_sectorCount"] = this->m_formInfo->m_pl_sectorCount;
variantMap["m_pl_circleRadius"] = this->m_formInfo->m_pl_circleRadius;
variantMap["m_pl_circleColor"] = this->m_formInfo->m_pl_circleColor;
@ -4600,9 +4601,8 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
}
else if ("刻度" == strProperty)
{
QFont temp = varVal.value<QFont>();
this->m_formInfo->m_pl_fontScale = temp;
this->m_formInfo->repaint();
this->m_formInfo->m_pl_fontScale = varVal.value<QFont>();
flag = true;
}
// 控制曲线
else if ("曲线名" == strProperty)
@ -4701,67 +4701,83 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
else if ("深度字段" == strProperty)
{
this->m_formInfo->m_rose_depth_field = varVal.toString();
flag = true;
}
else if ("方位字段" == strProperty)
{
this->m_formInfo->m_rose_azimuth_field = varVal.toString();
flag = true;
}
else if ("倾角字段" == strProperty)
{
this->m_formInfo->m_rose_dip_field = varVal.toString();
flag = true;
}
else if ("属性字段" == strProperty)
{
this->m_formInfo->m_rose_attribute_field = varVal.toString();
flag = true;
}
// 玫瑰图
else if ("扇形" == strProperty)
{
this->m_formInfo->m_rose_sector_enabled = varVal.toInt();
flag = true;
}
else if ("圆半径(cm)" == strProperty)
{
this->m_formInfo->m_rose_circle_radius_cm = varVal.toInt();
flag = true;
}
else if ("辐射圈" == strProperty)
{
this->m_formInfo->m_rose_radiation_circle_enabled = varVal.toInt();
flag = true;
}
else if ("方位打印间隔" == strProperty)
{
this->m_formInfo->m_rose_azimuth_print_interval = varVal.toInt();
flag = true;
}
else if ("圆线颜色" == strProperty)
{
this->m_formInfo->m_rose_circle_line_color = varVal.value<QColor>();
flag = true;
}
else if ("圆线宽度" == strProperty)
{
this->m_formInfo->m_rose_circle_line_width = varVal.toInt();
flag = true;
}
else if ("应力线颜色" == strProperty)
{
this->m_formInfo->m_rose_stress_line_color = varVal.value<QColor>();
flag = true;
}
else if ("垮塌线颜色" == strProperty)
{
this->m_formInfo->m_rose_collapse_line_color = varVal.value<QColor>();
flag = true;
}
else if ("绘制辐射线?" == strProperty)
{
this->m_formInfo->m_rose_draw_radiation_line = varVal.toBool();
flag = true;
}
else if ("绘制井眼垮塌" == strProperty)
{
this->m_formInfo->m_rose_draw_wellbore_collapse = varVal.toBool();
flag = true;
}
else if ("是否填充" == strProperty)
{
this->m_formInfo->m_rose_fill_enabled = varVal.toBool();
flag = true;
}
else if ("是否绘制标注?" == strProperty)
{
this->m_formInfo->m_rose_draw_annotation = varVal.toBool();
flag = true;
}
if(flag)
@ -4778,26 +4794,25 @@ void PropertyWidget::changedRoseProperty(QString strProperty, QVariant varVal)
variantMap["m_rose_azimuth_field"] = this->m_formInfo->m_rose_azimuth_field;
variantMap["m_rose_dip_field"] = this->m_formInfo->m_rose_dip_field;
variantMap["m_rose_attribute_field"] = this->m_formInfo->m_rose_attribute_field;
// 控制曲线
variantMap["m_pl_controlCurveName"] = this->m_formInfo->m_pl_controlCurveName;
variantMap["m_pl_controlMinValue"] = this->m_formInfo->m_pl_controlMinValue;
variantMap["m_pl_controlMaxValue"] = this->m_formInfo->m_pl_controlMaxValue;
variantMap["m_pl_sectorCount"] = this->m_formInfo->m_pl_sectorCount;
variantMap["m_pl_circleRadius"] = this->m_formInfo->m_pl_circleRadius;
variantMap["m_pl_circleColor"] = this->m_formInfo->m_pl_circleColor;
variantMap["m_pl_circleLineWidth"] = this->m_formInfo->m_pl_circleLineWidth;
variantMap["m_pl_isFillEnabled"] = this->m_formInfo->m_pl_isFillEnabled;
variantMap["m_pl_fillColor"] = this->m_formInfo->m_pl_fillColor;
// 线数
variantMap["m_pl_lineNumber"] = this->m_formInfo->m_pl_lineNumber;
variantMap["m_pl_lineHeight"] = this->m_formInfo->m_pl_lineHeight;
variantMap["m_pl_lineThickness"] = this->m_formInfo->m_pl_lineThickness;
variantMap["m_pl_lineColor"] = this->m_formInfo->m_pl_lineColor;
variantMap["m_pl_drawAnnotation"] = this->m_formInfo->m_pl_drawAnnotation;
variantMap["m_pl_drawHistogram"] = this->m_formInfo->m_pl_drawHistogram;
variantMap["m_pl_baselineWidth"] = this->m_formInfo->m_pl_baselineWidth;
variantMap["m_pl_baselineColor"] = this->m_formInfo->m_pl_baselineColor;
// 字体
variantMap["m_pl_fontScale"] = this->m_formInfo->m_pl_fontScale;
// 玫瑰图
variantMap["m_rose_sector_enabled"] = this->m_formInfo->m_rose_sector_enabled;
variantMap["m_rose_circle_radius_cm"] = this->m_formInfo->m_rose_circle_radius_cm;
variantMap["m_rose_radiation_circle_enabled"] = this->m_formInfo->m_rose_radiation_circle_enabled;
variantMap["m_rose_azimuth_print_interval"] = this->m_formInfo->m_rose_azimuth_print_interval;
variantMap["m_rose_circle_line_color"] = this->m_formInfo->m_rose_circle_line_color;
variantMap["m_rose_circle_line_width"] = this->m_formInfo->m_rose_circle_line_width;
variantMap["m_rose_stress_line_color"] = this->m_formInfo->m_rose_stress_line_color;
variantMap["m_rose_collapse_line_color"] = this->m_formInfo->m_rose_collapse_line_color;
variantMap["m_rose_draw_radiation_line"] = this->m_formInfo->m_rose_draw_radiation_line;
variantMap["m_rose_draw_wellbore_collapse"] = this->m_formInfo->m_rose_draw_wellbore_collapse;
variantMap["m_rose_fill_enabled"] = this->m_formInfo->m_rose_fill_enabled;
variantMap["m_rose_draw_annotation"] = this->m_formInfo->m_rose_draw_annotation;
// 统计间隔
variantMap["m_pl_statInterval"] = this->m_formInfo->m_pl_statInterval;
variantMap["m_pl_minInclination"] = this->m_formInfo->m_pl_minInclination;

View File

@ -376,10 +376,43 @@ void FormDraw::setDrawData(QStringList listdt, QJsonObject objInfo)
int dataType = pInfo->m_pl_dataType; // 数据类型
QString azimuthCurve = pInfo->m_pl_azimuthCurve; // 方位曲线
QString inclinationCurve = pInfo->m_pl_inclinationCurve; // 倾角曲线
// 表数据字段
QString m_rose_depth_field = pInfo->m_rose_depth_field; // 深度字段
QString m_rose_azimuth_field = pInfo->m_rose_azimuth_field; // 方位字段
QString m_rose_dip_field = pInfo->m_rose_dip_field; // 倾角字段
QString m_rose_attribute_field = pInfo->m_rose_attribute_field; // 属性字段
// 控制曲线
QString csCurveGrad = pInfo->m_pl_controlCurveName;
double LeftVal3 = pInfo->m_pl_controlMinValue;
double RightVal3 = pInfo->m_pl_controlMaxValue;
// 字体
QFont m_pl_fontScale = pInfo->m_pl_fontScale; // 刻度字体大小
// 玫瑰图
int m_rose_sector_enabled = pInfo->m_rose_sector_enabled; // 扇形(启用开关)
double m_rose_circle_radius_cm = pInfo->m_rose_circle_radius_cm; // 圆半径(cm)
m_rose_circle_radius_cm *= g_dPixelPerCm;
int m_rose_radiation_circle_enabled = pInfo->m_rose_radiation_circle_enabled; // 辐射圈(启用开关)
int m_rose_azimuth_print_interval = pInfo->m_rose_azimuth_print_interval; // 方位打印间隔
QColor m_rose_circle_line_color = pInfo->m_rose_circle_line_color; // 圆线颜色
int m_rose_circle_line_width = pInfo->m_rose_circle_line_width; // 圆线宽度
QColor m_rose_stress_line_color = pInfo->m_rose_stress_line_color; // 应力线颜色
QColor m_rose_collapse_line_color = pInfo->m_rose_collapse_line_color; // 垮塌线颜色
bool m_rose_draw_radiation_line = pInfo->m_rose_draw_radiation_line; // 绘制辐射线?
bool m_rose_draw_wellbore_collapse = pInfo->m_rose_draw_wellbore_collapse; // 绘制井眼垮塌
bool m_rose_fill_enabled = pInfo->m_rose_fill_enabled; // 是否填充
bool m_rose_draw_annotation = pInfo->m_rose_draw_annotation; // 是否绘制标注?
// 统计间隔
int m_pl_statInterval = pInfo->m_pl_statInterval;
double m_pl_minInclination = pInfo->m_pl_minInclination;
double m_pl_maxInclination = pInfo->m_pl_maxInclination;
// curv->drawRose(dataType, azimuthCurve, inclinationCurve);
curv->drawRose(dataType, azimuthCurve, inclinationCurve,
m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field,
csCurveGrad, LeftVal3, RightVal3, m_pl_fontScale,
m_rose_sector_enabled, m_rose_circle_radius_cm, m_rose_radiation_circle_enabled, m_rose_azimuth_print_interval, m_rose_circle_line_color,
m_rose_circle_line_width, m_rose_stress_line_color, m_rose_collapse_line_color, m_rose_draw_radiation_line, m_rose_draw_wellbore_collapse,
m_rose_fill_enabled, m_rose_draw_annotation,
m_pl_statInterval, m_pl_minInclination, m_pl_maxInclination);
}
else if("dcaObject" == strType)
{

View File

@ -235,7 +235,7 @@ public:
void initIMAGE_DATA(QMyCustomPlot *widget, QString strSlfName, QString strLineName, QStringList listOtherProperty={});
// bool LoadFromIMAGE_SLF(QMyCustomPlot *widget, QString strSlfName, QString strLineName);
//深度
// 深度
void initDepth(QMyCustomPlot *widget);
//频率统计图
void initFgrq(QMyCustomPlot *widget);

View File

@ -184,7 +184,24 @@ void FormInfo::initProperty(QJsonObject obj)
}
else if ("roseObject" == strType)
{
// this->m_pl_baselineColor = QColor(obj["m_pl_baselineColor"].toString()); // 颜色
// 表数据字段
this->m_rose_depth_field = obj["m_rose_depth_field"].toString(); // 深度字段
this->m_rose_azimuth_field = obj["m_rose_azimuth_field"].toString(); // 方位字段
this->m_rose_dip_field = obj["m_rose_dip_field"].toString(); // 倾角字段
this->m_rose_attribute_field = obj["m_rose_attribute_field"].toString(); // 属性字段
// 玫瑰图
this->m_rose_sector_enabled = obj["m_rose_sector_enabled"].toInt(); // 扇形(启用开关)
this->m_rose_circle_radius_cm = obj["m_rose_circle_radius_cm"].toInt(); // 圆半径(cm)
this->m_rose_radiation_circle_enabled = obj["m_rose_radiation_circle_enabled"].toInt(); // 辐射圈(启用开关)
this->m_rose_azimuth_print_interval = obj["m_rose_azimuth_print_interval"].toInt(); // 方位打印间隔
this->m_rose_circle_line_color = QColor(obj["m_rose_circle_line_color"].toString()); // 圆线颜色
this->m_rose_circle_line_width = obj["m_rose_circle_line_width"].toInt(); // 圆线宽度
this->m_rose_stress_line_color = QColor(obj["m_rose_stress_line_color"].toString()); // 应力线颜色
this->m_rose_collapse_line_color = QColor(obj["m_rose_collapse_line_color"].toString()); // 垮塌线颜色
this->m_rose_draw_radiation_line = obj["m_rose_draw_radiation_line"].toBool(); // 绘制辐射线?
this->m_rose_draw_wellbore_collapse = obj["m_rose_draw_wellbore_collapse"].toBool(); // 绘制井眼垮塌
this->m_rose_fill_enabled = obj["m_rose_fill_enabled"].toBool(); // 是否填充
this->m_rose_draw_annotation = obj["m_rose_draw_annotation"].toBool(); // 是否绘制标注?
}
if ("plObject" == strType || ("roseObject" == strType))

View File

@ -257,7 +257,7 @@ public:
double m_pl_controlMinValue = 0; // 控制最小值
double m_pl_controlMaxValue = 100; // 控制最大值
// 统计参数(频率统计图、玫瑰图)
int m_pl_statInterval = 10; // 统计间隔
int m_pl_statInterval = 20; // 统计间隔
double m_pl_minInclination = 0; // 最小倾角
double m_pl_maxInclination = 90; // 最大倾角
// 分类(频率统计图、玫瑰图)
@ -303,9 +303,9 @@ public:
QString m_rose_dip_field = "DIPorS"; // 倾角字段
QString m_rose_attribute_field = "ID"; // 属性字段
// 玫瑰图
int m_rose_sector_enabled = 36; // 扇形(启用开关)
int m_rose_sector_enabled = 36; // 扇形
int m_rose_circle_radius_cm = 1; // 圆半径(cm)
int m_rose_radiation_circle_enabled = 9; // 辐射圈(启用开关)
int m_rose_radiation_circle_enabled = 9; // 辐射圈
int m_rose_azimuth_print_interval = 3; // 方位打印间隔
QColor m_rose_circle_line_color = Qt::black; // 圆线颜色
int m_rose_circle_line_width = 2; // 圆线宽度

View File

@ -10007,6 +10007,7 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
QString csCurveGrad = variantMap["m_pl_controlCurveName"].toString();
double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble();
double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble();
int nArc = variantMap["m_pl_sectorCount"].toInt();
double nR = variantMap["m_pl_circleRadius"].toDouble();
QColor crArc = variantMap["m_pl_circleColor"].value<QColor>();
@ -10035,7 +10036,7 @@ void QMyCustomPlot::s_changePlObjectProperty(QVariantMap variantMap)
double maxInclination = variantMap["m_pl_maxInclination"].toDouble();
this->drawFgrq(dataType, azimuthCurve, inclinationCurve, csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill,
this->drawFgrq(bTableData, azimuthCurve, inclinationCurve, csCurveGrad, LeftVal3, RightVal3, nArc, nR, crArc, nArcLineWidth, bFill, crFill,
lineNumber, lineHeight, lineThickness, lineColor, drawAnnotation, drawHistogram, baselineWidth,
baselineColor, statInterval, minInclination, maxInclination);
}
@ -10070,14 +10071,11 @@ void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCu
return;
}
}
// double nR = 50;
QPen wPen(crArc, nArcLineWidth);
double centerX = this->m_iX2/2;
float flVal = 0.0f;
float x,y,x1,y1,x2,y2;
float ifdir[360];
float mind=min(RightVal , LeftVal);
float maxd=max(RightVal , LeftVal);
float dirmax,dipmax,dr;
@ -10085,21 +10083,17 @@ void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCu
float ftmpSdep = m_SDep;
float ftmpEdep = m_EDep;
if (m_bTableData)
{
// ReadFracDef();
for (int i = 0 ; i < iFracType ; i++)
{
m_bTypeDraw[i] = true;
}
ftmpSdep = -m_iY2;
ftmpEdep = -m_iY1;
}
int nPointNum = m_FracTabList.count();
int n = m_FracDefList.count();
int tmp = ftmpSdep / nstep;
@ -10231,7 +10225,7 @@ void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCu
}
}
int iIndex;
int iIndex;
flVal = 3.1415926535 *2./ nArc ;
dirmax=0; dipmax=0;
for(i=0;i<=nArc;i++)
@ -10241,7 +10235,6 @@ void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCu
dirmax=ifdir[i];
}
if (dirmax == 0 )
dirmax=1;
for(i=0;i<=nArc;i++)
@ -10249,10 +10242,8 @@ void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCu
// ifdir[i]=ifdir[i]*(nRadius-GetLineWidth(pDC,m_nArcLineWidth/2.))/dirmax;//-m_nArcLineWidth/2.whp add 2016.10.21 for线粗时扇叶超界
ifdir[nArc+1]=ifdir[1];
//方位频率
float x0,y0;
x = centerY;
y = centerX;
for(int i=0;i<=nArc;i++)
@ -10282,24 +10273,16 @@ void QMyCustomPlot::drawFgrq (bool bTableData, QString csCurveDDIR, QString csCu
myPolygon << QPointF(0, 0);
pol->setPoints(myPolygon);
}
// QCPItemRect* prt = new QCPItemRect(this);
// prt->topLeft->setCoords(x, y);
// prt->bottomRight->setCoords(x, y);
}
//float ifdir[360], int iIndex, float dirmax
if(drawAnnotation)
{
this->drawDipAngle(centerX, centerY, ifdir, dirmax, lineNumber, lineHeight, lineThickness, lineColor,
drawHistogram, baselineWidth, baselineColor, LeftVal, RightVal);
}
flDep += nstep;
}
this->replot();
}
@ -10336,7 +10319,6 @@ void QMyCustomPlot::drawDipAngle(double centerX, double centerY, float ifdir[360
for (int i = 0; i < lineNumber; ++i)
{
double currY = startX - i * step;
// 🔥🔥🔥 核心每个刻度单独计算长度和你GDI完全一样每个长度不同
double dynamicLen = 0.1 * ifdir[i] / dirmax + lineHeight;
@ -10556,7 +10538,7 @@ void QMyCustomPlot::s_changeRoseProperty(QVariantMap variantMap)
bool bTableData = false;
if(dataType == 1)
{
dataType = true;
bTableData = true;
}
QString azimuthCurve = variantMap["m_pl_azimuthCurve"].toString();
QString inclinationCurve = variantMap["m_pl_inclinationCurve"].toString();
@ -10565,67 +10547,83 @@ void QMyCustomPlot::s_changeRoseProperty(QVariantMap variantMap)
QString m_rose_azimuth_field = variantMap["m_rose_azimuth_field"].toString();
QString m_rose_dip_field = variantMap["m_rose_dip_field"].toString();
QString m_rose_attribute_field = variantMap["m_rose_attribute_field"].toString();
// 控制曲线
QString csCurveGrad = variantMap["m_pl_controlCurveName"].toString();
double LeftVal3 = variantMap["m_pl_controlMinValue"].toDouble();
double RightVal3 = variantMap["m_pl_controlMaxValue"].toDouble();
// 字体
QFont m_pl_fontScale = variantMap["m_pl_fontScale"].value<QFont>();
// 玫瑰图
int m_rose_sector_enabled = variantMap["m_rose_sector_enabled"].toInt();
double m_rose_circle_radius_cm = variantMap["m_rose_circle_radius_cm"].toInt();
m_rose_circle_radius_cm *= g_dPixelPerCm;
int m_rose_radiation_circle_enabled = variantMap["m_rose_radiation_circle_enabled"].toInt();
int m_rose_azimuth_print_interval = variantMap["m_rose_azimuth_print_interval"].toInt();
QColor m_rose_circle_line_color = variantMap["m_rose_circle_line_color"].value<QColor>();
int m_rose_circle_line_width = variantMap["m_rose_circle_line_width"].toInt();
QColor m_rose_stress_line_color = variantMap["m_rose_stress_line_color"].value<QColor>();
QColor m_rose_collapse_line_color = variantMap["m_rose_collapse_line_color"].value<QColor>();
bool m_rose_draw_radiation_line = variantMap["m_rose_draw_radiation_line"].toBool();
bool m_rose_draw_wellbore_collapse = variantMap["m_rose_draw_wellbore_collapse"].toBool();
bool m_rose_fill_enabled = variantMap["m_rose_fill_enabled"].toBool();
bool m_rose_draw_annotation = variantMap["m_rose_draw_annotation"].toBool();
// 统计间隔
int m_pl_statInterval = variantMap["m_pl_statInterval"].toInt();
double m_pl_minInclination = variantMap["m_pl_minInclination"].toDouble();
double m_pl_maxInclination = variantMap["m_pl_maxInclination"].toDouble();
this->drawRose(bTableData, azimuthCurve, inclinationCurve,
m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field);
m_rose_depth_field, m_rose_azimuth_field, m_rose_dip_field, m_rose_attribute_field,
csCurveGrad, LeftVal3, RightVal3, m_pl_fontScale,
m_rose_sector_enabled, m_rose_circle_radius_cm, m_rose_radiation_circle_enabled, m_rose_azimuth_print_interval, m_rose_circle_line_color,
m_rose_circle_line_width, m_rose_stress_line_color, m_rose_collapse_line_color, m_rose_draw_radiation_line, m_rose_draw_wellbore_collapse,
m_rose_fill_enabled, m_rose_draw_annotation,
m_pl_statInterval, m_pl_minInclination, m_pl_maxInclination);
}
void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID)
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID,
QString csCurveGrad, double m_LeftVal3, double m_RightVal3, QFont m_pl_fontScale,
int m_nArc, int nR, int m_nCircle, int m_nAzimStep, QColor m_rose_circle_line_color,
int m_rose_circle_line_width, QColor m_rose_stress_line_color, QColor m_rose_collapse_line_color, bool m_bGrid, bool m_bJykt,
bool m_rose_fill_enabled, bool m_bHint, int nstep, float m_LeftVal, float m_RightVal)
{
// 这个是防止读取为错误 导致软件闪退 读取失败返回false直接退出
bool flag = true;
this->clearGraphs();
this->clearItems();
double m_LeftVal = 0.0f;
double m_RightVal = 90.0f;
// if(m_Value == NULL)
{
m_bTableData = bTableData; // 表格 曲线
m_csCurveDDIR = csCurveDDIR; // 方位曲线
m_csCurveDANG = csCurveDANG; //倾角曲线
m_csCurveGrad = "GRAD";
m_qsDepth="DEPT"; // 深度字段
m_qsDIR="DDIR"; // 方位字段
m_qsDIP="DANG";// 倾角字段
m_qsID = "ID";
m_csCurveGrad = csCurveGrad;
m_qsDepth= qsDepth; // 深度字段
m_qsDIR= qsDIR; // 方位字段
m_qsDIP= qsDIP;// 倾角字段
m_qsID = qsID;
m_qsTable="FRAC_HOLE.TABLE";
flag = Refurbish();
if(!flag)
{
return;
}
}
double nR = 40;
QPen wPen(Qt::black, 2);
QPen wPen(m_rose_circle_line_color, 2);
double centerX = this->m_iX2/2;
float flVal = 0.0f;
float x,y,x1,y1,x2,y2;
float ifdir[360];
int m_nArc = 36;
float m_LeftVal3 = 0;
float m_RightVal3 = 100.0;
m_LeftVal = 0.0f;
m_RightVal = 90.0f;
float mind=min(m_RightVal , m_LeftVal);
float maxd=max(m_RightVal , m_LeftVal);
float dirmax,dipmax,dr;
float deps;
float ftmpSdep = 2890;//m_SDep;
float ftmpEdep = m_EDep;
if (m_bTableData)
{
ReadFracDef();
@ -10636,23 +10634,17 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
ftmpSdep = -m_iY2;
ftmpEdep = -m_iY1;
m_rose_fill_enabled = false;
m_bJykt = false;
}
int nPointNum = m_FracTabList.count();
int n = m_FracDefList.count();
int nstep = 5;
int tmp = ftmpSdep / nstep;
float flDep = tmp * nstep;
double pi = 3.1415926535;
// 射线
bool m_bGrid = true;
// 井眼垮塌
bool m_bJykt = true;
// 标注
bool m_bHint = true;
int m_nAzimStep = 3;
m_Curve.DepLevel = 0.5;
while ( 1)
{
@ -10661,15 +10653,16 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
double tempf = flDep+(float)(nstep)/2.;
double centerY = tempf * -1.0;
wPen.setWidth(2);
wPen.setColor(Qt::black);
// 最外层圆
QCPItemEllipse* pEse = new QCPItemEllipse(this);
wPen.setWidth(m_rose_circle_line_width);
pEse->setPen(wPen);
pEse->m_bCustom = true;
pEse->m_nRadius = nR;
pEse->topLeft->setCoords(centerY, centerX);
pEse->bottomRight->setCoords(centerY, centerX);
// 圆里面的十字
for(int k = 0; k < 4; k++)
{
QCPItemLine* pLine1 = new QCPItemLine(this);
@ -10683,9 +10676,9 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
}
// 写标注
if ( m_bHint )
if (m_bHint)
{
int psize = 10;
int psize = 15;
flVal = m_nAzimStep*360./m_nArc;
for (int i=0 ;i<360; i+=(int)(flVal))
{
@ -10693,21 +10686,19 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
mItemTitle->position->setCoords(centerY,centerX);
mItemTitle->setText(QString::number(i));
//mItemTitle->setBrush(QBrush(Qt::red));
mItemTitle->setFont(QFont("Arial", 10));
mItemTitle->setColor(Qt::black);
mItemTitle->setFont(m_pl_fontScale);
mItemTitle->setColor(m_rose_circle_line_color);
dr = i*2* 3.1415926535/ 360.;
mItemTitle->m_fx = (nR+psize*0.85)*sin(dr);
mItemTitle->m_fy = (nR+psize*0.85)*cos(dr);
mItemTitle->m_bCustom = true;
}
}
// 画辐射线
if(m_bGrid)
{
wPen.setWidth(1);
double st = 360/m_nArc;
for(int i = 0; i < m_nArc; i++)
{
@ -10726,6 +10717,22 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
}
}
// 画辐射圈
if (m_bGrid)
{
qreal currentRadius = 0;
for (int i = 0; i < m_nCircle; i++)
{
QCPItemEllipse* pEse = new QCPItemEllipse(this);
pEse->setPen(wPen);
pEse->m_bCustom = true;
currentRadius -= nR / m_nCircle;
pEse->m_nRadius = currentRadius;
pEse->topLeft->setCoords(centerY, centerX);
pEse->bottomRight->setCoords(centerY , centerX );
}
}
for(int i=0;i<=m_nArc;i++) ifdir[i]=0.;
x1 = 360./m_nArc;
@ -10839,7 +10846,15 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
if(m_rose_fill_enabled)
{
m_rose_stress_line_color.setAlpha(255);
}
else
{
m_rose_stress_line_color.setAlpha(0);
}
pol->setBrushColor(QColor(m_rose_stress_line_color));
}
myPolygon.clear();
@ -10872,6 +10887,7 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
oldy = y2;
}
}
// 垮塌线
if (iIndex >=0/*&&m_bFill*/ )
{
x = centerY;
@ -10880,10 +10896,9 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
pol->topLeft->setCoords(x, y);
pol->bottomRight->setCoords(x, y);
pol->setPoints(myPolygon);
pol->setBrushColor(QColor(255,170,0));
pol->setBrushColor(QColor(m_rose_stress_line_color));
}
if ( m_bJykt && iIndex >=0 )
{
// 绘制垮塌方向
@ -10897,28 +10912,26 @@ void QMyCustomPlot::drawRose(bool bTableData, QString csCurveDDIR, QString csCur
x2 = ifdir[iIndex]*nR*sin(dr)/dirmax;
y2 = ifdir[iIndex]*nR*cos(dr)/dirmax;
wPen.setWidth(2);
wPen.setColor(QColor(0,85,255));
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), wPen);
QPen collapsePen(m_rose_collapse_line_color, 2);
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x2, y2), collapsePen);
dr=iIndex*flVal;
float x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
float y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), collapsePen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), collapsePen);
dr=iIndex*flVal;
dr = dr-pi;//18*flVal;//m1_nArc*flVal/2;
x3 = 0.1*ifdir[iIndex]*nR*sin(dr)/dirmax;
y3 = 0.1*ifdir[iIndex]*nR*cos(dr)/dirmax;
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), wPen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x1, y1), QPointF(x3, y3), collapsePen);
this->addQCPItemLine(this, centerY,centerX, QPointF(x3, y3), QPointF(x2, y2), collapsePen);
}
flDep += nstep;
}
this->replot();
}
void QMyCustomPlot::addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen)

View File

@ -656,8 +656,14 @@ public:
bool ReadData(QString strSlfName, QString strLineName, int iCurve, Slf_CURVE *curve);
bool ReadData(QString strSlfName, QString strLineName);
//
void drawRose(bool bTableData, QString csCurveDDIR, QString csCurveDANG,
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID);
QString qsDepth, QString qsDIR, QString qsDIP, QString qsID,
QString csCurveGrad, double m_LeftVal3, double m_RightVal3, QFont m_pl_fontScale,
int m_nArc, int m_rose_circle_radius_cm, int m_rose_radiation_circle_enabled, int m_rose_azimuth_print_interval, QColor m_rose_circle_line_color,
int m_rose_circle_line_width, QColor m_rose_stress_line_color, QColor m_rose_collapse_line_color, bool m_rose_draw_radiation_line, bool m_rose_draw_wellbore_collapse,
bool m_rose_fill_enabled, bool m_rose_draw_annotation, int nstep, float m_LeftVal, float m_RightVal);
void addQCPItemLine(QMyCustomPlot *widget, float cx, float cy, const QPointF& p1, const QPointF& p2, const QPen& wPen);
private:

View File

@ -58,22 +58,28 @@ void QMyTreeWidget::closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEd
return;
}
QString strTreeTag = item->data(0, Qt::UserRole).toString();
CObjWellLog* pcopyingwelllog= new CObjWellLog();
pcopyingwelllog->SetSlfFileName(strSlfName);
pcopyingwelllog->SetName(strOldName);
if(!pcopyingwelllog->RenName(strNewName))
{
this->currentItem()->setText(0,strOldName);
if (strTreeTag != "wellItem" && strTreeTag != "wellname")//重命名表格、曲线、波列、参数表
{
CObjWellLog* pcopyingwelllog= new CObjWellLog();
pcopyingwelllog->SetSlfFileName(strSlfName);
pcopyingwelllog->SetName(strOldName);
if(!pcopyingwelllog->RenName(strNewName))
{
this->currentItem()->setText(0,strOldName);
// pObj->SetName(strOldName);
// AfxMessageBox("无法改名,可能因重名等问题所致!");
QMessageBox::information(NULL, "提示", "无法改名,可能因重名等问题所致!");
}
//else {
//::GetObjectEvent().OnDeAttchData(pObj->GetSlfFileName(),strOldName);
//::GetObjectEvent().OnRefreshData(pObj->GetSlfFileName(),strNewName);
//}
delete pcopyingwelllog;
item->setData(0, Qt::UserRole + 3, strNewName); // 存储额外数据,波列卡
//else {
//::GetObjectEvent().OnDeAttchData(pObj->GetSlfFileName(),strOldName);
//::GetObjectEvent().OnRefreshData(pObj->GetSlfFileName(),strNewName);
//}
delete pcopyingwelllog;
item->setData(0, Qt::UserRole + 3, strNewName); // 存储额外数据,波列卡
}
if (strTreeTag == "wellItem" || strTreeTag == "wellname")//井次或井名
emit closeTreeEditor();
return;
}
void QMyTreeWidget::startDrag(Qt::DropActions supportedActions)

View File

@ -18,6 +18,9 @@ public:
~QMyTreeWidget();
QString getCurrentItemString();
Q_SIGNALS:
void closeTreeEditor();
protected:
virtual void startDrag(Qt::DropActions supportedActions);
virtual void closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint );

View File

@ -11,6 +11,7 @@
#include "InDefTableDlg.h"
#include "qtcommonclass.h"
#include "CallManage.h"
#include "qmytreewidget.h"
//
#include "geometryutils.h"
#include "LogIO.h"
@ -60,6 +61,8 @@ QtProjectWidgets::QtProjectWidgets(QWidget *parent)
//为树 tree 创建信号槽鼠标press时会触发对应的信号。
connect(ui->treeWidget, &QTreeWidget::itemPressed, this, &QtProjectWidgets::onItemClicked);
connect(ui->treeWidget, SIGNAL(closeTreeEditor()), this, SLOT(oncloseTreeEditor()));
//connect(ui->treeWidget, &QTreeWidget::itemChanged, this, &QtProjectWidgets::onItemChanged);
// 设置选择模式为多选模式
@ -90,6 +93,22 @@ void QtProjectWidgets::slotButtonNo()
m_ReFlag=QDialogButtonBox::StandardButton::No;
}
void QtProjectWidgets::slotAsendSort()
{
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
pItem->sortChildren(0,Qt::AscendingOrder);
}
}
void QtProjectWidgets::slotDesendSort()
{
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
pItem->sortChildren(0,Qt::DescendingOrder);
}
}
////初始化树图控件
//void QtProjectWidgets::initTreeWidget(QString fullPath, QString strProjectName)
//{
@ -351,6 +370,7 @@ void QtProjectWidgets::loadIndexSysTree(QTreeWidgetItem *parent, QString fileFul
itemIndex->setText(0, wellname);
itemIndex->setData(0, Qt::UserRole, "wellname"); // 存储额外数据如ID
itemIndex->setData(0, Qt::UserRole + 1, wellFile1); // 存储额外数据,项目名
itemIndex->setData(0, Qt::UserRole + 2, wellname); // 存储额外数据,井名
//
QIcon icon;
icon.addPixmap(QPixmap(GetImagePath() + "well.png"), QIcon::Selected);
@ -873,6 +893,11 @@ void QtProjectWidgets::initWellNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onEditWelllogRound()));
menu->addAction(action_New);
QAction* action_ReName = new QAction("重命名", treeWidget);
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
menu->addAction(action_ReName);
action_New = new QAction("输出数据", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/outcurves.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onOutWellLogRound()));
@ -914,6 +939,11 @@ void QtProjectWidgets::initSlfNameTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onWelllogInformation()));
menu->addAction(action_New);
QAction* action_ReName = new QAction("重命名", treeWidget);
action_ReName->setIcon(QIcon(GetImagePath() + "icon/Rename.png")); // 设置图标":/image/u174.png"
connect(action_ReName, SIGNAL(triggered()), this, SLOT(onReNameObject()));
menu->addAction(action_ReName);
menu->addAction(m_action_Paste);
//
@ -934,6 +964,16 @@ void QtProjectWidgets::initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWid
QAction* action_New = new QAction("创建新表", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/CreateTable.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(onCreateNewTable()));
menu->addAction(action_New);
action_New = new QAction("升序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
menu->addAction(action_New);
action_New = new QAction("降序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
menu->addAction(action_New);
menu->addAction(m_action_Paste);
@ -941,16 +981,46 @@ void QtProjectWidgets::initTableFolderTreeMenu(QMenu *menu, QTreeWidget *treeWid
//初始化根节点(曲线表目录)-右键菜单
void QtProjectWidgets::initCurveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
QAction* action_New = new QAction("升序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
menu->addAction(action_New);
action_New = new QAction("降序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
menu->addAction(action_New);
menu->addAction(m_action_Paste);
}
//初始化根节点(参数卡目录)-右键菜单
void QtProjectWidgets::initParCardFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
QAction* action_New = new QAction("升序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
menu->addAction(action_New);
action_New = new QAction("降序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
menu->addAction(action_New);
menu->addAction(m_action_Paste);
}
//初始化根节点(波列目录)-右键菜单
void QtProjectWidgets::initWaveFolderTreeMenu(QMenu *menu, QTreeWidget *treeWidget)
{
QAction* action_New = new QAction("升序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/AscendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotAsendSort()));
menu->addAction(action_New);
action_New = new QAction("降序", treeWidget);
action_New->setIcon(QIcon(GetImagePath() + "icon/DescendingOrder.png")); // 设置图标
connect(action_New, SIGNAL(triggered(bool)), this, SLOT(slotDesendSort()));
menu->addAction(action_New);
menu->addAction(m_action_Paste);
}
//新建项目
@ -1763,16 +1833,24 @@ void QtProjectWidgets::onImportSingleWellLogData()
// InterfaceWidget *pInterfaceWidget = new InterfaceWidget();//中间工作区
// pMainWindow->m_centerWidgets->addTab(pInterfaceWidget, "导入数据");
pai::datamodel::LoadAllPlugin("windows");
QStringList listFiles;//=GetFileNames("选择数据文件",fileSuffix,QFileDialog::ExistingFiles);
QString file_name = QFileDialog::getOpenFileName(this,tr("打开测井数据文件"), "","*.txt", 0);
// listFiles.append(QString("D:/LogPlus/OutData/jph-307.txt"));
listFiles.append(file_name);
DiDepthProgress DepthProgress;
ConvertorManager::GetInstance().LoadAllConvertorPlugin();
ConvertorManager &pManager=ConvertorManager::GetInstance();
pManager.all=0;
QVector<QString>vSuffix=pManager.GetSupportFileExtensions();
QString fileSuffix("数据文件(");
for (int i=0;i<vSuffix.size();i++)
{
QString sSuffix="*.";
sSuffix.append(vSuffix[i]);
fileSuffix.append(sSuffix);
fileSuffix.append(" ");
}
fileSuffix.append(")");
QStringList listFiles;//=GetFileNames("选择数据文件",fileSuffix,QFileDialog::ExistingFiles);
QString file_name = QFileDialog::getOpenFileName(this,tr("打开测井数据文件"), "",fileSuffix/*"*.txt *"*/, 0);
// listFiles.append(QString("D:/LogPlus/OutData/jph-307.txt"));
listFiles.append(file_name);
QVector<IConvertor*> vConvertor=pManager.GetSupportConvertors(listFiles[0], &DepthProgress);
// if (vConvertor.empty()) return ;
if (vConvertor.empty())
@ -1982,7 +2060,7 @@ void QtProjectWidgets::onItemClicked(QTreeWidgetItem* item, int index)
else if (strTreeTag == "Curve")
{
//曲线数据-右键菜单
popMenu = _menuTableFolder;
popMenu = _menuCurveFolder;
m_strSlfName = item->parent()->data(0, Qt::UserRole+1).toString();//从父节点井次获取slf
}
@ -2030,6 +2108,116 @@ void QtProjectWidgets::onItemChanged(QTreeWidgetItem* item, int index)
// }
}
//勾选/不勾选树图节点
void QtProjectWidgets::oncloseTreeEditor()
{
QString newWellName,strTreeTag;
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
strTreeTag = pItem->data(0, Qt::UserRole).toString();
}
if(!m_strSlfName.isEmpty()&&strTreeTag == "wellItem")
{
QString path,Slfname, newSlfname;
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
QTreeWidgetItem *parentItem = pItem;
if (parentItem && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
{
newWellName = parentItem->parent()->text(0);
newSlfname = parentItem->text(0);
}
}
GetWellNameAndPath(m_strSlfName,Slfname,path);
// QString newfile=path+"/"+Slfname+"_backup.slf";
QString newfile=path+"/"+newSlfname+".slf";
if(!QFile::rename(m_strSlfName,newfile))
{
QMessageBox::information(NULL,"提示","重命名失败!");
return ;
}
}
else if (strTreeTag == "wellname")
{
QString path,strWellName,Wellpath, newWellpath;
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
{
QTreeWidgetItem *parentItem = pItem;
if (parentItem && "wellname" == parentItem->data(0, Qt::UserRole).toString())
{
strWellName = parentItem->data(0, Qt::UserRole + 2).toString();
newWellName = parentItem->text(0);
}
}
QString pathTmp=GetLogdataPath();
Wellpath = pathTmp + g_prjname+"/#"+strWellName;
newWellpath = pathTmp + g_prjname+"/#"+newWellName;
QDir ss;
if(ss.rename(Wellpath,newWellpath))//改目录名
{
QString oldPath = newWellpath + "/" + strWellName + ".well";
QString newPath = newWellpath + "/" + newWellName + ".well";
if(ss.rename(oldPath,newPath))
{
SetWellRoundWellName(newPath, newWellName);
QStringList slffiles;
chakan(newWellpath, slffiles, "*.slf");
foreach(QString slfFile1, slffiles )
{
SetWellRoundWellName(slfFile1, newWellName);
}
}
else
{
QMessageBox::warning(NULL,"提示","改目文件名不成功:\n"+oldPath+"\n\n"+newWellpath);
return;
}
}
else {
QMessageBox::warning(NULL,"提示","改目录名不成功:\n"+Wellpath+"\n\n"+newWellpath);
return;
}
}
QString strProjectFolder = GetProjectFolder();
QString strProjectFile = strProjectFolder + g_prjname;
strProjectFile += ".wwl";
s_OpenProject(strProjectFile);
int topCount = ui->treeWidget->topLevelItemCount(); // 获取顶级节点数量
if(topCount<1)
{
return;
}
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(0);
int childCount = item->childCount(); // 获取子节点数量
for (int i = 0; i < childCount; ++i)
{
//井组,数据分析...
QTreeWidgetItem *wellGroupItem = item->child(i);
QString wellGroupname = wellGroupItem->text(0);
if (wellGroupname == "井组")
{
int wellCount = wellGroupItem->childCount(); // 获取井节点数量
for (int j = 0; j < wellCount; ++j)
{
//井组,数据分析...
QTreeWidgetItem *wellItem = wellGroupItem->child(j);
QString wellname = wellItem->text(0);
if(wellname==newWellName)//井
{
wellItem->setExpanded(true);
}
}
}
}
}
//向左侧树图,追加固井结论表格
void QtProjectWidgets::s_AddGujingToTree(QString strSlfName, QString strWellName, QString strLineName)
{

View File

@ -23,16 +23,21 @@ public:
private:
Ui::QtProjectWidgetsClass *ui;
Q_SIGNALS:
void closeTreeEditor();
public slots:
void slotButtonOk();
void slotButtonNo();
void slotButtonCancel();
void slotAsendSort();
void slotDesendSort();
//void s_initTreeWidget(QString strName);//初始化树图控件
void s_loadTreeWidget(QString fileFull);//加载树图
void onItemClicked(QTreeWidgetItem* item, int index);//鼠标点击tree菜单项
void onItemChanged(QTreeWidgetItem* item, int index);//勾选/不勾选
void oncloseTreeEditor(); //重命名
//工区管理(项目)
void onNewProject(bool checked = false); //新建项目

View File

@ -21,6 +21,7 @@ SUBDIRS = \
ConvertorManager \
DataOutput \
SLFAscIIConvertor \
LISConvertor \
DrawBase \
EditPlotHeader \
logPlus
@ -44,6 +45,7 @@ appDllTest.file = appDllTest/src/appDllTest.pro
ConvertorManager.file = ConvertorManager/src/ConvertorManager.pro
DataOutput.file = DataOutput/src/DataOutput.pro
SLFAscIIConvertor.file = tran/SLFAscIIConvertor/src/SLFAsciiConvertor.pro
LISConvertor.file = tran/LISConvertor/src/LISConvertor.pro
DrawBase.file = DrawBase/src/DrawBase.pro
EditPlotHeader.file = EditPlotHeader/src/EditPlotHeader.pro
logPlus.file = logPlus/logPlus.pro
@ -64,6 +66,7 @@ appDllTest.depends = Slfio
ConvertorManager.depends = Slfio BaseFun OSGDataModel WellLogUI
DataOutput.depends = Slfio BaseFun ConvertorManager
SLFAscIIConvertor.depends = Slfio BaseFun OSGDataModel WellLogUI ConvertorManager
LISConvertor.depends = Slfio BaseFun OSGDataModel WellLogUI ConvertorManager
DrawBase.depends = Slfio
EditPlotHeader.depends = Slfio OSGDataModel
logPlus.depends = Slfio BaseFun WellLogUI qtpropertybrowser ConvertorManager OSGDataModel DataOutput HPluginManage CallPlugin DataMgr DrawBase ModuleConsole WFEngine EditPlotHeader

View File

@ -0,0 +1,166 @@
/**
* @file CStringTyle.h
* @brief CString数据自定义
* @date 2014-10-10
* @author: ZhouWenfei
*/
#ifndef PAI_FRAME_CSTRING_H__
#define PAI_FRAME_CSTRING_H__
#pragma once
#include <iostream>
#include <QString>
#include <QMessageBox>
#include <QDialogButtonBox>
#include <QDialog>
#include <QFormLayout>
#include <QTextEdit>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QPushButton>
#include <stdio.h>
#include <limits.h>
#pragma warning( push ,0)
//#include "BaseFunExport.h"
#pragma warning( pop )
//#ifdef MessageBox
//#define MessageBox MessageBox
//#endif
#define MAX_PATH 1024
//#define _MAX_PATH 1024
#define MaxCurve 1024
#define curve_name_len 256
#define curve_unit_len 256
#define MIN_RANK rank_char
#define MAX_RANK rank_longlong
#define INTMAX_RANK rank_longlong
#define SIZE_T_RANK rank_long
#define PTRDIFF_T_RANK rank_long
#define MB_OK QMessageBox::Ok
typedef unsigned short WORD;
#ifdef WIN32
typedef unsigned long DWORD;
typedef DWORD *LPDWORD;
typedef void *HANDLE;
#else
typedef unsigned int DWORD;
typedef DWORD *LPDWORD;
typedef void *HANDLE;
#endif
typedef unsigned char BYTE;
typedef char* LPSTR;
typedef void* LPVOID;
class CString;
typedef QList<CString> CStringList;
using namespace std;
//#define REPR_INT 1
//#define REPR_SHORT 2
//#define REPR_LONG 3
//#define REPR_FLOAT 4
//#define REPR_DOUBLE 5
//#define REPR_STRING 6
//#define REPR_CHAR 7
//#define REPR_UCHAR 8
//#define REPR_USHORT 9
//#define REPR_UINT 10
//#define REPR_ULONG 11
//class BASEFUN_EXPORT CString;
//构建CString
class CString
{
public:
CString(const char *str = nullptr);
CString(const QString str);
CString(const CString &other);
~CString();
int GetLength()const;
int Find(char *str);
int Find(char str);
int Find(CString &another);
int Find(char str[],int start);
int ReverseFind(char ch);
int Insert(int pos ,const CString Sctr);
int Replace(const char *Src,const char *Dest);
CString & TrimLeft();
CString & MakeUpper();
CString& MakeLower();
CString & TrimRight();
bool operator==(const char* other );
bool operator!=(const char* other );
bool operator==(const CString& other );
bool operator!=(const CString& other );
char operator[](int i);
CString Right(int count)const;
CString Left(int count)const;
// CString operator = (const QString& SrcStr) ;
CString operator + (const CString& SrcStr) ;
CString operator += (CString& SrcStr) ;
CString operator += (const CString& SrcStr) ;
char* GetString()const;
char GetChar(int n);
char GetAt(int n);
CString Mid(int pos,int count)const;
CString Mid(int pos)const;
void Format(const char *format,...);
void Delete(int fromIndex,int length);
// const char *m_temp;
void Alloc(int len);
void Empty();
private:
QString m_data;
};
enum flags {
FL_SPLAT0 = 0x00,/* Drop the value, do not assign */
FL_SPLAT = 0x01,/* Drop the value, do not assign */
FL_INV = 0x02,/* Character-set with inverse */
FL_WIDTH = 0x04,/* Field width specified */
FL_MINUS = 0x08,/* Negative number */
};
enum ranks {
rank_char = -2,
rank_short = -1,
rank_int = 0,
rank_long = 1,
rank_longlong = 2,
rank_ptr = INT_MAX/* Special value used for pointers */
};
enum bail {
bail_none = 0,/* No error condition */
bail_eof,/* Hit EOF */
bail_err/* Conversion mismatch */
};
int AfxMessageBox(CString str);
int MessageBox(QWidget *parent,char lpText[128],char*lpCaption, int UINTuType);
void ShowMessage(QString mess);
//构建AfxMessageBox()函数
//extern int BASEFUN_EXPORT AfxMessageBox(CString str);
//extern int BASEFUN_EXPORT MessageBox(QWidget *parent,char lpText[128],char*lpCaption, int UINTuType);
// using namespace pai::graphics;
#endif

View File

@ -0,0 +1,64 @@
/**
* @file CLisConvertor.h
* @brief LisConvertor格式解析器Forward的txt格式文件
* @date 2014-7-29
* @author: ZhouWenfei
*/
#ifndef PAI_FRAME_FOWWARDCONVERTOR_H__
#define PAI_FRAME_FOWWARDCONVERTOR_H__
#pragma warning( push ,0)
#include "IConvertor.h"
#include "ConvertorManager.h"
#include "ObjectID.h"
#include "InterIConvertor.h"
#pragma execution_character_set("utf-8")
#pragma warning( pop )
BEGIN_OSGGRAPHICS_NAMESPACE;
class CLisConvertor :public InterIConvertor
{
public:
CLisConvertor();
~CLisConvertor();
public:
virtual int ScanLogFile(char *FileName,char *Message,char **CurveName,char **CurveUnit);
virtual bool Transfer(char *FileName,char *outfile,int *OutCurveNo,char **OutCurve,char **strChineseName,char **strUnit,int dCurveNum);
/**
* @brief
* @return QVector<QString> this convertor support all suffix file
*/
virtual QVector<QString>GetSupportFileExtensions();
private:
/**
* @brief
*/
virtual void InitFormatSuffixName();
private:
bool isSpLis;
int ngapbyteSpFirst;
private:
QVector<QString>m_vFileFormatSuffixName;
QVector<QString>m_vCurvefileName;
};
END_OSGGRAPHICS_NAMESPACE
using namespace pai::graphics;
#endif

View File

@ -0,0 +1,326 @@
#include "CStringType.h"
#include <QLabel>
char *m_temp=NULL;
CString::CString(const char *str)
{
m_temp=NULL;
if(str==NULL)
m_data ="";
else
m_data=QString::fromLocal8Bit(str);
}
CString::CString(const QString str)
{
m_temp=NULL;
if(str==NULL)
m_data ="";
else
m_data=str;
}
CString::~CString()
{
if(m_temp) delete m_temp;
m_temp=NULL;
};
void CString::Empty()
{
m_data ="";
}
CString::CString(const CString &other)
{
m_temp=NULL;
m_data=other.m_data;
}
int CString::GetLength()const
{
return m_data.length();
}
int CString::Find(char *str)
{
std::string dataStr=m_data.toStdString();
return dataStr.find(str);
}
int CString::Find(CString &another)
{
return m_data.toStdString().find(another.m_data.toStdString());
}
int CString::Find(char str)
{
std::string dataStr=m_data.toStdString();
return dataStr.find(str);
}
/*
*/
int CString::Find(char str[],int start)
{
std::string dataStr=m_data.toStdString();
int npos=dataStr.find(str);
if(npos==-1)
return -1;
if(npos<start)
return -1;
return dataStr.find(str);
}
int CString::ReverseFind(char ch)
{
int index=m_data.lastIndexOf(ch);
return index;
}
int CString::Insert(int pos ,const CString Sctr)
{
m_data.insert(pos,Sctr.m_data);
return m_data.length();
}
int CString::Replace(const char *Src,const char *Dest)
{
int length=((std::string)Src).length();
QString srcStr=QString::fromLocal8Bit(Src);
QString destStr=QString::fromLocal8Bit(Dest);
m_data.replace(srcStr,destStr);
return length;
}
void CString::Delete(int fromIndex,int length)
{
m_data=m_data.remove(fromIndex,length);
}
CString & CString::TrimLeft()
{
std::string findStr=" ";
std::string tempstr=m_data.toStdString();
QString temp=m_data;
vector<char>StrVector;
int left=0;
for (int i=0;i<tempstr.length();i++)
{
if(tempstr.at(i)==findStr.at(0)) {
left++;
continue;
}
else break;
}
m_data=temp.mid(left);
return *this;
}
CString & CString::MakeUpper()
{
m_data=m_data.toUpper();
return *this;
}
CString& CString::MakeLower()
{
m_data=m_data.toLower();
return *this;
}
CString & CString::TrimRight()
{
std::string findStr=" ";
std::string tempstr=m_data.toStdString();
QString temp=m_data;
int flag=0;
for (int i=tempstr.length()-1;i>-1;i--)
{
if(tempstr[i]==findStr.at(0)) {
continue;
}
else {
flag=i;
break;
}
}
m_data=temp.left(flag+1);
return *this;
}
bool CString::operator==(const char* other )
{
QString srcStr=QString::fromLocal8Bit(other);
if(this->m_data==srcStr)
return true;
return false;
}
bool CString::operator!=(const char* other )
{
QString srcStr=QString::fromLocal8Bit(other);
if(this->m_data!=srcStr)
return true;
return false;
}
char CString::operator[](int i)
{
char ch=GetChar(i);
return ch;
}
CString CString::Right(int count)const
{
if (count<0)
{
count=0;
}
if (count>m_data.length())
{
return *this;
}
int length=m_data.length();
QString temp=m_data;
QString lastdata=temp.remove(0,length-count);
CString RightStr(lastdata);
return RightStr;
}
CString CString::Mid(int pos,int count)const
{
if (count<0)
{
count=0;
}
QString temp=m_data.mid(pos,count);
CString mstr(temp);
return mstr;
}
CString CString::Mid(int pos)const
{
QString temp=m_data.mid(pos);
CString mstr(temp);
return mstr;
}
CString CString::Left(int count)const
{
if (count<0)
{
count=0;
}
if (count>m_data.length())
{
return *this;
}
int length=m_data.length();
QString temp=m_data;
QString lastdata=temp.remove(count,length-count);
CString leftStr(lastdata);
return leftStr;
}
CString CString::operator + (const CString& SrcStr)
{
CString str;
str.m_data=m_data+SrcStr.m_data;
return str;
}
/*
CString CString::operator = (const QString& SrcStr)
{
CString str;
str.m_data=SrcStr;
return str;
}
*/
CString CString::operator += (CString& SrcStr)
{
m_data = m_data+SrcStr.m_data ;
return *this;
}
CString CString::operator += (const CString& SrcStr)
{
m_data = m_data+SrcStr.m_data ;
return *this;
}
bool CString::operator!=(const CString& other )
{
return m_data!=other.m_data;
}
bool CString::operator==(const CString& other )
{
return m_data==other.m_data;
}
void CString::Alloc(int len)
{
}
char* CString::GetString() const
{
int length=((string)(m_data.toLocal8Bit().data())).length();
if(m_temp) delete m_temp;
m_temp=new char[length+1];
// Alloc(length);
strcpy(m_temp,m_data.toLocal8Bit().data());
return m_temp;
}
char CString::GetChar(int n)
{
return GetString()[n];
}
char CString::GetAt(int n)
{
return GetChar(n);
}
void CString::Format(const char *format,...)
{
//char *str=GetString();
va_list args;
va_start(args,format);
m_data.vsprintf(format,args);
char *buf=new char[2*strlen(m_data.toStdString().c_str())+1];
vsprintf(buf,format,args);
m_data=buf;
delete buf;
va_end(args);
}
void ShowMessage(QString mess)
{
QDialog dialog(NULL);
dialog.setModal(false);
Qt::WindowFlags flags = dialog.windowFlags();
flags |= Qt::WindowStaysOnTopHint;
flags &= ~Qt::WindowContextHelpButtonHint;
dialog.setWindowFlags(flags);
dialog.setWindowTitle("提示");
QFormLayout form(&dialog);
QLabel edit(&dialog);
form.addRow(&edit);
edit.setText(mess);
// QDialogButtonBox buttonBox(QDialogButtonBox::Yes,Qt::Horizontal, &dialog);
// form.addRow(&buttonBox);
// if(buttonBox.button(QDialogButtonBox::Yes)) buttonBox.button(QDialogButtonBox::Yes)->setText("退出");
// QObject::connect(buttonBox.button(QDialogButtonBox::Yes), SIGNAL(clicked()), NULL, SLOT(reject()));
dialog.show();
dialog.exec();
}
int AfxMessageBox(CString str)
{
QDialog dialog(NULL);
dialog.setModal(false);
Qt::WindowFlags flags = dialog.windowFlags();
flags |= Qt::WindowStaysOnTopHint;
flags &= ~Qt::WindowContextHelpButtonHint;
dialog.setWindowFlags(flags);
dialog.setWindowTitle("提示");
QFormLayout form(&dialog);
form.addWidget(new QLabel(str.GetString()));
// dialog.show();
if (dialog.exec() == QDialog::Accepted) {
// Do something here
}
// return MessageBox(NULL,"提示",str.GetString(),NULL );
// QString cstr=str.GetString();
// QMessageBox msgBox;
// msgBox.setText(cstr);
// return msgBox.exec();
return 1;
}
int MessageBox(QWidget *parent,char lpText[128],char*lpCaption, int UINTuType)
{
if (!parent)
{
char *tempName=lpCaption;
QString addStr=QString::fromLocal8Bit(tempName);
return QMessageBox::information(NULL,lpText,addStr,QMessageBox::Ok);
}
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
TEMPLATE = lib
TARGET = LisConvertor
QT += core \
gui \
opengl\
INCLUDEPATH += $(OSGHOME)/include \
../include \
../../OSGParts/include \
../../../WellLogUI/include \
../../../OSGFramework/include \
../../../common\
../../../BaseFun/include\
../../../Slfio/include\
../../../ConvertorManager/include\
../../../OSGDataModel/include\
./GeneratedFiles
#include(../../OSGDataModel/paiobjectmodel.libinfo)
HEADERS += ../include/*.h \
../../../common/geometryutils.h
SOURCES += *.cpp \
../../../common/geometryutils.cpp
OBJECTS_DIR = ../obj
DESTDIR = ../bin
CONFIG += qt \
debug_and_release
DEFINES += QT_DLL
CONFIG(debug, debug|release){
LIBS += -L$$PWD/../../../Bin -lOSGDataModeld
LIBS += -L$$PWD/../../../Bin -lBaseFund
LIBS += -L$$PWD/../../../Bin -lslfiod
LIBS += -L$$PWD/../../../Bin -lWellLogUId
LIBS += -L$$PWD/../../../Bin -lConvertorManagerd
} else {
LIBS += -L$$PWD/../../../BinR -lOSGDataModel
LIBS += -L$$PWD/../../../BinR -lBaseFun
LIBS += -L$$PWD/../../../BinR -lslfio
LIBS += -L$$PWD/../../../BinR -lWellLogUI
LIBS += -L$$PWD/../../../BinR -lConvertorManager
}
#include(../../OSGParts/src/osg.LibInfo)
#LIBS += -lOSGParts \
# -L../../OSGParts/bin
#LIBS += -lOSGFramework \
# -L../../OSGFramework/bin
#LIBS += -L$$(PAI_HOME)/lib -lOSGDataModel
#LIBS += -L$$(PAI_HOME)/lib -lConvertorManager
#RESOURCES +=
#QMAKE_POST_LINK = cp ../bin/*.* /opt/pi/bin
#QMAKE_POST_LINK = cp ../bin/*.so $(PAI_HOME)/lib/
CONFIG(debug, debug|release){
DESTDIR = $$PWD/../../../Bin/convertor
TARGET = $$join(TARGET,,,d) #为debug版本生成的文件增加d的后缀
} else {
DESTDIR = $$PWD/../../../BinR/convertor
TARGET = $$join(TARGET,,,)
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
#include "MemRdWt.h"/*..\..\Slfio\*/
#include "BaseFun.h"
#include "math.h"
void Test(char *FileName);
void lrcls(unsigned char ctype,int *idrt,int *lrtype) ;
void pratr(unsigned char chatr1,unsigned char chatr2,int *pmatr);
void rdbufp(FILE *fp,unsigned char *buff,int lbuff,int lrtype,int istats,int maxrl,int nbyte,int ngpbyte);
//
//- read a logical record length from disk file.
void rdbuf(FILE *fp,unsigned char *buff,int *lbuff,int *lrtype,int *istats,int maxrl,int *nbyte,int ngpbyte);
CString reelhd(char *buff);
CString tapehd(char *buff);
CString filehd(char *buff,int *maxrl);
float unitfactor(char *depunit,int len);
CString formsp(char *buff,int lbuff,int iswitab);
void convrt(float *value,unsigned char *buff,int lbuff,int ips,int irecod,int nsamp);
CString infrec(char *buff,int lbuff,int iswitab);
int lbytes(int ircode);
int lwbytes(int ircode);
int idtype(int ircode);
void scdtype(char *cdtype,int ircode);
void fsinglc(char *cha,float value,int *nbyte);
void fsinglb(char *cha,float *value,int npoints,int *nbyte);
void snormb(char *cha,short *ivalue,int npoints,int *nbyte);
void snormb(uchar *cha,ushort *ivalue,int npoints,int *nbyte);
void slongb(char *cha,int *ivalue,int npoints,int *nbyte);
CString CharToCstring(char *buf,int len);