云端数据服务对接
This commit is contained in:
parent
55326eb33d
commit
858f2f00ce
172
logPlus/ApiClient.cpp
Normal file
172
logPlus/ApiClient.cpp
Normal file
|
|
@ -0,0 +1,172 @@
|
||||||
|
#include "ApiClient.h"
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
|
||||||
|
static QString joinUrl(const QString &base, const QString &path)
|
||||||
|
{
|
||||||
|
if (path.startsWith("http://") || path.startsWith("https://")) return path;
|
||||||
|
QString b = base;
|
||||||
|
QString p = path;
|
||||||
|
if (b.endsWith('/')) b.chop(1);
|
||||||
|
if (p.startsWith('/')) p.remove(0, 1);
|
||||||
|
if (b.isEmpty()) return p;
|
||||||
|
return b + '/' + p;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient* ApiClient::m_instance = nullptr;
|
||||||
|
ApiClient::ApiClient(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
, m_httpClient(new AeaQt::HttpClient(this))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient::~ApiClient()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient* ApiClient::getInstance()
|
||||||
|
{
|
||||||
|
if (m_instance == nullptr)
|
||||||
|
{
|
||||||
|
if (m_instance == nullptr)
|
||||||
|
{
|
||||||
|
m_instance = new ApiClient();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return m_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
AeaQt::HttpClient* ApiClient::httpClient() const { return m_httpClient; }
|
||||||
|
|
||||||
|
void ApiClient::setBaseUrl(const QString &baseUrl) { m_baseUrl = baseUrl; }
|
||||||
|
QString ApiClient::baseUrl() const { return m_baseUrl; }
|
||||||
|
|
||||||
|
void ApiClient::setToken(const QString &token)
|
||||||
|
{
|
||||||
|
// 保存时确保前缀存在:如果调用方传入原始 token(不带 Bearer)也能工作
|
||||||
|
if (token.startsWith("Bearer ")) m_token = token;
|
||||||
|
else if (token.isEmpty()) m_token.clear();
|
||||||
|
else m_token = "Bearer " + token;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString ApiClient::token() const { return m_token; }
|
||||||
|
|
||||||
|
void ApiClient::handleResponse(const QJsonObject &resp, SuccessCB onSuccess, FailedCB onFailed)
|
||||||
|
{
|
||||||
|
// 统一处理服务端返回格式:{ code, message, data }
|
||||||
|
int code = resp.value("code").toInt(-1);
|
||||||
|
QString message = resp.value("message").toString();
|
||||||
|
if (code != 0) {
|
||||||
|
if (onFailed) onFailed(message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 成功,优先返回 data 字段(如果存在且为 object),否则返回整个 resp
|
||||||
|
if (resp.contains("data") && resp.value("data").isObject()) {
|
||||||
|
if (onSuccess) onSuccess(resp.value("data").toObject());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (onSuccess) onSuccess(resp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiClient::login(const QString &username, const QString &password, SuccessCB onSuccess, FailedCB onFailed)
|
||||||
|
{
|
||||||
|
QJsonObject body;
|
||||||
|
|
||||||
|
body["login_mode"] = "local";
|
||||||
|
body["login_type"] = "username";
|
||||||
|
body["identifier"] = username;
|
||||||
|
body["password"] = password;
|
||||||
|
|
||||||
|
QString url = joinUrl(m_baseUrl, "/auth/api/v1/auth/login");
|
||||||
|
|
||||||
|
m_httpClient->post(url)
|
||||||
|
.bodyWithJson(body)
|
||||||
|
.onSuccess([this, onSuccess, onFailed](const QJsonObject &resp) {
|
||||||
|
// 先统一处理返回结构
|
||||||
|
this->handleResponse(resp,
|
||||||
|
// onSuccess -> 特殊处理 login 的 token 保存
|
||||||
|
[this, onSuccess](const QJsonObject &data) {
|
||||||
|
QString rawToken = data.value("token").toString();
|
||||||
|
if (!rawToken.isEmpty()) {
|
||||||
|
this->setToken(rawToken);
|
||||||
|
}
|
||||||
|
if (onSuccess) onSuccess(data);
|
||||||
|
},
|
||||||
|
// onFailed
|
||||||
|
[onFailed](const QString &err) {
|
||||||
|
if (onFailed) onFailed(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.onFailed([onFailed](const QString &err) {
|
||||||
|
if (onFailed) onFailed(err);
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiClient::get(const QString &path, SuccessCB onSuccess, FailedCB onFailed)
|
||||||
|
{
|
||||||
|
qDebug() << "ApiClient::get " << path;
|
||||||
|
QString url = joinUrl(m_baseUrl, path);
|
||||||
|
|
||||||
|
auto req = m_httpClient->get(url);
|
||||||
|
if (!m_token.isEmpty()) req.header("Authorization", m_token);
|
||||||
|
|
||||||
|
req.onSuccess([this, onSuccess, onFailed](const QJsonObject &resp) {
|
||||||
|
this->handleResponse(resp, onSuccess, onFailed);
|
||||||
|
})
|
||||||
|
.onFailed([onFailed](const QString &err) {
|
||||||
|
if (onFailed) onFailed(err);
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiClient::post(const QString &path, const QJsonObject &body, SuccessCB onSuccess, FailedCB onFailed)
|
||||||
|
{
|
||||||
|
qDebug() << "ApiClient::post " << path;
|
||||||
|
QString url = joinUrl(m_baseUrl, path);
|
||||||
|
|
||||||
|
auto req = m_httpClient->post(url).bodyWithJson(body);
|
||||||
|
if (!m_token.isEmpty()) req.header("Authorization", m_token);
|
||||||
|
|
||||||
|
req.onSuccess([this, onSuccess, onFailed](const QJsonObject &resp) {
|
||||||
|
this->handleResponse(resp, onSuccess, onFailed);
|
||||||
|
})
|
||||||
|
.onFailed([onFailed](const QString &err) {
|
||||||
|
if (onFailed) onFailed(err);
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiClient::put(const QString &path, const QJsonObject &body, SuccessCB onSuccess, FailedCB onFailed)
|
||||||
|
{
|
||||||
|
QString url = joinUrl(m_baseUrl, path);
|
||||||
|
|
||||||
|
auto req = m_httpClient->put(url).bodyWithJson(body);
|
||||||
|
if (!m_token.isEmpty()) req.header("Authorization", m_token);
|
||||||
|
|
||||||
|
req.onSuccess([this, onSuccess, onFailed](const QJsonObject &resp) {
|
||||||
|
this->handleResponse(resp, onSuccess, onFailed);
|
||||||
|
})
|
||||||
|
.onFailed([onFailed](const QString &err) {
|
||||||
|
if (onFailed) onFailed(err);
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ApiClient::del(const QString &path, SuccessCB onSuccess, FailedCB onFailed)
|
||||||
|
{
|
||||||
|
QString url = joinUrl(m_baseUrl, path);
|
||||||
|
|
||||||
|
auto req = m_httpClient->del(url);
|
||||||
|
if (!m_token.isEmpty()) req.header("Authorization", m_token);
|
||||||
|
|
||||||
|
req.onSuccess([this, onSuccess, onFailed](const QJsonObject &resp) {
|
||||||
|
this->handleResponse(resp, onSuccess, onFailed);
|
||||||
|
})
|
||||||
|
.onFailed([onFailed](const QString &err) {
|
||||||
|
if (onFailed) onFailed(err);
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
}
|
||||||
82
logPlus/ApiClient.h
Normal file
82
logPlus/ApiClient.h
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
// ApiClient.h
|
||||||
|
#ifndef APICLIENT_H
|
||||||
|
#define APICLIENT_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QString>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <functional>
|
||||||
|
#include "HttpClient.h"
|
||||||
|
|
||||||
|
class UserInfo{
|
||||||
|
public:
|
||||||
|
QString userId;
|
||||||
|
QString userName;
|
||||||
|
QString role;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class ApiClient : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit ApiClient(QObject *parent = nullptr);
|
||||||
|
~ApiClient();
|
||||||
|
|
||||||
|
static ApiClient* getInstance();
|
||||||
|
|
||||||
|
AeaQt::HttpClient* httpClient() const;
|
||||||
|
|
||||||
|
void setBaseUrl(const QString &baseUrl);
|
||||||
|
QString baseUrl() const;
|
||||||
|
|
||||||
|
void setToken(const QString &token);
|
||||||
|
QString token() const;
|
||||||
|
|
||||||
|
using SuccessCB = std::function<void(const QJsonObject &data)>; // 返回的 data 字段
|
||||||
|
using FailedCB = std::function<void(const QString &error)>;
|
||||||
|
|
||||||
|
void login(const QString &username, const QString &password, SuccessCB onSuccess, FailedCB onFailed);
|
||||||
|
|
||||||
|
// 设置和获取用户信息接口
|
||||||
|
void setUserInfo(const UserInfo &userInfo){
|
||||||
|
m_userInfo = userInfo;
|
||||||
|
};
|
||||||
|
void setUserInfo(QString userId, QString userName, QString role) {
|
||||||
|
m_userInfo.userId = userId;
|
||||||
|
m_userInfo.userName = userName;
|
||||||
|
m_userInfo.role = role;
|
||||||
|
};
|
||||||
|
UserInfo userInfo() const{
|
||||||
|
return m_userInfo;
|
||||||
|
};
|
||||||
|
QString getUsername() const
|
||||||
|
{
|
||||||
|
return userInfo().userName;
|
||||||
|
// return qgetenv("USERNAME"); // Windows
|
||||||
|
// return qgetenv("USER"); // Linux/Mac
|
||||||
|
}
|
||||||
|
QString getRole()
|
||||||
|
{
|
||||||
|
return m_userInfo.role;
|
||||||
|
}
|
||||||
|
|
||||||
|
void get(const QString &path, SuccessCB onSuccess, FailedCB onFailed);
|
||||||
|
void post(const QString &path, const QJsonObject &body, SuccessCB onSuccess, FailedCB onFailed);
|
||||||
|
|
||||||
|
void put(const QString &path, const QJsonObject &body, SuccessCB onSuccess, FailedCB onFailed);
|
||||||
|
|
||||||
|
void del(const QString &path, SuccessCB onSuccess, FailedCB onFailed);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void handleResponse(const QJsonObject &resp, SuccessCB onSuccess, FailedCB onFailed);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static ApiClient* m_instance;
|
||||||
|
AeaQt::HttpClient *m_httpClient;
|
||||||
|
QString m_token; // 保存的 Bearer token(带前缀)
|
||||||
|
QString m_baseUrl;
|
||||||
|
UserInfo m_userInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // APICLIENT_H
|
||||||
347
logPlus/CloudDataDlg.cpp
Normal file
347
logPlus/CloudDataDlg.cpp
Normal file
|
|
@ -0,0 +1,347 @@
|
||||||
|
#include "CloudDataDlg.h"
|
||||||
|
#include <QPainter>
|
||||||
|
#include "ApiClient.h"
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include "geometryutils.h"
|
||||||
|
|
||||||
|
static QString joinUrl(const QString &base, const QString &path)
|
||||||
|
{
|
||||||
|
if (path.startsWith("http://") || path.startsWith("https://")) return path;
|
||||||
|
QString b = base;
|
||||||
|
QString p = path;
|
||||||
|
if (b.endsWith('/')) b.chop(1);
|
||||||
|
if (p.startsWith('/')) p.remove(0, 1);
|
||||||
|
if (b.isEmpty()) return p;
|
||||||
|
return b + '/' + p;
|
||||||
|
}
|
||||||
|
|
||||||
|
CloudDataDlg::CloudDataDlg(QWidget *parent)
|
||||||
|
: QDialog(parent),
|
||||||
|
ui(new Ui::CloudDataDlg)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ApiClient::getInstance()->setBaseUrl("http://10.235.142.76:8090");
|
||||||
|
//setWindowTitle(QString::fromLocal8Bit("边框线形设置"));
|
||||||
|
connect(ui->btnAccess,SIGNAL(clicked()),this,SLOT(onEnter()));
|
||||||
|
|
||||||
|
ui->btn_back->setVisible(false);
|
||||||
|
ui->treeWidget->setColumnCount(1); //设置列数
|
||||||
|
ui->treeWidget->setHeaderHidden(true); // 隐藏表头
|
||||||
|
ui->treeWidget->setDragEnabled(false);
|
||||||
|
ui->treeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||||
|
connect(ui->treeWidget, &QTreeWidget::itemDoubleClicked, this, &CloudDataDlg::onItemDoubleClicked);
|
||||||
|
}
|
||||||
|
|
||||||
|
CloudDataDlg::~CloudDataDlg()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::initTreeProjects(QJsonObject jObj)
|
||||||
|
{
|
||||||
|
ui->btn_back->setVisible(false);
|
||||||
|
ui->treeWidget->clear();//清理数据
|
||||||
|
if (jObj.value("myProjects").isArray())
|
||||||
|
{
|
||||||
|
QJsonArray jarr = jObj.value("myProjects").toArray();
|
||||||
|
if (jarr.count() <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||||
|
item->setText(0, "我的项目");
|
||||||
|
item->setData(0, Qt::UserRole, "my_root"); // 存储额外数据,如ID
|
||||||
|
//item->setData(0, Qt::UserRole + 1, evaluationInfo.guid); // 存储额外数据,如ID
|
||||||
|
//
|
||||||
|
QIcon icon;
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Selected);
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Normal);
|
||||||
|
item->setIcon(0, icon);
|
||||||
|
// 这是一个根节点
|
||||||
|
ui->treeWidget->addTopLevelItem(item);
|
||||||
|
for (int i = 0; i < jarr.count(); i++)
|
||||||
|
{
|
||||||
|
if (!jarr[i].isObject())
|
||||||
|
continue;
|
||||||
|
QJsonObject obj = jarr[i].toObject();
|
||||||
|
|
||||||
|
QTreeWidgetItem *itemIndex = new QTreeWidgetItem();
|
||||||
|
itemIndex->setText(0, obj["projectName"].toString());
|
||||||
|
itemIndex->setData(0, Qt::UserRole, "project"); // 存储额外数据,如ID
|
||||||
|
itemIndex->setData(0, Qt::UserRole+1, obj["projectId"].toString()); // 存储额外数据,如ID
|
||||||
|
//
|
||||||
|
QIcon icon_wellfolder;
|
||||||
|
icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "closeproject.png"), QIcon::Selected);
|
||||||
|
icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "closeproject.png"), QIcon::Normal);
|
||||||
|
itemIndex->setIcon(0, icon_wellfolder);
|
||||||
|
item->addChild(itemIndex);//添加一级子节点
|
||||||
|
}
|
||||||
|
ui->treeWidget->expandItem(item);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (jObj.value("shareProjects").isArray())
|
||||||
|
{
|
||||||
|
QJsonArray jarr = jObj.value("shareProjects").toArray();
|
||||||
|
|
||||||
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||||
|
item->setText(0, "与我共享项目");
|
||||||
|
item->setData(0, Qt::UserRole, "my_share_root"); // 存储额外数据,如ID
|
||||||
|
//item->setData(0, Qt::UserRole + 1, evaluationInfo.guid); // 存储额外数据,如ID
|
||||||
|
//
|
||||||
|
QIcon icon;
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Selected);
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "project.png"), QIcon::Normal);
|
||||||
|
item->setIcon(0, icon);
|
||||||
|
// 这是一个根节点
|
||||||
|
ui->treeWidget->addTopLevelItem(item);
|
||||||
|
for (int i = 0; i < jarr.count(); i++)
|
||||||
|
{
|
||||||
|
if (!jarr[i].isObject())
|
||||||
|
continue;
|
||||||
|
QJsonObject obj = jarr[i].toObject();
|
||||||
|
|
||||||
|
QTreeWidgetItem *itemIndex = new QTreeWidgetItem();
|
||||||
|
itemIndex->setText(0, obj["projectName"].toString());
|
||||||
|
itemIndex->setData(0, Qt::UserRole, "project"); // 存储额外数据,如ID
|
||||||
|
itemIndex->setData(0, Qt::UserRole+1, obj["projectId"].toString()); // 存储额外数据,如ID
|
||||||
|
//
|
||||||
|
QIcon icon_wellfolder;
|
||||||
|
icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "closeproject.png"), QIcon::Selected);
|
||||||
|
icon_wellfolder.addPixmap(QPixmap(GetImagePath() + "closeproject.png"), QIcon::Normal);
|
||||||
|
itemIndex->setIcon(0, icon_wellfolder);
|
||||||
|
item->addChild(itemIndex);//添加一级子节点
|
||||||
|
}
|
||||||
|
ui->treeWidget->expandItem(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
//展开树图
|
||||||
|
//ui->treeWidget->expandItem(parent);
|
||||||
|
//itemIndex->setExpanded(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::initTreeWells(QJsonObject jObj)
|
||||||
|
{
|
||||||
|
ui->btn_back->setVisible(true);
|
||||||
|
ui->label_pro->setText(jObj["projectName"].toString());
|
||||||
|
ui->treeWidget->clear();//清理数据
|
||||||
|
if (jObj.value("wells").isArray())
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||||
|
item->setText(0, "井组");
|
||||||
|
item->setData(0, Qt::UserRole, "root"); // 存储额外数据,如ID
|
||||||
|
item->setData(0, Qt::UserRole+1, jObj["projectId"].toString()); // 存储额外数据,如ID
|
||||||
|
//
|
||||||
|
QIcon icon;
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "wellfolder.png"), QIcon::Selected);
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "wellfolder.png"), QIcon::Normal);
|
||||||
|
item->setIcon(0, icon);
|
||||||
|
// 这是一个根节点
|
||||||
|
ui->treeWidget->addTopLevelItem(item);
|
||||||
|
|
||||||
|
QJsonArray jarr = jObj.value("wells").toArray();
|
||||||
|
for (int i = 0; i < jarr.count(); i++)
|
||||||
|
{
|
||||||
|
if (!jarr[i].isObject())
|
||||||
|
continue;
|
||||||
|
QJsonObject obj = jarr[i].toObject();
|
||||||
|
|
||||||
|
// 井
|
||||||
|
QTreeWidgetItem *itemJing = new QTreeWidgetItem();
|
||||||
|
itemJing->setText(0, obj["wellName"].toString());
|
||||||
|
itemJing->setData(0, Qt::UserRole + 1, obj["wellId"].toString()); // 存储额外数据,项目名
|
||||||
|
//
|
||||||
|
QIcon icon;
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "well.png"), QIcon::Selected);
|
||||||
|
icon.addPixmap(QPixmap(GetImagePath() + "well.png"), QIcon::Normal);
|
||||||
|
itemJing->setIcon(0, icon);
|
||||||
|
//
|
||||||
|
item->addChild(itemJing);//添加一级子节点
|
||||||
|
|
||||||
|
QJsonArray staArr = obj["stages"].toArray();
|
||||||
|
if (staArr.count()<=0)
|
||||||
|
continue;
|
||||||
|
QJsonObject staObj = staArr[0].toObject();
|
||||||
|
// QString staid = staObj["stageId"].toString();
|
||||||
|
// QString staname = staObj["stageName"].toString();
|
||||||
|
QJsonArray dataCat = staObj["dataCategories"].toArray();
|
||||||
|
if (dataCat.count() <= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
QTreeWidgetItem *itemJingCi = new QTreeWidgetItem();
|
||||||
|
itemJingCi->setText(0, staObj["stageName"].toString());
|
||||||
|
itemJingCi->setData(0, Qt::UserRole + 1, staObj["stageId"].toString()); // 存储额外数据,项目名
|
||||||
|
//
|
||||||
|
QIcon iconci;
|
||||||
|
iconci.addPixmap(QPixmap(GetImagePath() + "icon/WellRound.png"), QIcon::Selected);
|
||||||
|
iconci.addPixmap(QPixmap(GetImagePath() + "icon/WellRound.png"), QIcon::Normal);
|
||||||
|
itemJingCi->setIcon(0, iconci);
|
||||||
|
itemJing->addChild(itemJingCi);//添加一级子节点
|
||||||
|
|
||||||
|
for (int k =0;k < dataCat.count(); k++)
|
||||||
|
{
|
||||||
|
QJsonObject catObj = dataCat[k].toObject();
|
||||||
|
// QString s1 = catObj["categoryId"].toString();
|
||||||
|
// QString s2 = catObj["categoryName"].toString();
|
||||||
|
// QString s3 = catObj["dataType"].toString();
|
||||||
|
bool b = initTreeData(itemJingCi, staObj, catObj, "curve", "icon/AddLog.png", "icon/Log.png");
|
||||||
|
if (b)
|
||||||
|
continue;
|
||||||
|
initTreeData(itemJingCi, staObj, catObj, "array", "icon/tdt.png", "icon/tdt.png");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
ui->treeWidget->expandItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CloudDataDlg::initTreeData(QTreeWidgetItem* itemJingCi, QJsonObject& jObjCi, QJsonObject catObj,
|
||||||
|
QString strDataType, QString strIcon1, QString strIcon2)
|
||||||
|
{
|
||||||
|
bool bret = false;
|
||||||
|
if (catObj["dataType"].toString() == strDataType)
|
||||||
|
{
|
||||||
|
QJsonArray sitem = catObj["items"].toArray();
|
||||||
|
// 曲线数量
|
||||||
|
int nCurveItem = sitem.count();
|
||||||
|
if (nCurveItem > 0)
|
||||||
|
{
|
||||||
|
//曲线
|
||||||
|
QTreeWidgetItem *itemCurve = new QTreeWidgetItem();
|
||||||
|
itemCurve->setText(0, "curve" == strDataType? "曲线":"波列数据");
|
||||||
|
itemCurve->setData(0, Qt::UserRole, strDataType); // 存储额外数据,如ID
|
||||||
|
QIcon iconCurve;
|
||||||
|
iconCurve.addPixmap(QPixmap(GetImagePath() + strIcon1), QIcon::Selected);
|
||||||
|
iconCurve.addPixmap(QPixmap(GetImagePath() + strIcon1), QIcon::Normal);
|
||||||
|
itemCurve->setIcon(0, iconCurve);
|
||||||
|
itemJingCi->addChild(itemCurve);
|
||||||
|
|
||||||
|
for (int m = 0; m < sitem.count(); m++)
|
||||||
|
{
|
||||||
|
QJsonObject tmpItem = sitem[m].toObject();
|
||||||
|
QString sName = "";
|
||||||
|
QString sTypeObj = "";
|
||||||
|
if ("curve" == strDataType)
|
||||||
|
{
|
||||||
|
sTypeObj = "curveObject";
|
||||||
|
sName = tmpItem["curveName"].toString();
|
||||||
|
}
|
||||||
|
else if ("array" == strDataType)
|
||||||
|
{
|
||||||
|
sTypeObj = "waveObject";
|
||||||
|
sName = tmpItem["arrayName"].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QTreeWidgetItem *itemCurveLog = new QTreeWidgetItem();
|
||||||
|
itemCurveLog->setText(0, sName);
|
||||||
|
itemCurveLog->setData(0, Qt::UserRole, sTypeObj); // 存储额外数据,如ID
|
||||||
|
itemCurveLog->setData(0, Qt::UserRole + 1, tmpItem["metadataId"].toString()); // 存储额外数据,井次文件路径
|
||||||
|
//
|
||||||
|
QIcon iconLog;
|
||||||
|
iconLog.addPixmap(QPixmap(GetImagePath() + strIcon1), QIcon::Selected);
|
||||||
|
iconLog.addPixmap(QPixmap(GetImagePath() + strIcon2), QIcon::Normal);
|
||||||
|
itemCurveLog->setIcon(0, iconLog);
|
||||||
|
itemCurve->addChild(itemCurveLog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bret = true;
|
||||||
|
}
|
||||||
|
return bret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::getList()
|
||||||
|
{
|
||||||
|
QString sapi = "/core/project/list";
|
||||||
|
ApiClient::getInstance()->get(sapi,
|
||||||
|
[this](const QJsonObject& response)
|
||||||
|
{
|
||||||
|
this->initTreeProjects(response);
|
||||||
|
},
|
||||||
|
[](const QString& error)
|
||||||
|
{
|
||||||
|
qDebug() << "Failed to allocate hours:" << error;
|
||||||
|
// 可以添加错误提示
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::getWells(QString projectId)
|
||||||
|
{
|
||||||
|
QString sapi = "/core/project/tree?projectId=" + projectId;
|
||||||
|
ApiClient::getInstance()->get(sapi,
|
||||||
|
[this](const QJsonObject& response)
|
||||||
|
{
|
||||||
|
this->initTreeWells(response);
|
||||||
|
},
|
||||||
|
[](const QString& error)
|
||||||
|
{
|
||||||
|
qDebug() << "Failed to allocate hours:" << error;
|
||||||
|
// 可以添加错误提示
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::on_btn_back_clicked()
|
||||||
|
{
|
||||||
|
this->getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::on_btn_import_clicked()
|
||||||
|
{
|
||||||
|
QMap<QString, QVector<QString>> mapSelect;
|
||||||
|
foreach(QTreeWidgetItem *pItem, ui->treeWidget->selectedItems())
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *parentItem = pItem->parent()->parent(); // 上两层目录是井次
|
||||||
|
if (parentItem)
|
||||||
|
{
|
||||||
|
QString strType = pItem->data(0, Qt::UserRole).toString();
|
||||||
|
QString strId = pItem->data(0, Qt::UserRole + 1).toString();
|
||||||
|
QString strName = pItem->text(0);
|
||||||
|
qDebug() << "选择:" << strType << "," << strId << "," << strName;
|
||||||
|
if (mapSelect.contains(strType))
|
||||||
|
{
|
||||||
|
mapSelect[strType].push_back(strId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QVector<QString> v;
|
||||||
|
v << strId;
|
||||||
|
mapSelect.insert(strType, v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::onItemDoubleClicked(QTreeWidgetItem* item, int index)
|
||||||
|
{
|
||||||
|
QString strTag = item->data(0, Qt::UserRole).toString();
|
||||||
|
if ("project" == strTag)
|
||||||
|
{
|
||||||
|
QString strProId = item->data(0, Qt::UserRole+1).toString();
|
||||||
|
this->getWells(strProId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::OnSelectLineStyleChanged(int style,int lineWidth)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
void CloudDataDlg::onEnter()
|
||||||
|
{
|
||||||
|
ApiClient::getInstance()->login("Test1", "Test123456",
|
||||||
|
[this](const QJsonObject& response)
|
||||||
|
{
|
||||||
|
this->getList();
|
||||||
|
},
|
||||||
|
[](const QString& error)
|
||||||
|
{
|
||||||
|
qDebug() << "Failed to allocate hours:" << error;
|
||||||
|
// 可以添加错误提示
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloudDataDlg::paintEvent(QPaintEvent *pevt)
|
||||||
|
{
|
||||||
|
QDialog::paintEvent(pevt);
|
||||||
|
}
|
||||||
43
logPlus/CloudDataDlg.h
Normal file
43
logPlus/CloudDataDlg.h
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
#ifndef CloudDataDlg_H
|
||||||
|
#define CloudDataDlg_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "ui_CloudDataDlg.h"
|
||||||
|
#include "formtableitem.h"
|
||||||
|
|
||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
|
//单元格边框选中对话框
|
||||||
|
class CloudDataDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
CloudDataDlg(QWidget *parent = 0);
|
||||||
|
~CloudDataDlg();
|
||||||
|
|
||||||
|
void initTreeProjects(QJsonObject jObj);//加载树图
|
||||||
|
void initTreeWells(QJsonObject jObj);//加载树图
|
||||||
|
bool initTreeData(QTreeWidgetItem* itemJing, QJsonObject& jObjCi, QJsonObject catObj,
|
||||||
|
QString strDataType, QString strIcon1, QString strIcon2);
|
||||||
|
void getList();
|
||||||
|
void getWells(QString projectId);
|
||||||
|
protected:
|
||||||
|
virtual void paintEvent(QPaintEvent *pevt);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_btn_back_clicked();
|
||||||
|
void on_btn_import_clicked();
|
||||||
|
|
||||||
|
void onItemDoubleClicked(QTreeWidgetItem* item, int index);//鼠标双击tree菜单项
|
||||||
|
|
||||||
|
void OnSelectLineStyleChanged(int ,int);
|
||||||
|
void onEnter();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::CloudDataDlg *ui;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CloudDataDlg_H
|
||||||
193
logPlus/CloudDataDlg.ui
Normal file
193
logPlus/CloudDataDlg.ui
Normal file
|
|
@ -0,0 +1,193 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>CloudDataDlg</class>
|
||||||
|
<widget class="QDialog" name="CloudDataDlg">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>629</width>
|
||||||
|
<height>666</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>边框线形设置</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,0">
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget1" native="true">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_pro">
|
||||||
|
<property name="text">
|
||||||
|
<string>项目列表</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_back">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>< 返回</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QMyTreeWidget" name="treeWidget">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>登陆</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>账号:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit_2"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>密码:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnAccess">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>确定</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_import">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>云端数据导入</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>QMyTreeWidget</class>
|
||||||
|
<extends>QTreeWidget</extends>
|
||||||
|
<header>qmytreewidget.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
1967
logPlus/HttpClient.h
Normal file
1967
logPlus/HttpClient.h
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -31,6 +31,7 @@ SOURCES += \
|
||||||
BorderPreView.cpp \
|
BorderPreView.cpp \
|
||||||
CallManage.cpp \
|
CallManage.cpp \
|
||||||
CellBorderDlg.cpp \
|
CellBorderDlg.cpp \
|
||||||
|
CloudDataDlg.cpp \
|
||||||
ConsoleOutputWidget.cpp \
|
ConsoleOutputWidget.cpp \
|
||||||
CreateResoultStructDlg.cpp \
|
CreateResoultStructDlg.cpp \
|
||||||
CurveLine.cpp \
|
CurveLine.cpp \
|
||||||
|
|
@ -112,6 +113,7 @@ HEADERS += \
|
||||||
BorderPreView.h \
|
BorderPreView.h \
|
||||||
CallManage.h \
|
CallManage.h \
|
||||||
CellBorderDlg.h \
|
CellBorderDlg.h \
|
||||||
|
CloudDataDlg.h \
|
||||||
ConsoleOutputWidget.h \
|
ConsoleOutputWidget.h \
|
||||||
CreateResoultStructDlg.h \
|
CreateResoultStructDlg.h \
|
||||||
CurveLine.h \
|
CurveLine.h \
|
||||||
|
|
@ -189,6 +191,7 @@ HEADERS += \
|
||||||
wellheader.h
|
wellheader.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
CloudDataDlg.ui \
|
||||||
CreateResoultStruct.ui \
|
CreateResoultStruct.ui \
|
||||||
CellBorderDalog.ui \
|
CellBorderDalog.ui \
|
||||||
InDefTable.ui \
|
InDefTable.ui \
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
<QtMoc Include="CellBorderDlg.h" />
|
<QtMoc Include="CellBorderDlg.h" />
|
||||||
<QtMoc Include="BorderPreView.h" />
|
<QtMoc Include="BorderPreView.h" />
|
||||||
<QtMoc Include="CreateResoultStructDlg.h" />
|
<QtMoc Include="CreateResoultStructDlg.h" />
|
||||||
|
<QtMoc Include="CloudDataDlg.h" />
|
||||||
|
<QtMoc Include="HttpClient.h" />
|
||||||
|
<QtMoc Include="ApiClient.h" />
|
||||||
<ClInclude Include="LIST_TABLE_INF.h" />
|
<ClInclude Include="LIST_TABLE_INF.h" />
|
||||||
<ClInclude Include="LogmuditemDrawer.h" />
|
<ClInclude Include="LogmuditemDrawer.h" />
|
||||||
<QtMoc Include="LogmudResultItem.h" />
|
<QtMoc Include="LogmudResultItem.h" />
|
||||||
|
|
@ -162,11 +165,13 @@
|
||||||
<ClCompile Include="3rd_tiff\libtiff\port\getopt.c" />
|
<ClCompile Include="3rd_tiff\libtiff\port\getopt.c" />
|
||||||
<ClCompile Include="3rd_tiff\libtiff\port\lfind.c" />
|
<ClCompile Include="3rd_tiff\libtiff\port\lfind.c" />
|
||||||
<ClCompile Include="3rd_tiff\libtiff\port\snprintf.c" />
|
<ClCompile Include="3rd_tiff\libtiff\port\snprintf.c" />
|
||||||
|
<ClCompile Include="ApiClient.cpp" />
|
||||||
<ClCompile Include="backgrounddelegate.cpp" />
|
<ClCompile Include="backgrounddelegate.cpp" />
|
||||||
<ClCompile Include="BorderPreView.cpp" />
|
<ClCompile Include="BorderPreView.cpp" />
|
||||||
<ClCompile Include="CallManage.cpp" />
|
<ClCompile Include="CallManage.cpp" />
|
||||||
<ClCompile Include="CellBorderDlg.cpp" />
|
<ClCompile Include="CellBorderDlg.cpp" />
|
||||||
<ClCompile Include="chooseShiftCurvesDlg.cpp" />
|
<ClCompile Include="chooseShiftCurvesDlg.cpp" />
|
||||||
|
<ClCompile Include="CloudDataDlg.cpp" />
|
||||||
<ClCompile Include="ConsoleOutputWidget.cpp" />
|
<ClCompile Include="ConsoleOutputWidget.cpp" />
|
||||||
<ClCompile Include="CreateResoultStructDlg.cpp" />
|
<ClCompile Include="CreateResoultStructDlg.cpp" />
|
||||||
<ClCompile Include="CurveLine.cpp" />
|
<ClCompile Include="CurveLine.cpp" />
|
||||||
|
|
@ -251,6 +256,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtUic Include="CellBorderDalog.ui" />
|
<QtUic Include="CellBorderDalog.ui" />
|
||||||
<QtUic Include="chooseShiftCurves.ui" />
|
<QtUic Include="chooseShiftCurves.ui" />
|
||||||
|
<QtUic Include="CloudDataDlg.ui" />
|
||||||
<QtUic Include="CreateResoultStruct.ui" />
|
<QtUic Include="CreateResoultStruct.ui" />
|
||||||
<QtUic Include="formdraw.ui" />
|
<QtUic Include="formdraw.ui" />
|
||||||
<QtUic Include="formhead.ui" />
|
<QtUic Include="formhead.ui" />
|
||||||
|
|
@ -301,7 +307,7 @@
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||||
<QtInstall>msvc2017_64</QtInstall>
|
<QtInstall>msvc2017_64</QtInstall>
|
||||||
<QtModules>core;gui;svg;widgets;printsupport</QtModules>
|
<QtModules>core;network;gui;svg;widgets;printsupport</QtModules>
|
||||||
<QtBuildConfig>debug</QtBuildConfig>
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
|
|
||||||
|
|
@ -355,6 +355,15 @@
|
||||||
<QtMoc Include="CreateResoultStructDlg.h">
|
<QtMoc Include="CreateResoultStructDlg.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</QtMoc>
|
</QtMoc>
|
||||||
|
<QtMoc Include="CloudDataDlg.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="HttpClient.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="ApiClient.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="backgrounddelegate.cpp">
|
<ClCompile Include="backgrounddelegate.cpp">
|
||||||
|
|
@ -738,6 +747,12 @@
|
||||||
<ClCompile Include="CreateResoultStructDlg.cpp">
|
<ClCompile Include="CreateResoultStructDlg.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="CloudDataDlg.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="ApiClient.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtRcc Include="logplus.qrc">
|
<QtRcc Include="logplus.qrc">
|
||||||
|
|
@ -832,5 +847,8 @@
|
||||||
<QtUic Include="CreateResoultStruct.ui">
|
<QtUic Include="CreateResoultStruct.ui">
|
||||||
<Filter>Form Files</Filter>
|
<Filter>Form Files</Filter>
|
||||||
</QtUic>
|
</QtUic>
|
||||||
|
<QtUic Include="CloudDataDlg.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include "mainwindowsplitter.h"
|
#include "mainwindowsplitter.h"
|
||||||
#include "ConvertorManager.h"
|
#include "ConvertorManager.h"
|
||||||
#include "CallGlobalManage.h"
|
#include "CallGlobalManage.h"
|
||||||
|
#include "CloudDataDlg.h"
|
||||||
using namespace pai::gui;
|
using namespace pai::gui;
|
||||||
//
|
//
|
||||||
int g_iOneWidth = 4; //道宽
|
int g_iOneWidth = 4; //道宽
|
||||||
|
|
@ -300,6 +300,7 @@ void MainWindow::initTitleBar()
|
||||||
//
|
//
|
||||||
QMenu* m_dataMenu = this->menuBar()->addMenu(tr("数据管理(&D)"));
|
QMenu* m_dataMenu = this->menuBar()->addMenu(tr("数据管理(&D)"));
|
||||||
m_dataMenu->addAction(QIcon( ::GetImagePath() + "wellog.png"), tr("&数据导入"), this, SLOT(s_ImportSingleWellLogData()));
|
m_dataMenu->addAction(QIcon( ::GetImagePath() + "wellog.png"), tr("&数据导入"), this, SLOT(s_ImportSingleWellLogData()));
|
||||||
|
m_dataMenu->addAction(QIcon( ::GetImagePath() + "sharing.png"), tr("&云端数据互通"), this, SLOT(s_cloudData()));
|
||||||
//
|
//
|
||||||
QMenu* m_analyzeToolMenu = this->menuBar()->addMenu(tr("分析工具(&W)"));
|
QMenu* m_analyzeToolMenu = this->menuBar()->addMenu(tr("分析工具(&W)"));
|
||||||
m_analyzeToolMenu->addAction(QIcon( ::GetImagePath() + "outcurves.png"), tr("&数据导出"), this, SLOT(s_OutWellLogRound()));
|
m_analyzeToolMenu->addAction(QIcon( ::GetImagePath() + "outcurves.png"), tr("&数据导出"), this, SLOT(s_OutWellLogRound()));
|
||||||
|
|
@ -755,6 +756,12 @@ void MainWindow::s_showView()
|
||||||
// searchThread->Open(fileFull);
|
// searchThread->Open(fileFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::s_cloudData()
|
||||||
|
{
|
||||||
|
CloudDataDlg dlg;
|
||||||
|
dlg.exec();
|
||||||
|
}
|
||||||
|
|
||||||
//开发工具
|
//开发工具
|
||||||
void MainWindow::s_development()
|
void MainWindow::s_development()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,9 @@ public slots:
|
||||||
void s_ReOpen(QString fileFull, QString fileName, bool bMultiProject);
|
void s_ReOpen(QString fileFull, QString fileName, bool bMultiProject);
|
||||||
//可视解释
|
//可视解释
|
||||||
void s_showView();
|
void s_showView();
|
||||||
|
//云数据
|
||||||
|
void s_cloudData();
|
||||||
|
|
||||||
//开发工具
|
//开发工具
|
||||||
void s_development();
|
void s_development();
|
||||||
void s_ShowParameterCard(QString strSlfName, QString strName);//参数卡数据查看
|
void s_ShowParameterCard(QString strSlfName, QString strName);//参数卡数据查看
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user