This commit is contained in:
DESKTOP-450PEFP\mainc 2026-06-26 17:54:58 +08:00
commit f916e692e7
13 changed files with 1599 additions and 307 deletions

View File

@ -0,0 +1,587 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateResoultStruct</class>
<widget class="QDialog" name="CreateResoultStruct">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1330</width>
<height>752</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>30</x>
<y>290</y>
<width>191</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>输入字段名称</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>220</x>
<y>300</y>
<width>121</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>40</x>
<y>430</y>
<width>161</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>选择取值方式</string>
</property>
</widget>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>220</x>
<y>430</y>
<width>231</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>20</x>
<y>340</y>
<width>621</width>
<height>81</height>
</rect>
</property>
<property name="title">
<string>数据来源</string>
</property>
<widget class="QRadioButton" name="radioButton">
<property name="geometry">
<rect>
<x>250</x>
<y>40</y>
<width>111</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>曲线</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton_2">
<property name="geometry">
<rect>
<x>30</x>
<y>40</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>结论表字段</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton_3">
<property name="geometry">
<rect>
<x>400</x>
<y>40</y>
<width>181</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>取心数据表</string>
</property>
</widget>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>1060</x>
<y>120</y>
<width>241</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>上移</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="geometry">
<rect>
<x>1060</x>
<y>160</y>
<width>241</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>下移</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>1060</x>
<y>200</y>
<width>241</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>删除</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>360</x>
<y>300</y>
<width>101</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>中文名</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="geometry">
<rect>
<x>480</x>
<y>300</y>
<width>131</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>NULL</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_3">
<property name="geometry">
<rect>
<x>540</x>
<y>430</y>
<width>201</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>NULL</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>470</x>
<y>440</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>单位</string>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>380</x>
<y>700</y>
<width>181</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>成果表模板名</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_4">
<property name="geometry">
<rect>
<x>570</x>
<y>690</y>
<width>201</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>780</x>
<y>690</y>
<width>71</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>.lst</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_5">
<property name="geometry">
<rect>
<x>1060</x>
<y>73</y>
<width>241</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>加载模板</string>
</property>
</widget>
<widget class="QPushButton" name="btn_Ok">
<property name="geometry">
<rect>
<x>1160</x>
<y>660</y>
<width>112</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>确认</string>
</property>
</widget>
<widget class="QPushButton" name="btn_Cancel">
<property name="geometry">
<rect>
<x>1160</x>
<y>700</y>
<width>112</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>放弃</string>
</property>
</widget>
<widget class="QTableView" name="tableView">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>1011</width>
<height>221</height>
</rect>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
</widget>
<widget class="QComboBox" name="comboBox_2">
<property name="geometry">
<rect>
<x>800</x>
<y>303</y>
<width>181</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_8">
<property name="geometry">
<rect>
<x>670</x>
<y>310</y>
<width>121</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>数据类型</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_5">
<property name="geometry">
<rect>
<x>1150</x>
<y>304</y>
<width>141</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>4</string>
</property>
</widget>
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>1010</x>
<y>310</y>
<width>131</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>数据长度</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>1060</x>
<y>240</y>
<width>241</width>
<height>34</height>
</rect>
</property>
<property name="text">
<string>添加/更新记录</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_6">
<property name="geometry">
<rect>
<x>870</x>
<y>690</y>
<width>221</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>保存为模板</string>
</property>
</widget>
<widget class="QLabel" name="label_10">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>161</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>成果表名称</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_6">
<property name="geometry">
<rect>
<x>190</x>
<y>10</y>
<width>241</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_7">
<property name="geometry">
<rect>
<x>1100</x>
<y>430</y>
<width>191</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_11">
<property name="geometry">
<rect>
<x>810</x>
<y>430</y>
<width>291</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>重定向字段/计算公式</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>1010</x>
<y>367</y>
<width>121</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>小数位数</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_8">
<property name="geometry">
<rect>
<x>1150</x>
<y>360</y>
<width>141</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_12">
<property name="geometry">
<rect>
<x>670</x>
<y>370</y>
<width>111</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>转换表</string>
</property>
</widget>
<widget class="QComboBox" name="comboBox_3">
<property name="geometry">
<rect>
<x>800</x>
<y>360</y>
<width>181</width>
<height>41</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_13">
<property name="geometry">
<rect>
<x>30</x>
<y>530</y>
<width>121</width>
<height>101</height>
</rect>
</property>
<property name="text">
<string>特征值法
取值规则</string>
</property>
</widget>
<widget class="QTextEdit" name="textEdit">
<property name="geometry">
<rect>
<x>160</x>
<y>490</y>
<width>361</width>
<height>171</height>
</rect>
</property>
</widget>
<widget class="QTextEdit" name="textEdit_2">
<property name="geometry">
<rect>
<x>630</x>
<y>490</y>
<width>451</width>
<height>171</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_14">
<property name="geometry">
<rect>
<x>540</x>
<y>550</y>
<width>91</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>汇总项</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_2">
<property name="geometry">
<rect>
<x>1100</x>
<y>520</y>
<width>201</width>
<height>91</height>
</rect>
</property>
<property name="text">
<string>统计分析
不合并同类项</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_9">
<property name="geometry">
<rect>
<x>160</x>
<y>690</y>
<width>121</width>
<height>35</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_15">
<property name="geometry">
<rect>
<x>40</x>
<y>680</y>
<width>141</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>数据列表
间隔</string>
</property>
</widget>
<widget class="QLabel" name="label_16">
<property name="geometry">
<rect>
<x>300</x>
<y>700</y>
<width>61</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>米</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox">
<property name="geometry">
<rect>
<x>1100</x>
<y>490</y>
<width>211</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string>基于结论取值</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_3">
<property name="geometry">
<rect>
<x>1100</x>
<y>610</y>
<width>211</width>
<height>32</height>
</rect>
</property>
<property name="text">
<string>全部结论列表</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,524 @@
#pragma warning( push , 0 )
#include <QList>
#include <QStandardItemModel>
#include <QDialog>
#include "CreateResoultStructDlg.h"
#include <QFileDialog>
#pragma warning( pop )
CCreateResoultStructDlg::CCreateResoultStructDlg()
:m_pDialog( NULL )
{
QStringList MenuTypea;
MenuTypea<<("RESULT")<<("CoreLith")<<("CoreOil")<<("Corecolor")<<("Corecolor")<<("GujingOrder");
DataTypea<<("INT")<<("SHORT")<<("LONG")<<("FLOAT")<<("DOUBLE")<<("STRING")<<
("CHAR")<<("UNSIGNED CHAR")<<("UNSIGNED SHORT")<<("UNSIGNED INT")<<("UNSIGNED LONG")<<("转换型");
GetValueModeStr=GetSimilarCurves("ValueMode");
GetValueModeStr.insert(0,"");
ZDType=GetSimilarCurves("FieldType");//字段类型
student_model=NULL;
m_pDialog = new Ui_CreateResoultStruct();
m_pDialog->setupUi( this );
for(int i=0;i<GetValueModeStr.size();i++) m_pDialog->comboBox->addItem(GetValueModeStr[i]);
for(int i=0;i<DataTypea.size();i++) m_pDialog->comboBox_2->addItem(DataTypea[i]);
for(int i=0;i<MenuTypea.size();i++) m_pDialog->comboBox_3->addItem(MenuTypea[i]);
m_pListTableInf=NULL;
m_pDialog->radioButton_2->setChecked(true);
m_pDialog->btn_Ok->setIcon(QIcon( ::GetImagePath() + "icon/OK.png" ));
// m_pDialog->btn_Cancel->setIcon(QIcon( ::GetImagePath() + "icon/Cancel.png" ));
connect( m_pDialog->btn_Ok,SIGNAL(clicked()),this,SLOT(slotOnOkBtnClicked()) );
// connect( m_pDialog->btn_Cancel,SIGNAL(clicked()),this,SLOT(slotOnCancelBtnClicked()));
connect(m_pDialog->tableView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(slottableViewClicked(const QModelIndex &)));
connect( m_pDialog->pushButton,SIGNAL(clicked()),this,SLOT(slotAddClicked()));
connect( m_pDialog->pushButton_5,SIGNAL(clicked()),this,SLOT(slotLoadTempClicked()));
connect( m_pDialog->pushButton_2,SIGNAL(clicked()),this,SLOT(slotMoveLeftClicked()));
connect( m_pDialog->pushButton_3,SIGNAL(clicked()),this,SLOT(slotMoveRightClicked()));
connect( m_pDialog->pushButton_4,SIGNAL(clicked()),this,SLOT(slotDeleteClicked()));
connect( m_pDialog->pushButton_6,SIGNAL(clicked()),this,SLOT(slotSaveTempClicked()));
}
CCreateResoultStructDlg::~CCreateResoultStructDlg()
{
}
void CCreateResoultStructDlg::slottableViewClicked(const QModelIndex &ind)
{
if(!m_pListTableInf) return;
QModelIndex im=ind;//m_pDialog->tableView->currentIndex();
if(im.isValid()) {
int index=im.row();
if(index<0) return;
if(index>=m_pListTableInf->Table_Field_Num) return;
m_pDialog->lineEdit->setText(m_pListTableInf->Table_Field[index].Name);
m_pDialog->lineEdit_2->setText(m_pListTableInf->Table_Field[index].HZName);
// QString FieldUnit=m_pDialog->lineEdit_3->setText(m_pListTableInf->Table_Field[index].);
m_pDialog->lineEdit_5->setText(QString(m_pListTableInf->Table_Field[index].Length));
m_pDialog->comboBox_2->setCurrentIndex(m_pListTableInf->Table_Field[index].RepCode-1);
if(m_pListTableInf->Type[index]==0) {
m_pDialog->radioButton_2->setChecked(true);
m_pDialog->radioButton->setChecked(false);
m_pDialog->radioButton_3->setChecked(false);
}
else if(m_pListTableInf->Type[index]==1) {
m_pDialog->radioButton_2->setChecked(false);
m_pDialog->radioButton->setChecked(true);
m_pDialog->radioButton_3->setChecked(false);
}
else if(m_pListTableInf->Type[index]==2) {
m_pDialog->radioButton_2->setChecked(false);
m_pDialog->radioButton->setChecked(false);
m_pDialog->radioButton_3->setChecked(true);
}
//取值方式
int FieldValType=m_pListTableInf->GetValueMode[index];
m_pDialog->comboBox->setCurrentIndex(FieldValType);
}
}
void CCreateResoultStructDlg::Init(struct LIST_TABLE_INF* pListTableInf)
{
m_pListTableInf=pListTableInf;
// m_pDialog->tableView->clear();
student_model = new QStandardItemModel();
student_model->setHorizontalHeaderItem(0, new QStandardItem("字段名"));
student_model->setHorizontalHeaderItem(1, new QStandardItem("中文名"));
student_model->setHorizontalHeaderItem(2, new QStandardItem("单位"));
student_model->setHorizontalHeaderItem(3, new QStandardItem("数据类型"));
student_model->setHorizontalHeaderItem(4, new QStandardItem("字节长度"));
student_model->setHorizontalHeaderItem(5, new QStandardItem("小数位数或类型名"));
student_model->setHorizontalHeaderItem(6, new QStandardItem("数据来源"));
student_model->setHorizontalHeaderItem(7, new QStandardItem("重定向名"));
student_model->setHorizontalHeaderItem(8, new QStandardItem("取值方式"));
m_pDialog->tableView->setModel(student_model);
SetTableView();
m_pDialog->lineEdit_9->setText(QString::number(m_pListTableInf->lstm));
m_pDialog->checkBox->setChecked(m_pListTableInf->m_Mode);
m_pDialog->checkBox_2->setChecked(m_pListTableInf->IsHB);
m_pDialog->checkBox_3->setChecked(!m_pListTableInf->m_Flag);
m_pDialog->lineEdit_6->setText(m_pListTableInf->m_TableName);
QString text;
for(int i=0;i<m_pListTableInf->SPVALNUM;i++) {
QString cs=m_pListTableInf->SPVAL[i];
cs.remove("\r");
cs.remove("\n");
text+=cs;
text+="\n";
}
m_pDialog->textEdit_2->setText(text);
m_pDialog->textEdit->setText(m_pListTableInf->m_CurveName);
QString path,fname;
GetWellNameAndPath(filename,fname,path);
m_pDialog->lineEdit_4->setText(fname);
}
void CCreateResoultStructDlg::slotOnOkBtnClicked()
{
slotSaveTempClicked();
this->accept();
}
void CCreateResoultStructDlg::slotOnCancelBtnClicked()
{
this->reject();
}
void CCreateResoultStructDlg::slotMoveLeftClicked()
{
QModelIndex im=m_pDialog->tableView->currentIndex();
int index=im.row();
if(index<1) return;
Slf_TABLE_FIELD Table_Field;
memmove(&Table_Field,&m_pListTableInf->Table_Field[index-1],sizeof(Slf_TABLE_FIELD));
memmove(&m_pListTableInf->Table_Field[index-1],&m_pListTableInf->Table_Field[index],sizeof(Slf_TABLE_FIELD));
memmove(&m_pListTableInf->Table_Field[index],&Table_Field,sizeof(Slf_TABLE_FIELD));
char Formate[116];
memmove(&Formate,&m_pListTableInf->Format[index-1],116);
memmove(&m_pListTableInf->Format[index-1],&m_pListTableInf->Format[index],116);
memmove(&m_pListTableInf->Format[index],&Formate,116);
char ZdIndex[116];
memmove(&ZdIndex,&m_pListTableInf->ZdIndex[index-1],116);
memmove(&m_pListTableInf->ZdIndex[index-1],&m_pListTableInf->ZdIndex[index],116);
memmove(&m_pListTableInf->ZdIndex[index],&ZdIndex,116);
BYTE type;
memmove(&type,&m_pListTableInf->Type[index-1],sizeof(BYTE));
memmove(&m_pListTableInf->Type[index-1],&m_pListTableInf->Type[index],sizeof(BYTE));
memmove(&m_pListTableInf->Type[index],&type,sizeof(BYTE));
BYTE ValueMode=m_pListTableInf->GetValueMode[index-1];
memmove(&m_pListTableInf->GetValueMode[index-1],&m_pListTableInf->GetValueMode[index],sizeof(BYTE));
memmove(&m_pListTableInf->GetValueMode[index],&ValueMode,sizeof(BYTE));
char RenName[116];
memmove(&m_pListTableInf->RenName[index-1],&m_pListTableInf->RenName[index],116);
memmove(&m_pListTableInf->RenName[index],&RenName,116);
SetTableViewRec(index-1);
SetTableViewRec(index);
if(index>0)
{
QModelIndex ind=m_pDialog->tableView->model()->index(index-1,0);
m_pDialog->tableView->setCurrentIndex(ind);
}
}
void CCreateResoultStructDlg::slotMoveRightClicked()
{
QModelIndex im=m_pDialog->tableView->currentIndex();
int index=im.row();
if(index<0) return;
Slf_TABLE_FIELD Table_Field;
char Formate[116];
char ZdIndex[116];
BYTE type;
memmove(&Formate,&m_pListTableInf->Format[index+1],116);
memmove(&Table_Field,&m_pListTableInf->Table_Field[index+1],sizeof(Slf_TABLE_FIELD));
memmove(&m_pListTableInf->Table_Field[index+1],&m_pListTableInf->Table_Field[index],sizeof(Slf_TABLE_FIELD));
memmove(&m_pListTableInf->Table_Field[index],&Table_Field,sizeof(Slf_TABLE_FIELD));
memmove(&m_pListTableInf->Format[index+1],&m_pListTableInf->Format[index],116);
memmove(&m_pListTableInf->Format[index],&Formate,116);
memmove(&ZdIndex,&m_pListTableInf->ZdIndex[index+1],116);
memmove(&type,&m_pListTableInf->Type[index+1],sizeof(BYTE));
memmove(&m_pListTableInf->ZdIndex[index+1],&m_pListTableInf->ZdIndex[index],116);
memmove(&m_pListTableInf->Type[index+1],&m_pListTableInf->Type[index],sizeof(BYTE));
memmove(&m_pListTableInf->ZdIndex[index],&ZdIndex,116);
memmove(&m_pListTableInf->Type[index],&type,sizeof(BYTE));
BYTE ValueMode=m_pListTableInf->GetValueMode[index+1];
memmove(&m_pListTableInf->GetValueMode[index+1],&m_pListTableInf->GetValueMode[index],sizeof(BYTE));
memmove(&m_pListTableInf->GetValueMode[index],&ValueMode,sizeof(BYTE));
char RenName[116];
memmove(&m_pListTableInf->RenName[index+1],&m_pListTableInf->RenName[index],116);
memmove(&m_pListTableInf->RenName[index],&RenName,116);
SetTableViewRec(index+1);
SetTableViewRec(index);
if(index<m_pDialog->tableView->model()->rowCount())
{
QModelIndex ind=m_pDialog->tableView->model()->index(index+1,0);
m_pDialog->tableView->setCurrentIndex(ind);
}
}
void CCreateResoultStructDlg::slotDeleteClicked()
{
QModelIndex im=m_pDialog->tableView->currentIndex();
int index=im.row();
if(index<0) return;
for(int i=index;i<m_pListTableInf->Table_Field_Num;i++) {
memmove(&m_pListTableInf->Table_Field[i],&m_pListTableInf->Table_Field[i+1],sizeof(Slf_TABLE_FIELD));
memmove(&m_pListTableInf->Format[i],&m_pListTableInf->Format[i+1],116);
memmove(&m_pListTableInf->ZdIndex[i],&m_pListTableInf->ZdIndex[i+1],116);
memmove(&m_pListTableInf->Type[i],&m_pListTableInf->Type[i+1],sizeof(BYTE));
memmove(&m_pListTableInf->GetValueMode[i],&m_pListTableInf->GetValueMode[i+1],sizeof(BYTE));
memmove(&m_pListTableInf->RenName[i],&m_pListTableInf->RenName[i+1],116);
}
student_model->removeRows(0,m_pListTableInf->Table_Field_Num);
m_pListTableInf->Table_Field_Num--;
if(m_pListTableInf->Table_Field_Num<0) m_pListTableInf->Table_Field_Num=0;
SetTableView();
}
void CCreateResoultStructDlg::slotAddClicked()
{
int RepSize[12]={0,
sizeof(int),
sizeof(short),
sizeof(long long),
sizeof(float),
sizeof(double),
sizeof(char),
sizeof(char),
sizeof(unsigned char),
sizeof(unsigned short),
sizeof(unsigned int),
sizeof(unsigned int)
};
QString Field=m_pDialog->lineEdit->text();
Field=Field.toUpper();
if(Field.isEmpty()) {
AfxMessageBox("字段名不能为空!");
return;
}
QModelIndex im=m_pDialog->tableView->currentIndex();
int index=im.row();
if(index<0) {
index=m_pListTableInf->Table_Field_Num;
for(int i=0;i<m_pListTableInf->Table_Field_Num;i++) {
if(Field.compare(m_pListTableInf->Table_Field[i].Name)==0) {
AfxMessageBox("字段名已存在!");
return;
}
}
}
else {
if(QMessageBox::information(NULL,QObject::tr("当前位置插入或替换"),QObject::tr("插入?"),QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) {
Slf_TABLE_FIELD Table_Field;
for(int i=m_pListTableInf->Table_Field_Num;i>index;i--) {
memmove(&m_pListTableInf->Table_Field[i],&m_pListTableInf->Table_Field[i-1],sizeof(Slf_TABLE_FIELD));
memmove(&m_pListTableInf->Format[i],&m_pListTableInf->Format[i-1],116);
memmove(&m_pListTableInf->ZdIndex[i],&m_pListTableInf->ZdIndex[i-1],116);
memmove(&m_pListTableInf->Type[i],&m_pListTableInf->Type[i-1],sizeof(BYTE));
memmove(&m_pListTableInf->GetValueMode[i],&m_pListTableInf->GetValueMode[i-1],sizeof(BYTE));
memmove(&m_pListTableInf->RenName[i],&m_pListTableInf->RenName[i-1],116);
}
}
}
QString FieldHZ=m_pDialog->lineEdit_2->text();
FieldHZ=FieldHZ.toUpper();
QString FieldUnit=m_pDialog->lineEdit_3->text();
QString FieldLength=m_pDialog->lineEdit_5->text();
if(m_pDialog->comboBox_2->currentText()!="STRING"&&m_pDialog->comboBox_2->currentText()!="转换型")
{
char buf[100];
sprintf(buf,"%d",RepSize[m_pDialog->comboBox_2->currentIndex()+1]);
FieldLength=buf;
}
QString FieldType;
if(m_pDialog->radioButton_2->isChecked()) {
FieldType="字段";
}
else if(m_pDialog->radioButton->isChecked()){
FieldType="曲线";
}
else {
FieldType="岩心";
}
strcpy(m_pListTableInf->TableName[index],"");
m_pListTableInf->Type[index]=ZDType.indexOf(FieldType);
if(m_pListTableInf->Type[index]==255) strcpy(m_pListTableInf->TableName[index],FieldType.toStdString().c_str());
// if(m_pListTableInf->Type[index]<0) m_pListTableInf->Type[index]=1;
//取值方式
QString FieldValType=m_pDialog->comboBox->currentText();
m_pListTableInf->GetValueMode[index]=GetValueModeStr.indexOf(FieldValType);
if(m_pListTableInf->GetValueMode[index]<=0||m_pListTableInf->GetValueMode[index]>=GetValueModeStr.size())m_pListTableInf->GetValueMode[index]=3;//如果没有指定取值方式,则取平均值
strcpy(m_pListTableInf->m_CurveName,"GR POR");
strcpy(m_pListTableInf->RenName[index],Field.toStdString().c_str());
strcpy(m_pListTableInf->Table_Field[index].Name,Field.toStdString().c_str());
strcpy(m_pListTableInf->Table_Field[index].HZName,FieldHZ.toStdString().c_str());
m_pListTableInf->Table_Field[index].Length=FieldLength.toFloat();
m_pListTableInf->Table_Field[index].RepCode=m_pDialog->comboBox_2->currentIndex()+1;
if(GetValueModeStr[m_pDialog->comboBox_2->currentIndex()]=="MENU")
{
m_pListTableInf->Table_Field[index].RepCode=6;
strcpy(m_pListTableInf->ZdIndex[index],m_pDialog->comboBox_3->currentText().toStdString().c_str());
if(strlen(m_pListTableInf->ZdIndex[index])==0) strcpy(m_pListTableInf->ZdIndex[index],"RESULT");
}
else {
strcpy(m_pListTableInf->ZdIndex[index],m_pDialog->lineEdit_8->text().toStdString().c_str());
if(strlen(m_pListTableInf->ZdIndex[index])==0) strcpy(m_pListTableInf->ZdIndex[index],"0");
if(!isdigit(m_pListTableInf->ZdIndex[index][0])) {
strcpy(m_pListTableInf->TableName[index],m_pListTableInf->ZdIndex[index]);
strcpy(m_pListTableInf->ZdIndex[index],"0");
}
}
m_pListTableInf->Table_Field[index].Reserved=0;
m_pListTableInf->Table_Field_Num++;
SetTableView();
}
void CCreateResoultStructDlg::SetTableView()
{
for(int i=0;i<m_pListTableInf->Table_Field_Num;i++) {
SetTableViewRec(i);
}
}
void CCreateResoultStructDlg::SetTableViewRec(int i)
{
QString text=m_pListTableInf->Table_Field[i].Name;
student_model->setItem(i, 0, new QStandardItem(text));
QString hz;
hz=m_pListTableInf->Table_Field[i].HZName;
student_model->setItem(i, 1, new QStandardItem(hz));
QString Unit="NULL";
student_model->setItem(i, 2, new QStandardItem(Unit));
QString Type;
if(m_pListTableInf->Table_Field[i].RepCode<1) m_pListTableInf->Table_Field[i].RepCode=1;
Type=DataTypea[m_pListTableInf->Table_Field[i].RepCode-1];
student_model->setItem(i, 3, new QStandardItem(Type));
// QString Length;
char buf[100];
sprintf(buf,"%d",m_pListTableInf->Table_Field[i].Length);
student_model->setItem(i, 4, new QStandardItem(buf));
student_model->setItem(i, 5, new QStandardItem(m_pListTableInf->ZdIndex[i]));
QString valfrom;
valfrom=ZDType[m_pListTableInf->Type[i]];
student_model->setItem(i, 6, new QStandardItem(valfrom));
QString RName;
RName=m_pListTableInf->RenName[i];
student_model->setItem(i, 7, new QStandardItem(RName));
QString ValueMode=GetValueModeStr[m_pListTableInf->GetValueMode[i]];
if(valfrom=="字段"&&ValueMode=="平均值") ValueMode="NULL";
student_model->setItem(i, 8, new QStandardItem(ValueMode));
}
void CCreateResoultStructDlg::slotLoadTempClicked()
{
QString path=GetTemplatePath();
QString m_ModelName=path;
int pos=m_ModelName.lastIndexOf('\\');
if(pos<0) pos=m_ModelName.length();
m_ModelName=m_ModelName.left(pos);
// m_ModelName+=+"\\"+m_ParFileName;
QString strTplFilter="(*.lst)";
QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter);
FILE *fp=fopen(defaultTempleteFile.toStdString().c_str(),"rt");
if(fp)
{
char buf[1000];
QString cs;
student_model->removeRows(0,m_pListTableInf->Table_Field_Num);
fscanf(fp,"%s",m_pListTableInf->m_TableName);
fscanf(fp,"%d %d %d ",&m_pListTableInf->Table_Field_Num,
&m_pListTableInf->m_Mode,
&m_pListTableInf->m_Flag
);
buf[0]=0;
fgets(buf,1000,fp);
cs=buf;
cs.remove("\r\n");
cs.remove("\r");
cs.remove("\n");
strcpy(m_pListTableInf->m_CurveName,cs.toStdString().c_str());
char ss[10][32];
strcpy(ss[1],"");
strcpy(ss[2],"");
for(int i=0;i<m_pListTableInf->Table_Field_Num;i++)
{
strcpy(m_pListTableInf->TableName[i],"");
fscanf(fp,"%s %s %s %s %s %s %s %s %s %s",ss[0],m_pListTableInf->Table_Field[i].Name,m_pListTableInf->Table_Field[i].HZName,ss[3],ss[4],ss[5],ss[6],ss[7],ss[8],ss[9]);
//数值类型
m_pListTableInf->Table_Field[i].RepCode=DataTypea.indexOf(ss[4])+1;
//字段长度
sscanf(ss[5],"%d",&m_pListTableInf->Table_Field[i].Length);
m_pListTableInf->Table_Field[i].Reserved=0;
strcpy(m_pListTableInf->ZdIndex[i],ss[6]);
if(!isdigit(ss[6][0])&&stricmp(ss[9],"MENU"))
{
strcpy(m_pListTableInf->TableName[i],ss[6]);
strcpy(m_pListTableInf->ZdIndex[i],"0");
}
//字段类型
m_pListTableInf->Type[i]=ZDType.indexOf(ss[7]);
if(m_pListTableInf->Type[i]==255) strcpy(m_pListTableInf->TableName[i],ss[7]);
// if(m_pListTableInf->Type[i]<0) m_pListTableInf->Type[i]=1;
//重定向名
strcpy(m_pListTableInf->RenName[i],ss[8]);
//取值方式
m_pListTableInf->GetValueMode[i]=GetValueModeStr.indexOf(ss[9]);
if(m_pListTableInf->GetValueMode[i]<=0||m_pListTableInf->GetValueMode[i]>=GetValueModeStr.size())m_pListTableInf->GetValueMode[i]=3;//如果没有指定取值方式,则取平均值
}
fscanf(fp," %d %d %d\n",&m_pListTableInf->lstm,&m_pListTableInf->IsHB,m_pListTableInf->IsFC);
fscanf(fp," %s\n",&m_pListTableInf->m_TableType);
fscanf(fp," %s\n",&m_pListTableInf->m_TableSpFIELD);
if(!m_pListTableInf->m_TableType[0]) strcpy(m_pListTableInf->m_TableType,"TOTALVAL");
if(!m_pListTableInf->m_TableSpFIELD[0]) strcpy(m_pListTableInf->m_TableSpFIELD,"RESULTNO");
m_pListTableInf->SPVALNUM=0;
while(!feof(fp))
{
buf[0]=0;
fgets(buf,1000,fp);
cs=buf;
cs.remove("\r");
cs.remove("\n");
cs.trimmed();
if(!cs.isEmpty()&&m_pListTableInf->SPVALNUM<100)
{
strcpy(m_pListTableInf->SPVAL[m_pListTableInf->SPVALNUM],cs.toStdString().c_str());
m_pListTableInf->SPVALNUM++;
}
}
fclose(fp);
}
else
{
strcpy(m_pListTableInf->m_CurveName,"GR");
m_pListTableInf->m_Mode=0;//取值模式选择0-每条曲线按各自给定取值方式取值1-按给定曲线的极值点深度取值
m_pListTableInf->m_Flag=1;
m_pListTableInf->IsHB=1;
}
SetTableView();
}
void CCreateResoultStructDlg::slotSaveTempClicked()
{
m_pListTableInf->lstm=m_pDialog->lineEdit_9->text().toInt();
m_pListTableInf->IsHB=m_pDialog->checkBox_2->checkState();
m_pListTableInf->m_Mode=m_pDialog->checkBox->checkState();
m_pListTableInf->m_Flag=!m_pDialog->checkBox_3->checkState();
m_pListTableInf->IsFC=0;
QString ttabname=m_pDialog->lineEdit_6->text();
if(ttabname.isEmpty()) {
AfxMessageBox("输出成果表名不能为空!");
return;
}
QString tt=m_pDialog->lineEdit_4->text();
if(tt.isEmpty()) {
AfxMessageBox("输出模板文件名不能为空!");
return;
}
QString path=GetTemplatePath();
tt=tt.toLower();
if(tt.indexOf(".lst")<0) tt+=+".lst";
QString defaultTempleteFile=path+tt;
FILE *fp=fopen(defaultTempleteFile.toStdString().c_str(),"wt");
if(fp)
{
fprintf(fp,"%s\n",ttabname.toStdString().c_str());
fprintf(fp,"%d %d %d ",m_pListTableInf->Table_Field_Num,
m_pListTableInf->m_Mode,
m_pListTableInf->m_Flag);
QString cs=m_pDialog->textEdit->toPlainText();
cs.replace("\r\n"," ");
cs.replace("\r"," ");
cs.replace("\n"," ");
fprintf(fp,"%s\n",cs.toStdString().c_str());
for(int i=0;i<m_pListTableInf->Table_Field_Num;i++) {
QString text=m_pListTableInf->Table_Field[i].Name;
fprintf(fp,"%d %s",i,text.toStdString().c_str());
QString hz;
hz=m_pListTableInf->Table_Field[i].HZName;
fprintf(fp," %s",hz.toStdString().c_str());
QString Unit="NULL";
fprintf(fp," %s",Unit.toStdString().c_str());
QString Type;
if(m_pListTableInf->Table_Field[i].RepCode<1) m_pListTableInf->Table_Field[i].RepCode=1;
Type=DataTypea[m_pListTableInf->Table_Field[i].RepCode-1];
fprintf(fp," %s",Type.toStdString().c_str());
// QString Length;
char buf[100];
sprintf(buf,"%d",m_pListTableInf->Table_Field[i].Length);
fprintf(fp," %s",buf);
fprintf(fp," %s",m_pListTableInf->ZdIndex[i]);
QString valfrom;
valfrom=ZDType[m_pListTableInf->Type[i]];
fprintf(fp," %s",valfrom.toStdString().c_str());
QString RName;
RName=m_pListTableInf->RenName[i];
fprintf(fp," %s",RName.toStdString().c_str());
QString ValueMode=GetValueModeStr[m_pListTableInf->GetValueMode[i]];
if(valfrom=="字段"&&ValueMode=="平均值") ValueMode="NULL";
fprintf(fp," %s\n",ValueMode.toStdString().c_str());
}
fprintf(fp," %d %d %d\n",m_pListTableInf->lstm,m_pListTableInf->IsHB,m_pListTableInf->IsFC);
fprintf(fp,"%s\n",m_pListTableInf->m_TableType);
fprintf(fp,"%s\n",m_pListTableInf->m_TableSpFIELD);
cs=m_pDialog->textEdit_2->toPlainText();
/* cs.replace("\r\n"," ");
cs.replace("\r"," ");
cs.replace("\n"," ");
*/
fprintf(fp,"%s\n",cs.toStdString().c_str());
fclose(fp);
}
AfxMessageBox("保存完成!");
}

View File

@ -0,0 +1,45 @@
/**
* @file CreateResoultStructDlg.h
* @brief
* @date 2015-03
* @author: lxl
*/
#pragma warning( push , 0 )
#include "ui_CreateResoultStruct.h"
#include "ObjWell.h"
#include <QStandardItemModel>
#include "LIST_TABLE_INF.h"
#pragma warning( pop )
class CCreateResoultStructDlg : public QDialog
{
Q_OBJECT
public:
CCreateResoultStructDlg();
~CCreateResoultStructDlg();
public:
void Init(struct LIST_TABLE_INF* pListTableInf);
QString filename;
private slots:
void slotMoveLeftClicked();
void slotMoveRightClicked();
void slotDeleteClicked();
void slotAddClicked();
void slotLoadTempClicked();
void slotSaveTempClicked();
void slotOnOkBtnClicked();
void slotOnCancelBtnClicked();
void slottableViewClicked(const QModelIndex &ind);
private:
Ui_CreateResoultStruct* m_pDialog;
struct LIST_TABLE_INF* m_pListTableInf;
QStringList DataTypea;
QStringList GetValueModeStr;
QStringList ZDType;
QStandardItemModel *student_model;
void SetTableView();
void SetTableViewRec(int i);
};

36
logPlus/LIST_TABLE_INF.h Normal file
View File

@ -0,0 +1,36 @@
/**
* @file LIST_TABLE_INF.h
* @brief Qt单井图
* @date 2015-03
* @author: lxl
*/
#include "slf.h"
#ifndef LIST_TABLE_INF_H
#define LIST_TABLE_INF_H
#pragma warning( push ,0)
#pragma warning( pop )
struct LIST_TABLE_INF
{
int lstm;//是否每米取值0=不,>0,指定间隔
char m_TableName[16];
char m_TableType[16];//输出的统计表类型
char m_TableSpFIELD[16];//特征字段
int SPVALNUM;
char SPVAL[100][116];
int IsHB;
int Table_Field_Num;
int m_Mode;//取值模式选择0-每条曲线按各自给定取值方式取值1-按给定曲线的极值点深度取值
int m_Flag;//
int IsFC;//层内层列表
char m_CurveName[501];//特征曲线名
Slf_TABLE_FIELD Table_Field[100];
char RenName[100][116];
BYTE Type[100];
BYTE GetValueMode[100];
char ZdIndex[100][116];
char Format[100][116];
char TableName[100][116];
};
#endif

View File

@ -19,7 +19,7 @@
#include "DataImport.h"
#include "DataManagger.h"
#include "DepthProgress.h"
// #include "CreateResoultStructDlg.h"
#include "CreateResoultStructDlg.h"
// #include "WellSectionCoordinate.h"
// #include "QtWellSceneManager.h"
// #include "QtWellSectionViewer.h"
@ -224,18 +224,18 @@ CQtWindowWellSection::~CQtWindowWellSection()
// }
void CQtWindowWellSection::slotSetListTableStruct()
{
// CCreateResoultStructDlg *pCreateResoultStructDlg=new CCreateResoultStructDlg();
// QString path=GetTemplatePath();
// QString strTplFilter="(*.lst)";
// QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter);
// if(defaultTempleteFile.isEmpty()) {
// return;
// }
// pCreateResoultStructDlg->filename=defaultTempleteFile;
// OnListTableInf(defaultTempleteFile);
// pCreateResoultStructDlg->Init(&m_ListTableInf);
// pCreateResoultStructDlg->exec();
// delete pCreateResoultStructDlg;
CCreateResoultStructDlg *pCreateResoultStructDlg=new CCreateResoultStructDlg();
QString path=GetTemplatePath();
QString strTplFilter="(*.lst)";
QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter);
if(defaultTempleteFile.isEmpty()) {
return;
}
pCreateResoultStructDlg->filename=defaultTempleteFile;
OnListTableInf(defaultTempleteFile);
pCreateResoultStructDlg->Init(&m_ListTableInf);
pCreateResoultStructDlg->exec();
delete pCreateResoultStructDlg;
}
void CQtWindowWellSection::OnListTableInf(QString m_ParFileName)
{
@ -1597,112 +1597,112 @@ void CQtWindowWellSection::CreateTattle(QString m_csWellName,QString m_OGTableNa
mrw.Close(); //关闭井文件
}
}
// void CQtWindowWellSection::setTablePointValue(float dep)
// {
// CQtWindowWellSection *pWin=this;
// if(!pWin) return;
// {
// CQtWellSceneManager* scene = dynamic_cast<CQtWellSceneManager*>(GetSceneManager());
void CQtWindowWellSection::setTablePointValue(CObjWellLog *pLog, float dep)
{
CQtWindowWellSection *pWin=this;
if(!pWin) return;
{
// CQtWellSceneManager* scene = dynamic_cast<CQtWellSceneManager*>(GetSceneManager());
// CBaseObject *pCurrentObject = CObjProject::GetObjectByID(scene->GetCurrentPickObjectID());
// CObjWellLog *pLog = dynamic_cast<CObjWellLog*>(pCurrentObject);
// CObjDiscreteWellLog *pLog1 = dynamic_cast<CObjDiscreteWellLog*>(pCurrentObject);
// if((!pLog&&!pLog1)||(!pLog1&&pLog&&pLog->m_ObjectType!=TABLE_OBJECT&&pLog->m_ObjectType!=TABLEE_OBJECT)) {
// AfxMessageBox("先选择数据表对象!");
// return;
// }
// if(!pWin->m_ListTableInf.m_TableName[0])
// {
// QString path=GetTemplatePath();
// QString strTplFilter="(*.lst)";
// QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter);
// if(defaultTempleteFile.isEmpty()) {
// return;
// }
// pWin->OnListTableInf(defaultTempleteFile);
// }
// if(pWin->m_ListTableInf.Table_Field_Num<=0)
// {
// AfxMessageBox("对不起,您没有定义取值表结构,无法进行取值\r\n\r\n请选择“分层曲线取值方式设置”菜单设置取值表结构");
// return;
// }
// INC.Noi=0;
// INC.Name[0]=0;
// HD.Rlev=0.125;
// HD.Dep=-99999.0;
// HD.Depo=0;
// HD.Sdep=0;
// HD.Edep=-99999;
// HD.Stdep=99999;
// HD.StartDep=HD.Stdep;
// HD.EndDep=HD.Edep;
// CMemRdWt mrw;
// LIST_TABLE_INF &m_ListTableInf=pWin->m_ListTableInf;
// QString m_csWellName=pLog->GetSlfFileName();
// if ( mrw.Open(m_csWellName.toStdString().c_str()) ) // 打开井文件
// {
// QString OutTab=m_ListTableInf.m_TableName;
// int iIndex=mrw.OpenTable(OutTab.toStdString().c_str());
// if (iIndex<0)
// {
// AfxMessageBox(OutTab+"数据表不存在,请先生成表!");
// mrw.Close();
// return;
// }
// int iIndex1=mrw.OpenTable(pLog->GetName().toStdString().c_str());
// if(iIndex1<0) {
// mrw.Clear();
// AfxMessageBox(pLog->GetName()+"不存在!,无法生成对应数据表!");
// return;
// }
// LAYER_DATA *m_Result=NULL;
// int m_RecNum=0;
// int tabletype=0;
// int tabletype2=0;
// m_RecNum=mrw.GetTableRecordCount(iIndex1);
// int relen=mrw.GetTableRecordLength(iIndex1);
// if(relen<sizeof(LAYER_DATA)) relen=sizeof(LAYER_DATA);
// m_Result=(LAYER_DATA *)new char[relen*m_RecNum+1];
// CBaseObject *pCurrentObject = CObjProject::GetObjectByID(scene->GetCurrentPickObjectID());
// CObjWellLog *pLog = dynamic_cast<CObjWellLog*>(pCurrentObject);
// CObjDiscreteWellLog *pLog1 = dynamic_cast<CObjDiscreteWellLog*>(pCurrentObject);
// if((!pLog&&!pLog1)||(!pLog1&&pLog&&pLog->m_ObjectType!=TABLE_OBJECT&&pLog->m_ObjectType!=TABLEE_OBJECT)) {
// AfxMessageBox("先选择数据表对象!");
// return;
// }
if(!pWin->m_ListTableInf.m_TableName[0])
{
QString path=GetTemplatePath();
QString strTplFilter="(*.lst)";
QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter);
if(defaultTempleteFile.isEmpty()) {
return;
}
pWin->OnListTableInf(defaultTempleteFile);
}
if(pWin->m_ListTableInf.Table_Field_Num<=0)
{
AfxMessageBox("对不起,您没有定义取值表结构,无法进行取值\r\n\r\n请选择“分层曲线取值方式设置”菜单,设置取值表结构");
return;
}
INC.Noi=0;
INC.Name[0]=0;
HD.Rlev=0.125;
HD.Dep=-99999.0;
HD.Depo=0;
HD.Sdep=0;
HD.Edep=-99999;
HD.Stdep=99999;
HD.StartDep=HD.Stdep;
HD.EndDep=HD.Edep;
CMemRdWt mrw;
LIST_TABLE_INF &m_ListTableInf=pWin->m_ListTableInf;
QString m_csWellName=pLog->GetSlfFileName();
if ( mrw.Open(m_csWellName.toStdString().c_str()) ) // 打开井文件
{
QString OutTab=m_ListTableInf.m_TableName;
int iIndex=mrw.OpenTable(OutTab.toStdString().c_str());
if (iIndex<0)
{
AfxMessageBox(OutTab+"数据表不存在,请先生成表!");
mrw.Close();
return;
}
int iIndex1=mrw.OpenTable(pLog->GetName().toStdString().c_str());
if(iIndex1<0) {
mrw.Clear();
AfxMessageBox(pLog->GetName()+"不存在!,无法生成对应数据表!");
return;
}
LAYER_DATA *m_Result=NULL;
int m_RecNum=0;
int tabletype=0;
int tabletype2=0;
m_RecNum=mrw.GetTableRecordCount(iIndex1);
int relen=mrw.GetTableRecordLength(iIndex1);
if(relen<sizeof(LAYER_DATA)) relen=sizeof(LAYER_DATA);
m_Result=(LAYER_DATA *)new char[relen*m_RecNum+1];
// for(int i=0;i<m_RecNum;i++) {
// memset(&m_Result[i],0,relen);
// mrw.ReadTable(iIndex1,i+1,&m_Result[i]);
// }
// mrw.CloseTable(iIndex1);
// int count=mrw.GetTableRecordCount(iIndex);
// for (int i=0;i<count;i++)
// {
// if(dep>=m_Result[i].StartDepth&&dep<=m_Result[i].EndDepth)
// {
// for (int j=0;j<m_ListTableInf.Table_Field_Num;j++)
// {
// strcat(INC.Name,m_ListTableInf.Table_Field[j].Name);
// if(j<m_ListTableInf.Table_Field_Num) strcat(INC.Name," ");
// INC.Noi++;
// }
// mrw.SetStruct(&INC,NULL,&INP,NULL,NULL,NULL,&HD);
// mrw.In();
// mrw.In(dep);
// for (int j=0;j<m_ListTableInf.Table_Field_Num;j++)
// {
// if(stricmp(m_ListTableInf.Table_Field[j].Name,"DEPTH")==0)
// {
// mrw.SetTableFieldData(iIndex,m_ListTableInf.Table_Field[j].Name,(char*)&dep,i+1);
// }
// else if(m_ListTableInf.Type[j]==1)
// {
// mrw.SetTableFieldData(iIndex,m_ListTableInf.Table_Field[j].Name,(char*)&INP.yy[j],i+1);
// }
// }
// break;
// }
// }
// delete m_Result;
// }
// }
// }
for(int i=0;i<m_RecNum;i++) {
memset(&m_Result[i],0,relen);
mrw.ReadTable(iIndex1,i+1,&m_Result[i]);
}
mrw.CloseTable(iIndex1);
int count=mrw.GetTableRecordCount(iIndex);
for (int i=0;i<count;i++)
{
if(dep>=m_Result[i].StartDepth&&dep<=m_Result[i].EndDepth)
{
for (int j=0;j<m_ListTableInf.Table_Field_Num;j++)
{
strcat(INC.Name,m_ListTableInf.Table_Field[j].Name);
if(j<m_ListTableInf.Table_Field_Num) strcat(INC.Name," ");
INC.Noi++;
}
mrw.SetStruct(&INC,NULL,&INP,NULL,NULL,NULL,&HD);
mrw.In();
mrw.In(dep);
for (int j=0;j<m_ListTableInf.Table_Field_Num;j++)
{
if(stricmp(m_ListTableInf.Table_Field[j].Name,"DEPTH")==0)
{
mrw.SetTableFieldData(iIndex,m_ListTableInf.Table_Field[j].Name,(char*)&dep,i+1);
}
else if(m_ListTableInf.Type[j]==1)
{
mrw.SetTableFieldData(iIndex,m_ListTableInf.Table_Field[j].Name,(char*)&INP.yy[j],i+1);
}
}
break;
}
}
delete m_Result;
}
}
}
void CQtWindowWellSection::slotReFreshZoneListData()
void CQtWindowWellSection::slotReFreshZoneListData(CObjWellLog *pLog)
{
// CQtWellSceneManager *pWellSceneManager = dynamic_cast<CQtWellSceneManager *>( GetSceneManager() );
// if(!pWellSceneManager) return;
@ -1723,164 +1723,167 @@ void CQtWindowWellSection::slotReFreshZoneListData()
// }
// m_LOGS.clear();
// m_LOGS.append(pLog);
// QDialog dialog(NULL);
// dialog.setModal(false);
// Qt::WindowFlags flags = dialog.windowFlags();
// flags |= Qt::WindowStaysOnTopHint;
// flags &= ~Qt::WindowContextHelpButtonHint;
// dialog.setWindowFlags(flags);
// QString path,wellname;
// GetWellNameAndPath(pRound->GetSlfFileName(),wellname,path);
// dialog.setWindowTitle("深度点-"+wellname);
// QGridLayout *verticalLayoutWidget = new QGridLayout(&dialog);
// verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayoutWidget"));
// verticalLayoutWidget->setGeometry(QRect(30, 30, 631, 281));
// QVBoxLayout*form = new QVBoxLayout();
// form->setObjectName(QString::fromUtf8("form"));
// form->setContentsMargins(0, 0, 0, 0);
QDialog dialog(NULL);
dialog.setModal(false);
Qt::WindowFlags flags = dialog.windowFlags();
flags |= Qt::WindowStaysOnTopHint;
flags &= ~Qt::WindowContextHelpButtonHint;
dialog.setWindowFlags(flags);
QString path,wellname;
GetWellNameAndPath(/*pRound*/pLog->GetSlfFileName(),wellname,path);
dialog.setWindowTitle("深度点-"+wellname);
QGridLayout *verticalLayoutWidget = new QGridLayout(&dialog);
verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayoutWidget"));
verticalLayoutWidget->setGeometry(QRect(30, 30, 631, 281));
QVBoxLayout*form = new QVBoxLayout();
form->setObjectName(QString::fromUtf8("form"));
form->setContentsMargins(0, 0, 0, 0);
// CompleterTextEdit*pTDialog = new CompleterTextEdit(&dialog);
// pTDialog->setObjectName(QString::fromUtf8("pTDialog"));
// form->addWidget(pTDialog);
// pTDialog->setFont(QFont("宋体",24));
// QHBoxLayout*horizontalLayout = new QHBoxLayout();
// horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
// {
// CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str());
// if(!m_ListTableInf.m_TableName[0])
// {
// QString path=GetTemplatePath();
// QString strTplFilter="(*.lst)";
// QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter);
// if(defaultTempleteFile.isEmpty()) {
// return;
// }
// OnListTableInf(defaultTempleteFile);
// }
// DWORD bytes_write;
// char cardname[200]="valdepth_inp";
// int index_result = mem.OpenStream(cardname);
// if(index_result<0)
// {
// QString OutTab=m_ListTableInf.m_TableName;
// int iIndex=mem.OpenTable(OutTab.toStdString().c_str());
// if (iIndex<0)
// {
// AfxMessageBox(OutTab+"数据表不存在,请先生成表!");
// mem.Close();
// return;
// }
// int m_RecNum=0;
// int tabletype=0;
// int tabletype2=0;
// m_RecNum=mem.GetTableRecordCount(iIndex);
// QStringList STRS;
// STRS.append("NO DEPTH");
// char buf[200];
// QString css;
// for(int i=0;i<m_RecNum;i++) {
// if(mem.GetTableFieldData(iIndex,"DEPTH",buf,i+1)){
// css=QString::number(i+1)+" "+buf;
// STRS.append(css);
// }
// else {
// AfxMessageBox("成果表中\"DEPTH\"字段不存在,无非按照深度点进行取值!");
// break;
// }
// }
// mem.CloseTable(iIndex);
// pTDialog->document()->setPlainText(STRS.join("\n"));
// }
// else if(index_result>-1)
// {
// int len=mem.GetStreamLength(index_result);
// if(len>0) {
// char *buff=new char[len+1];
// DWORD lb=0;
// mem.ReadStream(index_result,len,&lb,buff);
// pTDialog->document()->setPlainText(buff);
// delete buff;
// }
// }
// mem.Close();
// }
// QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
// Qt::Horizontal, &dialog);
// form->addLayout(horizontalLayout);
// form->addWidget(&buttonBox);
// verticalLayoutWidget->addLayout(form, 0, 0, 1, 1);
// connect(pTDialog,SIGNAL(cursorPositionChanged()),
// this,SLOT(onCurrentLineHighLight()));
CompleterTextEdit*pTDialog = new CompleterTextEdit(&dialog);
pTDialog->setObjectName(QString::fromUtf8("pTDialog"));
form->addWidget(pTDialog);
pTDialog->setFont(QFont("宋体",24));
QHBoxLayout*horizontalLayout = new QHBoxLayout();
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
{
CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str());
if(!m_ListTableInf.m_TableName[0])
{
QString path=GetTemplatePath();
QString strTplFilter="(*.lst)";
QString defaultTempleteFile=QFileDialog::getOpenFileName(NULL,QObject::tr("选择模板"),path,strTplFilter);
if(defaultTempleteFile.isEmpty()) {
return;
}
OnListTableInf(defaultTempleteFile);
}
DWORD bytes_write;
char cardname[200]="valdepth_inp";
int index_result = mem.OpenStream(cardname);
if(index_result<0)
{
QString OutTab=m_ListTableInf.m_TableName;
int iIndex=mem.OpenTable(OutTab.toStdString().c_str());
if (iIndex<0)
{
AfxMessageBox(OutTab+"数据表不存在,请先生成表!");
mem.Close();
return;
}
int m_RecNum=0;
int tabletype=0;
int tabletype2=0;
m_RecNum=mem.GetTableRecordCount(iIndex);
QStringList STRS;
STRS.append("NO DEPTH");
char buf[200];
char szbuf[64] = "DEPTH";
QString css;
for(int i=0;i<m_RecNum;i++) {
if(mem.GetTableFieldData(iIndex,szbuf/*"DEPTH"*/,buf,i+1,false)){
css=QString::number(i+1)+" "+buf;
STRS.append(css);
}
else {
AfxMessageBox("成果表中\"DEPTH\"字段不存在,无非按照深度点进行取值!");
break;
}
}
mem.CloseTable(iIndex);
pTDialog->document()->setPlainText(STRS.join("\n"));
}
else if(index_result>-1)
{
int len=mem.GetStreamLength(index_result);
if(len>0) {
char *buff=new char[len+1];
DWORD lb=0;
mem.ReadStream(index_result,len,&lb,buff);
pTDialog->document()->setPlainText(buff);
delete buff;
}
}
mem.Close();
}
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
Qt::Horizontal, &dialog);
form->addLayout(horizontalLayout);
form->addWidget(&buttonBox);
verticalLayoutWidget->addLayout(form, 0, 0, 1, 1);
connect(pTDialog,SIGNAL(cursorPositionChanged()),
this,SLOT(onCurrentLineHighLight()));
// QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
// QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
// dialog.show();
// if (dialog.exec() == QDialog::Accepted) {
// QString text=pTDialog->document()->toPlainText();
// DWORD bytes_write;
// char cardname[200]="valdepth_inp";
// CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str());
// int index_result = mem.CreateStream(PARA_OBJECT,cardname,16384,FALSE);
QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
dialog.show();
if (dialog.exec() == QDialog::Accepted) {
QString text=pTDialog->document()->toPlainText();
DWORD bytes_write;
char cardname[200]="valdepth_inp";
CMemRdWt mem(pLog->GetSlfFileName().toStdString().c_str());
int index_result = mem.CreateStream(PARA_OBJECT,cardname,16384,FALSE);
// if(index_result>-1) {
// int len=strlen(text.toStdString().c_str());
// if(len>0) {
// DWORD lb=0;
// mem.WriteStream(index_result,len+1,&lb,text.toStdString().c_str());
// }
// }
// mem.Close();
// QString name=cardname;
// CObjWelllogRound *pWelllogRound=dynamic_cast<CObjWelllogRound*>(pRound);
// if(pWelllogRound) {
// PaiObject*pBase=pWelllogRound->GetObjectByName(name,GetClassID_WellLogINP());
// if(!dynamic_cast<CObjWellLogINP *>(pBase)){
// CObjWellLog * acurve=new CObjWellLogINP();
// if(acurve) {
// acurve->m_ObjectType=CARD_OBJECT;
// acurve->SetName(name);
// acurve->SetAliasName(name);
// acurve->SetSlfFileName(pLog->GetSlfFileName());
// acurve->SetWell(pWelllogRound->GetWell());
// pWelllogRound->AddChild(acurve);
// }
// }
// }
if(index_result>-1) {
int len=strlen(text.toStdString().c_str());
if(len>0) {
DWORD lb=0;
mem.WriteStream(index_result,len+1,&lb,text.toStdString().c_str());
}
}
mem.Close();
QString name=cardname;
// CObjWelllogRound *pWelllogRound=dynamic_cast<CObjWelllogRound*>(pRound);
// if(pWelllogRound) {
// PaiObject*pBase=pWelllogRound->GetObjectByName(name,GetClassID_WellLogINP());
// if(!dynamic_cast<CObjWellLogINP *>(pBase)){
// CObjWellLog * acurve=new CObjWellLogINP();
// if(acurve) {
// acurve->m_ObjectType=CARD_OBJECT;
// acurve->SetName(name);
// acurve->SetAliasName(name);
// acurve->SetSlfFileName(pLog->GetSlfFileName());
// acurve->SetWell(pWelllogRound->GetWell());
// pWelllogRound->AddChild(acurve);
// }
// }
// }
// QString SDEPS=pTDialog->toPlainText();
// SDEPS.replace("\r\n","\n");
// QStringList sdeps=SDEPS.split("\n");
// sdeps.removeAll("");
// for(int i=0;i<sdeps.size();i++) {
// QStringList cs=sdeps[i].split(" ");
// cs.removeAll("");
// if(!cs.size()) continue;
// QString cs1=cs.at(cs.size()-1);
// if(cs1.length()&&cs1.at(0).isDigit())
// {
// setTablePointValue(cs1.toFloat());
// }
// }
// pTDialog=NULL;
// int c=pDoc->GetFootSheetCount();
// for(int index=0;index<c;index++){
// CSheet* pSheet = pDoc->GetFootSheet( index );
// if(pSheet) {
// pSheet->SetLoadDataFromSLFEnabled(true);
// pSheet->LoadDataFromSLF();
// }
// }
// if (m_pSceneManager)
// {
// m_pSceneManager->UpdateAll();
// m_pSceneManager->GetCameraCommand().OnHScroll();
QString SDEPS=pTDialog->toPlainText();
SDEPS.replace("\r\n","\n");
QStringList sdeps=SDEPS.split("\n");
sdeps.removeAll("");
for(int i=0;i<sdeps.size();i++) {
QStringList cs=sdeps[i].split(" ");
cs.removeAll("");
if(!cs.size()) continue;
QString cs1=cs.at(cs.size()-1);
if(cs1.length()&&cs1.at(0).isDigit())
{
setTablePointValue(pLog,cs1.toFloat());
}
}
QStringList Names;
emit CallGlobalManage::getInstance()->sig_Notice_AddObject("WindowWellSection",pLog->GetSlfFileName(),Names);
// pTDialog=NULL;
// int c=pDoc->GetFootSheetCount();
// for(int index=0;index<c;index++){
// CSheet* pSheet = pDoc->GetFootSheet( index );
// if(pSheet) {
// pSheet->SetLoadDataFromSLFEnabled(true);
// pSheet->LoadDataFromSLF();
// }
// }
// if (m_pSceneManager)
// {
// m_pSceneManager->UpdateAll();
// m_pSceneManager->GetCameraCommand().OnHScroll();
// // hideEditGraphicsHeadCell();
// }
// }
// else {
// pTDialog=NULL;
// return;
// }
// }
}
else {
pTDialog=NULL;
return;
}
}
void CQtWindowWellSection::slotZoneListData(CObjWellLog *pLog)
{

View File

@ -13,7 +13,7 @@
#include "BaseObject.h"
#include "ObjWelllog.h"
// #include "VecWindow.h"
// #include "List_Table_Inf.h"
#include "List_Table_Inf.h"
// #include "WellSectionExport.h"
// #include "ObjWellTrack.h"
// #include "WellSectionWindowDocument.h"
@ -24,28 +24,6 @@
#pragma execution_character_set("utf-8")
#pragma warning( push ,0)
#pragma warning( pop )
struct LIST_TABLE_INF
{
int lstm;//是否每米取值0=不,>0,指定间隔
char m_TableName[16];
char m_TableType[16];//输出的统计表类型
char m_TableSpFIELD[16];//特征字段
int SPVALNUM;
char SPVAL[100][116];
int IsHB;
int Table_Field_Num;
int m_Mode;//取值模式选择0-每条曲线按各自给定取值方式取值1-按给定曲线的极值点深度取值
int m_Flag;//
int IsFC;//层内层列表
char m_CurveName[501];//特征曲线名
Slf_TABLE_FIELD Table_Field[100];
char RenName[100][116];
BYTE Type[100];
BYTE GetValueMode[100];
char ZdIndex[100][116];
char Format[100][116];
char TableName[100][116];
};
struct jiegutable_struct
{
@ -97,7 +75,7 @@ public slots:
// void slotSetShiftCurve(int type);
// void slotSetOtherShiftCurve(int type);
// void slotSetStandardCurve(int type);
void slotReFreshZoneListData();
void slotReFreshZoneListData(CObjWellLog *pLog);
// void slotSetShiftCurve();
// void slotSetOtherShiftCurve();
// void slotSetStandardCurve();
@ -116,7 +94,7 @@ public slots:
// void slotClearStandardMeg();
// void slotClearMegCurves();
// void setTablePointValue(float dep);
void setTablePointValue(CObjWellLog *pLog, float dep);
// void slotClearStandardShift(int type);
// void slotClearShiftCurves(int type);

View File

@ -596,6 +596,14 @@ void FormWell::s_NewTrack_No_Line(QString strUuid, QString strWellName, QString
void FormWell::slot_NewTrack_No_Line(QString strUuid, QJsonObject topObj, QJsonObject infoObj)
{
if(g_iLoadingJson==1)//针对模板加载
{
if(!m_bActive) //多井加载json时默认当前井为最后一口井激活状态。需要修改其他前面的井为非激活状态
{
return;
}
}
QString strWellName=g_strWellName;
QString strTrackName="";
//多井的打开工程使用模板的井名和slf名

View File

@ -68,9 +68,9 @@ public:
MainWindowCurve *m_pMainWinCurve = NULL;
bool m_bShowTrackHead = true; //显示道头
bool m_bMultiProject = false; //多井的打开工程使用模板的井名和slf名
bool m_bActive = true; //多井加载json时默认当前井为最后一口井激活状态。需要修改其他前面的井为非激活状态
bool m_bSetRowHeight = true; //默认非手工设置行高而是调用接口SetRowHeight
// 道图形
QMap<QString, QVector<QWidget*>> m_mapFormDraw;

View File

@ -32,6 +32,7 @@ SOURCES += \
CallManage.cpp \
CellBorderDlg.cpp \
ConsoleOutputWidget.cpp \
CreateResoultStructDlg.cpp \
CurveLine.cpp \
DepPairs.cpp \
DrawNrad.cpp \
@ -112,6 +113,7 @@ HEADERS += \
CallManage.h \
CellBorderDlg.h \
ConsoleOutputWidget.h \
CreateResoultStructDlg.h \
CurveLine.h \
DepPairs.h \
DraggablePixmap.h \
@ -187,6 +189,7 @@ HEADERS += \
wellheader.h
FORMS += \
CreateResoultStruct.ui \
CellBorderDalog.ui \
InDefTable.ui \
SetPageMeg.ui \

View File

@ -983,6 +983,7 @@ void MainWindowCurve::initMainToolBar()
QIcon sizeIcon(::GetImagePath()+"icon/full_scale.png");
QIcon zoominIcon(::GetImagePath()+"icon/zoomin.png");
QIcon zoomoutIcon(::GetImagePath()+"icon/zoomout.png");
QIcon zoomoldIcon(::GetImagePath()+"icon/full_scale.png");
QIcon wellTopAlignIcon(::GetImagePath()+"WellInterp/井顶对齐.png");
QIcon wellsSpaceIcon(::GetImagePath()+"WellInterp/井间距离.png");
@ -996,6 +997,7 @@ void MainWindowCurve::initMainToolBar()
m_zoomAc = new QAction(zoomIcon, "缩放", this);
m_zoominAc = new QAction(zoominIcon, "放大", this);
m_zoomoutAc = new QAction(zoomoutIcon, "缩小", this);
m_zoomoldAc = new QAction(zoomoldIcon, "原尺寸", this);
m_SaveAsPictureAc = new QAction(SaveAsPictureIcon, "导出长图", this);
m_SaveAsPdfAc = new QAction(SaveAsPdfIcon, "导出PDF", this);
m_SaveAsSvgAc = new QAction(SaveAsSvgIcon, "导出SVG", this);
@ -1027,6 +1029,7 @@ void MainWindowCurve::initMainToolBar()
QMenu* menuZoom = new QMenu(this);
menuZoom->addAction(m_zoominAc); //放大
menuZoom->addAction(m_zoomoutAc); //缩小
menuZoom->addAction(m_zoomoldAc); //还原
zoomMenuAction->setMenu(menuZoom);
// 导出成果图
@ -1047,8 +1050,8 @@ void MainWindowCurve::initMainToolBar()
QMenu* menuCreateTable = new QMenu(this);
menuCreateTable->addAction(m_CreateDataTable); //生成数据表
menuCreateTable->addAction(m_ZONEDataTable); //分段生成数据表
// menuCreateTable->addAction(m_SetDataTableFormat); //设置数据表格式
// menuCreateTable->addAction(m_ReFreshZONEDataTable); //按深度表更新数据表
menuCreateTable->addAction(m_SetDataTableFormat); //设置数据表格式
menuCreateTable->addAction(m_ReFreshZONEDataTable); //按深度表更新数据表
CreateTableMenuAction->setMenu(menuCreateTable);
// 图文件
@ -1118,6 +1121,7 @@ void MainWindowCurve::initMainToolBar()
connect(m_zoomAc, &QAction::triggered, this, &MainWindowCurve::s_Zoom);
connect(m_zoominAc, &QAction::triggered, this, &MainWindowCurve::s_ZoomIn);
connect(m_zoomoutAc, &QAction::triggered, this, &MainWindowCurve::s_ZoomOut);
connect(m_zoomoldAc, &QAction::triggered, this, &MainWindowCurve::s_ZoomOld);
connect(m_SaveAsPictureAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsPicture);
connect(m_SaveAsPdfAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsPdf);
connect(m_SaveAsSvgAc, &QAction::triggered, this, &MainWindowCurve::s_SaveAsSvg);
@ -2789,7 +2793,7 @@ void MainWindowCurve::s_autocor()
szBuffer+=szBuffer1;
//通知界面,增加一条校深线段
emit CallManage::getInstance()->sig_AddShifLineToPlot(m_strUuid, m_LeftCurve.m_strSlfName, m_LeftCurve.m_strWellName, m_LeftCurve.m_strTrackName, m_LeftCurve.m_strLineName, -edep, -sdep);
emit CallManage::getInstance()->sig_AddShifLineToPlot(m_strUuid, m_LeftCurve.m_strSlfName, m_LeftCurve.m_strWellName, m_LeftCurve.m_strTrackName, m_LeftCurve.m_strLineName, -sdep, -edep);
}
CMemRdWt mem;
if(mem.Open(m_RightCurve.m_strSlfName.toStdString().c_str()))
@ -4165,14 +4169,28 @@ void MainWindowCurve::s_Zoom()
void MainWindowCurve::s_ZoomIn()
{
//宽度放大
ZoomIn(1.1);
double dCurScale = (double)1.0 / (double)0.9;
ZoomIn(dCurScale);//1.1
//
m_dScale = m_dScale/dCurScale;
}
//缩小
void MainWindowCurve::s_ZoomOut()
{
//宽度缩小
ZoomIn(0.9);
double dCurScale = 0.9;
ZoomIn(dCurScale);
//
m_dScale = m_dScale/dCurScale;
}
//还原
void MainWindowCurve::s_ZoomOld()
{
ZoomIn(m_dScale);
//
m_dScale = 1.0;
}
//导出长图
@ -4617,7 +4635,8 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
//双道头
if(bDoubleHead)
{
iTotalSize_Height += iTableWellTrack_height*2 + (iNum-1)*iHeightOfScreen + (int)dLastHeight;//双道头
//下方不需要井名
iTotalSize_Height += iTableWellTrack_height*2-100 + (iNum-1)*iHeightOfScreen + (int)dLastHeight;//双道头
}
else{
iTotalSize_Height += iTableWellTrack_height + (iNum-1)*iHeightOfScreen + (int)dLastHeight;//单道头
@ -4683,10 +4702,14 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
ui->verticalScrollBar->setValue(-m_iY2*100);//设置右侧滚动条
ui->centralwidget->setGeometry(geoRect.x(), geoRect.y(), iMaxWidth, iHight+40);
QPixmap pPixmap_wellTrackInfo = this->grab(QRect(geoRect.x(), geoRect.y(), iMaxWidth, iTableWellTrack_height));
QPixmap pPixmap_wellTrackInfo2 = this->grab(QRect(geoRect.x(), geoRect.y()+ui->tableWidget_2->rowHeight(0) + (top+1), iMaxWidth, 100));
QPixmap pPixmap_wellTrackInfo3 = this->grab(QRect(geoRect.x(), geoRect.y()+ui->tableWidget_2->rowHeight(0) + (top+1) +100, iMaxWidth, iTableSize_Head-100+2));
//保存,方便查看
if(g_iDebug)
{
pPixmap_wellTrackInfo.save(tmpPath + "0.png");
pPixmap_wellTrackInfo2.save(tmpPath + "02.png");
pPixmap_wellTrackInfo3.save(tmpPath + "03.png");
}
if(IsBmp == 0 || IsBmp == 4)
{
@ -4791,9 +4814,10 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
mDepthProgress.SetShowName(s);
mDepthProgress.SetDepth(iNumShow+2);
//
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen-2)*(iNum-1) + (dLastHeight), pPixmap_wellTrackInfo);
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen-2)*(iNum-1) + (dLastHeight), pPixmap_wellTrackInfo3);
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height + (iHeightOfScreen-2)*(iNum-1) + (dLastHeight) + pPixmap_wellTrackInfo3.height(), pPixmap_wellTrackInfo2);
//尾
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height*2 + (iHeightOfScreen-2)*(iNum-1) + (dLastHeight), pPixmap_Tail);
painter.drawPixmap(0, iHight_Head + iTableWellTrack_height*2-100 + (iHeightOfScreen-2)*(iNum-1) + (dLastHeight), pPixmap_Tail);
//结束
painter.end();
}
@ -4816,7 +4840,8 @@ void MainWindowCurve::_slotExport(QPrinter &printer, int IsBmp, QString pngName,
mDepthProgress.SetShowName(s);
mDepthProgress.SetDepth(iNumShow+2);
//
images.append(convertToQImage(pPixmap_wellTrackInfo)); // 将QPixmap转换为QImage并存储到列表中
images.append(convertToQImage(pPixmap_wellTrackInfo3)); // 将QPixmap转换为QImage并存储到列表中
images.append(convertToQImage(pPixmap_wellTrackInfo2)); // 将QPixmap转换为QImage并存储到列表中
//尾
if(iHight_Tail)
{
@ -5135,11 +5160,46 @@ void MainWindowCurve::s_ZONEDataTable()
//设置数据表格式
void MainWindowCurve::s_SetDataTableFormat()
{}
{
CQtWindowWellSection QtWindowWellSection;
QtWindowWellSection.slotSetListTableStruct();
}
//按深度表更新数据表
void MainWindowCurve::s_ReFreshZONEDataTable()
{}
{
QString strSlfName = m_SelectTableItem.m_strSlfName;
QString strLineName = m_SelectTableItem.m_strLineName;
if(strSlfName.isEmpty() || strLineName.isEmpty())
{
QMessageBox::information(nullptr, "提示", "先选择数据表对象!");
return;
}
CMemRdWt mem;
if(mem.Open(strSlfName.toStdString().c_str()))
{
int iIndex=mem.FindObjectName((char *)(strLineName.toStdString().c_str()));
if (iIndex >= 0)
{
short objectType=mem.GetObjectType(iIndex);
if(objectType <=CARD_OBJECT&&objectType!=0)
{
QMessageBox::information(nullptr, "提示", "先选择数据表对象!");
return;
}
}
else
return;
}
else
return;
CObjWellLog* pLog= new CObjWellLog();
pLog->SetSlfFileName(strSlfName);
pLog->SetName(strLineName);
CQtWindowWellSection QtWindowWellSection;
QtWindowWellSection.slotReFreshZoneListData(pLog);
}
//选择井
void MainWindowCurve::s_selectWell()
@ -5518,6 +5578,7 @@ void MainWindowCurve::s_NewWell(QString strWellName, QString strSlfName, bool bS
widgetWell->m_bShowTrackHead = bShowTrackHead;
//多井的打开工程使用模板的井名和slf名
widgetWell->m_bMultiProject = m_bMultiProject;
widgetWell->m_bActive = true; //多井加载json时默认当前井为最后一口井激活状态。需要修改其他前面的井为非激活状态
//
ui->tableWidget_2->setCellWidget(i, columnCount, widgetWell);//默认用widgetWell填充满
m_mapFWell.insert(strWellName, widgetWell);
@ -7186,6 +7247,10 @@ void MainWindowCurve::DisplayWell_One(QJsonObject wellObjInfo)
s_NewWell(strWellName, strSlfName, m_bShowTrackHead);
//修改井的激活状态
//多井加载json时默认当前井为最后一口井激活状态。需要修改其他前面的井为非激活状态
modifyWellActive();
//
if (wellObjInfo.contains("formTracks"))
{
@ -8054,3 +8119,34 @@ void MainWindowCurve::restoreOriginalCentralWidget()
m_bHVDisplay = false;
return;
}
//修改井的激活状态
//多井加载json时默认当前井为最后一口井激活状态。需要修改其他前面的井为非激活状态
void MainWindowCurve::modifyWellActive()
{
//
int columnCount = ui->tableWidget_2->columnCount();//总列数
for(int i=0; i<columnCount-1; i++)
{
if(i%2==0)
{
}
else
{
//空白列
continue;
}
if( ui->tableWidget_2->cellWidget(1, i) != nullptr )
{
auto myWidget = ui->tableWidget_2->cellWidget(1, i);
//
FormWell *widgetWell = qobject_cast<FormWell*>(myWidget);//获得widget
if(widgetWell)
{
widgetWell->m_bActive = false; //多井加载json时默认当前井为最后一口井激活状态。需要修改其他前面的井为非激活状态
}
}
}
}

View File

@ -159,6 +159,9 @@ public:
QString m_fileJson="";
bool m_bMultiProject = false; //多井的打开工程使用模板的井名和slf名
//多井加载json时默认当前井为最后一口井激活状态。需要修改其他前面的井为非激活状态
void modifyWellActive();
public:
//样式
void loadStyle(const QString &qssFile);
@ -261,6 +264,7 @@ public:
QAction* m_zoomAc = nullptr; //缩放
QAction* m_zoominAc = nullptr; //放大
QAction* m_zoomoutAc = nullptr; //缩小
QAction* m_zoomoldAc = nullptr; //还原
QAction* m_SaveAsPictureAc = nullptr; //导出长图
QAction* m_SaveAsPdfAc = nullptr; //导出PDF
QAction* m_SaveAsSvgAc = nullptr; //导出SVG
@ -287,6 +291,8 @@ public:
//参数卡深度平移校正
QTextEdit *pTDialog;
//缩放还原
double m_dScale = 1.0;
public slots:
void s_NewWell(QString strWellName, QString strSlfName, bool bShowTrackHead = true);//新建井
void s_NewTrackChangeWidth(QString strWellName, double nW=0);//新建道后,改变井宽
@ -394,9 +400,12 @@ public slots:
void s_ZONEDataTable(); //分段生成数据表
void s_SetDataTableFormat();//设置数据表格式
void s_ReFreshZONEDataTable();//按深度表更新数据表
//
void s_Zoom(); //缩放
void s_ZoomIn(); //放大
void s_ZoomOut(); //缩小
void s_ZoomOld(); //还原
void s_Black(); //黑白图
void s_DoubleHead(); //单曲线头
void s_ExecuteDepthShift(); //校深

View File

@ -5890,7 +5890,8 @@ void QMyCustomPlot::addLineToPlot_Master(double left_Low, double right_Hight, co
if(pDraggableLine->m_strUuid == strUuid_biaozhun)
{
//存在老的同id线段进行移动
pDraggableLine->setRange(left_Low, right_Hight);
pDraggableLine->setRange(right_Hight, right_Hight);
//pDraggableLine->setRange(left_Low, right_Hight);
return;
}
it++;

View File

@ -126,6 +126,8 @@ void QMyTreeWidget::closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEd
item->setData(0, Qt::UserRole + 3, strNewName); // 存储额外数据,波列卡
}
item->setFlags(item->flags() & (~Qt::ItemIsEditable));
if (strTreeTag == "wellItem" || strTreeTag == "wellname")//井次或井名
emit closeTreeEditor();
return;