145 lines
4.4 KiB
C
145 lines
4.4 KiB
C
|
|
/**
|
|||
|
|
* @file ImportDataDialog.h
|
|||
|
|
* @brief 测井数据导入界面
|
|||
|
|
* @date 2014-8-8
|
|||
|
|
* @author: ZhouWenfei
|
|||
|
|
*/
|
|||
|
|
#ifndef IMPORTDATA_H
|
|||
|
|
#define IMPORTDATA_H
|
|||
|
|
#pragma warning( push ,0)
|
|||
|
|
#include <QDialog>
|
|||
|
|
//#include "ObjectFolder.h"
|
|||
|
|
//#include "ObjProject.h"
|
|||
|
|
#include <QItemDelegate>
|
|||
|
|
#include "ConvertorManager.h"
|
|||
|
|
#include "InterfaceWidget.h"
|
|||
|
|
#include "ConvertorExport.h"
|
|||
|
|
|
|||
|
|
//#include "ObjWell.h"
|
|||
|
|
//#include "Family.h"
|
|||
|
|
|
|||
|
|
//#include "ProjectCommand.h"
|
|||
|
|
|
|||
|
|
#pragma execution_character_set("utf-8")
|
|||
|
|
|
|||
|
|
#pragma warning( pop )
|
|||
|
|
|
|||
|
|
namespace Ui
|
|||
|
|
{
|
|||
|
|
class ImportData ;
|
|||
|
|
}
|
|||
|
|
BEGIN_OSGGRAPHICS_NAMESPACE;
|
|||
|
|
//用于在表格中解析曲线类型Family
|
|||
|
|
class FamilyDelegate : public QItemDelegate
|
|||
|
|
{
|
|||
|
|
Q_OBJECT
|
|||
|
|
public:
|
|||
|
|
FamilyDelegate(QObject *parent = 0): QItemDelegate(parent) { }
|
|||
|
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
|||
|
|
const QModelIndex &index) const
|
|||
|
|
{
|
|||
|
|
QComboBox *editor = new QComboBox(parent);
|
|||
|
|
// static std::vector<Family> familys;//避免多次从数据库加载
|
|||
|
|
// if(familys.size()<=0){
|
|||
|
|
// Family afa;
|
|||
|
|
// afa.GetFamily(familys);
|
|||
|
|
// }
|
|||
|
|
// for(int i=0;i<familys.size();i++)
|
|||
|
|
// {
|
|||
|
|
// editor->addItem(QString::fromStdString(familys[i].GetFamilyType()));
|
|||
|
|
// }
|
|||
|
|
return editor;
|
|||
|
|
}
|
|||
|
|
void setEditorData(QWidget *editor, const QModelIndex &index) const
|
|||
|
|
{
|
|||
|
|
QString text = index.model()->data(index, Qt::EditRole).toString();
|
|||
|
|
QComboBox *comboBox = static_cast<QComboBox*>(editor);
|
|||
|
|
int tindex = comboBox->findText(text);
|
|||
|
|
comboBox->setCurrentIndex(tindex);
|
|||
|
|
}
|
|||
|
|
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
|||
|
|
const QModelIndex &index) const
|
|||
|
|
{
|
|||
|
|
QComboBox *comboBox = static_cast<QComboBox*>(editor);
|
|||
|
|
QString text = comboBox->currentText();
|
|||
|
|
model->setData(index, text, Qt::EditRole);
|
|||
|
|
}
|
|||
|
|
void updateEditorGeometry(QWidget *editor,
|
|||
|
|
const QStyleOptionViewItem &option, const QModelIndex &index) const
|
|||
|
|
{
|
|||
|
|
editor->setGeometry(option.rect);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
class CONVERTOR_EXPORT ImportDataDialog : public QDialog
|
|||
|
|
{
|
|||
|
|
Q_OBJECT
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
ImportDataDialog(QWidget *parent = 0,QString wellname="",QString wellroundname="");
|
|||
|
|
|
|||
|
|
~ImportDataDialog();
|
|||
|
|
QString m_CurrentWellName;
|
|||
|
|
QString m_CurrentWellRoundName;
|
|||
|
|
public:
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @brief 展示主界面数据
|
|||
|
|
* @param[in]ConvertorVector 所有转换器
|
|||
|
|
* @param[in]filePath 文件路径
|
|||
|
|
*/
|
|||
|
|
void DisplayFileInformationAreaData( const QVector<IConvertor*>ConvertorVector,const QString filePath);
|
|||
|
|
bool IsHaveSameCurve(int NumLog,vector<int> &OutCurveNo,vector<char*> &OutCurve);
|
|||
|
|
void SetProjectname(const QString projectname){m_projectname = projectname;}
|
|||
|
|
//int CheckExistCurve(QString outputfilename,int NumLog,vector<int>& OutCurveNo,vector<char*>& OutCurve);
|
|||
|
|
private:
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @brief 选择区数据展示
|
|||
|
|
* @param[in]pInterface 主界面UI
|
|||
|
|
* @param[in]fileHead 表头
|
|||
|
|
* @param[in]CurverName 曲线名
|
|||
|
|
* @param[in]pConvertor 转换器
|
|||
|
|
*/
|
|||
|
|
void DisplaySelectAreaData( InterfaceWidget *pInterface,const QStringList fileHead, IConvertor *pConvertor);
|
|||
|
|
|
|||
|
|
private slots:
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @brief 确定按钮曲线上树信号槽
|
|||
|
|
*/
|
|||
|
|
virtual void AcceptOK();
|
|||
|
|
//whp add 2019.10.12
|
|||
|
|
void SelAll();
|
|||
|
|
void NotSelAll();
|
|||
|
|
void ReverseSel();
|
|||
|
|
private:
|
|||
|
|
|
|||
|
|
// CObjWell * GetWellBaseName(IConvertor *pConvertor,const std::string strWellName);
|
|||
|
|
|
|||
|
|
bool SelectAndDeleteWellLog(int row,/* QList<CObjWellLog*>&vOSGWellLog,*/InterfaceWidget *pCurrentInterfaceWidget, int ColumnCount,IConvertor *pConvertor);//, CBaseObject *pWellTime);
|
|||
|
|
|
|||
|
|
void InitWell(InterfaceWidget *pInterfaceWidget,IConvertor*pConvertor);
|
|||
|
|
|
|||
|
|
void InitWellLogRound(InterfaceWidget *pInterfaceWidget,IConvertor*pConvertor);
|
|||
|
|
|
|||
|
|
void UpdateWell(InterfaceWidget *pInterfaceWidget,IConvertor *pConvertor);
|
|||
|
|
|
|||
|
|
void UpdateWellLogRound(InterfaceWidget *pInterfaceWidget,IConvertor *pConvertor);
|
|||
|
|
private:
|
|||
|
|
//内部数据采用slf格式处理,尤其是wave\table类数据,需要自动生成slf文件名
|
|||
|
|
QString GenerateSlfFileName(InterfaceWidget *pCurrentInterfaceWidget);
|
|||
|
|
QVector<IConvertor*>m_vConvertorVector;
|
|||
|
|
std::map<QWidget*,InterfaceWidget*>m_TabInterWidget;
|
|||
|
|
// std::map<IConvertor*,QList<CObjWellLog*> >m_ConvertorWellLog;
|
|||
|
|
Ui::ImportData *m_pImportDataUI;
|
|||
|
|
QString m_FilePath;
|
|||
|
|
bool m_ExistSameWellName;
|
|||
|
|
bool m_ExistSameWellRoundName;
|
|||
|
|
QString m_projectname;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
END_OSGGRAPHICS_NAMESPACE;
|
|||
|
|
using namespace pai::graphics;
|
|||
|
|
#endif // IMPORTDATA_H
|