增加了界面
parent
f7bdcc314f
commit
f7d36e4309
|
|
@ -84,6 +84,11 @@ add_library(PluginRCSDBManager
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
RCSDBManagerClass.cpp
|
RCSDBManagerClass.cpp
|
||||||
RCSDBManagerClass.h
|
RCSDBManagerClass.h
|
||||||
|
RCSDBQueryDialog.cpp
|
||||||
|
RCSDBQueryDialog.h
|
||||||
|
RCSDBQueryDialog.ui
|
||||||
|
QueryDataTableModel.cpp
|
||||||
|
QueryDataTableModel.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,401 @@
|
||||||
|
//
|
||||||
|
// Created by 30453 on 25-6-26.
|
||||||
|
//
|
||||||
|
#include <QColor>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
#include <QDebug>
|
||||||
|
#include "QueryDataTableModel.h"
|
||||||
|
|
||||||
|
#include "Settings/BusAPI.h"
|
||||||
|
|
||||||
|
namespace RCSDBManagerTool {
|
||||||
|
|
||||||
|
|
||||||
|
QueryDataTableModel::QueryDataTableModel(QObject* parent)
|
||||||
|
: QAbstractTableModel(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryDataTableModel::~QueryDataTableModel() {}
|
||||||
|
|
||||||
|
void QueryDataTableModel::loadProjectDescDataSet(std::vector<ProjectDesc> projectdescSets) {
|
||||||
|
QStringList colnames;
|
||||||
|
QVector<QVector<QVariant>> datamap(0);
|
||||||
|
QStringList rowIDlist;
|
||||||
|
bool hascolnames = true;
|
||||||
|
colnames.append(u8"ProjectID");
|
||||||
|
colnames.append(u8"projectname");
|
||||||
|
colnames.append(u8"desc");
|
||||||
|
colnames.append(u8"projectFolder");
|
||||||
|
size_t rowid = 0;
|
||||||
|
for (int64_t i=0;i<projectdescSets.size();i++) {
|
||||||
|
QVector<QVariant> mapline(colnames.count()); // 单行数据
|
||||||
|
mapline[0]=projectdescSets[i].projectID;
|
||||||
|
mapline[1]=projectdescSets[i].projectName;
|
||||||
|
mapline[2]=projectdescSets[i].projectDesc;
|
||||||
|
mapline[3]=projectdescSets[i].projectFolder;
|
||||||
|
|
||||||
|
datamap.append(mapline);
|
||||||
|
rowIDlist.append(QString::number(rowid));
|
||||||
|
rowid = rowid + 1;
|
||||||
|
}
|
||||||
|
this->SetData(datamap, colnames, rowIDlist);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::loadRCSRecordDataSet(std::vector<RCSRecord> RCSRecordSets) {
|
||||||
|
QStringList colnames;
|
||||||
|
QVector<QVector<QVariant>> datamap(0);
|
||||||
|
QStringList rowIDlist;
|
||||||
|
bool hascolnames = true;
|
||||||
|
colnames.append(u8"ProjectID");
|
||||||
|
colnames.append(u8"freq");
|
||||||
|
colnames.append(u8"azimuthAngle");
|
||||||
|
colnames.append(u8"incidentAngle");
|
||||||
|
colnames.append(u8"TransPolarAngle");
|
||||||
|
colnames.append(u8"H_E_re");
|
||||||
|
colnames.append(u8"H_E_im");
|
||||||
|
colnames.append(u8"V_E_re");
|
||||||
|
colnames.append(u8"V_E_im");
|
||||||
|
colnames.append(u8"RCS_H");
|
||||||
|
colnames.append(u8"RCS_V");
|
||||||
|
|
||||||
|
size_t rowid = 0;
|
||||||
|
for (int64_t i=0;i<RCSRecordSets.size();i++) {
|
||||||
|
QVector<QVariant> mapline(colnames.count()); // 单行数据
|
||||||
|
mapline[0]=RCSRecordSets[i].projectID;
|
||||||
|
mapline[1]=RCSRecordSets[i].frequency;
|
||||||
|
mapline[2]=RCSRecordSets[i].phi;
|
||||||
|
mapline[3]=RCSRecordSets[i].theta;
|
||||||
|
mapline[4]=RCSRecordSets[i].TransPolar;
|
||||||
|
mapline[5]=RCSRecordSets[i].reEphi;
|
||||||
|
mapline[6]=RCSRecordSets[i].imEphi;
|
||||||
|
mapline[7]=RCSRecordSets[i].reEtheta;
|
||||||
|
mapline[8]=RCSRecordSets[i].imEtheta;
|
||||||
|
mapline[9]=RCSRecordSets[i].RCS_Phi;
|
||||||
|
mapline[10]=RCSRecordSets[i].RCS_Theta;
|
||||||
|
|
||||||
|
datamap.append(mapline);
|
||||||
|
rowIDlist.append(QString::number(rowid));
|
||||||
|
rowid = rowid + 1;
|
||||||
|
}
|
||||||
|
this->SetData(datamap, colnames, rowIDlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void QueryDataTableModel::saveFilePath()
|
||||||
|
{
|
||||||
|
|
||||||
|
QString csvpath=QFileDialog::getSaveFileName(nullptr,u8"导出为csv",
|
||||||
|
QFileInfo(Setting::BusAPI::instance()->getLastSelectPath()).absolutePath(),
|
||||||
|
u8"csv文件 (*.csv)"
|
||||||
|
);
|
||||||
|
|
||||||
|
this->csvPath=csvpath;
|
||||||
|
|
||||||
|
|
||||||
|
return this->saveCSVFilePath(this->csvPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void QueryDataTableModel::saveCSVFilePath(QString csvpath)
|
||||||
|
{
|
||||||
|
qDebug() << u8"正在保存为 csv文件中";
|
||||||
|
QFile file(csvpath);
|
||||||
|
if(file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) {
|
||||||
|
QTextStream stream(&file);
|
||||||
|
// 写入表头
|
||||||
|
for(const QString& header : this->m_hor_hedlbls) // 写入表头
|
||||||
|
{
|
||||||
|
stream << header;
|
||||||
|
if(&header != &this->m_hor_hedlbls.last()) // 如果不是最后一列,写入逗号
|
||||||
|
stream << ",";
|
||||||
|
}
|
||||||
|
stream << "\n";
|
||||||
|
// 写入数据
|
||||||
|
for(int i = 0; i < this->m_vec_hedlbls.count(); i++) {
|
||||||
|
if(this->isdeletes[i]) {
|
||||||
|
} else { // 非删除目标
|
||||||
|
for(int j = 0; j < this->m_hor_hedlbls.count() - 1; j++) {
|
||||||
|
stream << this->m_data_map[i][j].toString();
|
||||||
|
stream << ",";
|
||||||
|
}
|
||||||
|
stream << this->m_data_map[i][this->m_hor_hedlbls.count() - 1].toString();
|
||||||
|
stream << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
qDebug() << csvpath;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QueryDataTableModel::getColumnNames()
|
||||||
|
{
|
||||||
|
return this->m_hor_hedlbls;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QueryDataTableModel::getItemDataByColumn(int colidx)
|
||||||
|
{
|
||||||
|
QStringList result;
|
||||||
|
for(size_t i = 0; i < this->rowCount(); i++) {
|
||||||
|
result.append(this->m_data_map[i][colidx].toString());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QueryDataTableModel::getCSVPath()
|
||||||
|
{
|
||||||
|
return this->csvPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
int QueryDataTableModel::getColumnIdxByColumName(QString ColumnName)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < this->colCount(); i++) {
|
||||||
|
if(ColumnName == this->m_hor_hedlbls[i]) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::SetData(const QVector<QVector<QVariant>>& map, QStringList& colnames,
|
||||||
|
QStringList& rowIds)
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
m_hor_hedlbls = colnames; // 列名
|
||||||
|
m_data_map = map;
|
||||||
|
m_vec_hedlbls = rowIds; // 行名
|
||||||
|
this->colorData =
|
||||||
|
QVector<QVector<QColor>>(m_vec_hedlbls.count(), QVector<QColor>(m_hor_hedlbls.count()));
|
||||||
|
// 增加标记
|
||||||
|
this->isdeletes = QVector<bool>(m_vec_hedlbls.count(), false);
|
||||||
|
for(int j = 0; j < m_vec_hedlbls.count(); j++) {
|
||||||
|
this->isdeletes[j] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < m_hor_hedlbls.count(); i++) {
|
||||||
|
for(int j = 0; j < m_vec_hedlbls.count(); j++) {
|
||||||
|
this->colorData[j][i] = QColor(255, 255, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::setHignlightIndex(QVector<QPair<int, int>> vec_index)
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
m_highlight_indexs = vec_index;
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::ItemFlags QueryDataTableModel::flags(const QModelIndex& index) const
|
||||||
|
{
|
||||||
|
Qt::ItemFlags flags = QAbstractItemModel::flags(index);
|
||||||
|
flags |= Qt::ItemIsEditable;
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant QueryDataTableModel::data(const QModelIndex& _index, int role) const
|
||||||
|
{
|
||||||
|
if(role == Qt::DisplayRole || role == Qt::EditRole) {
|
||||||
|
return this->m_data_map[_index.row()][_index.column()];
|
||||||
|
} else if(role == Qt::TextAlignmentRole)
|
||||||
|
return Qt::AlignCenter; // 文字居中
|
||||||
|
else if(role == Qt::BackgroundColorRole) // 设置背景色
|
||||||
|
{
|
||||||
|
if(m_highlight_indexs.contains(qMakePair<int, int>(_index.row(), _index.column()))) {
|
||||||
|
return QColor(230, 247, 255);
|
||||||
|
} else {
|
||||||
|
return this->colorData[_index.row()][_index.column()];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// else if(role == Qt::DecorationRole) // 为item添加图标
|
||||||
|
// {
|
||||||
|
// return QIcon(":/images/device.svg");
|
||||||
|
// }
|
||||||
|
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant QueryDataTableModel::headerData(int section, Qt::Orientation orientation,
|
||||||
|
int role) const
|
||||||
|
{
|
||||||
|
if(orientation == Qt::Horizontal) {
|
||||||
|
if(role == Qt::DisplayRole)
|
||||||
|
return m_hor_hedlbls.at(section);
|
||||||
|
else
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QAbstractTableModel::headerData(section, orientation, role); // 垂直表头的序号
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QueryDataTableModel::setData(const QModelIndex& _index, const QVariant& value, int role)
|
||||||
|
{
|
||||||
|
if(_index.isValid() && role == Qt::EditRole) {
|
||||||
|
this->isNeedExtendTable(_index.row(), _index.column());
|
||||||
|
if(this->m_data_map[_index.row()][_index.column()] == value) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
this->m_data_map[_index.row()][_index.column()] = value;
|
||||||
|
emit dataChanged(_index, _index);
|
||||||
|
emit itemChanged(_index, value);
|
||||||
|
return true;
|
||||||
|
} else if(role == Qt::BackgroundColorRole) {
|
||||||
|
this->colorData[_index.row()][_index.column()] = value.value<QColor>();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int QueryDataTableModel::rowCount(const QModelIndex& parent) const
|
||||||
|
{
|
||||||
|
return this->m_vec_hedlbls.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
int QueryDataTableModel::columnCount(const QModelIndex& parent) const
|
||||||
|
{
|
||||||
|
return this->m_hor_hedlbls.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QueryDataTableModel::itemText(int row, int column) const
|
||||||
|
{
|
||||||
|
return this->m_data_map[row][column].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QueryDataTableModel::itemText(const QModelIndex& index) const
|
||||||
|
{
|
||||||
|
return this->m_data_map[index.row()][index.column()].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::setItemText(const QModelIndex& index, const QString& str)
|
||||||
|
{
|
||||||
|
this->isNeedExtendTable(index.row(), index.column());
|
||||||
|
this->m_data_map[index.row()][index.column()] = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::setItemText(int row, int column, const QString& str)
|
||||||
|
{
|
||||||
|
this->isNeedExtendTable(row, column);
|
||||||
|
this->m_data_map[row][column] = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant QueryDataTableModel::ItemData(const QModelIndex& index) const
|
||||||
|
{
|
||||||
|
if(index.row() >= this->m_data_map.count()
|
||||||
|
|| index.column() >= this->m_data_map[index.row()].count()) {
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
return this->m_data_map[index.row()][index.column()];
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant QueryDataTableModel::ItemData(int row, int column) const
|
||||||
|
{
|
||||||
|
if(row >= this->m_data_map.count() || column >= this->m_data_map[row].count()) {
|
||||||
|
return this->m_data_map[row][column];
|
||||||
|
} else {
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::SetItemData(const QModelIndex& index, const QVariant& data)
|
||||||
|
{
|
||||||
|
this->isNeedExtendTable(index.row(), index.column());
|
||||||
|
this->m_data_map[index.row()][index.column()] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::SetItemData(int row, int column, const QVariant& data)
|
||||||
|
{
|
||||||
|
this->isNeedExtendTable(row, column);
|
||||||
|
this->m_data_map[row][column] = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t QueryDataTableModel::rowCount()
|
||||||
|
{
|
||||||
|
return this->m_data_map.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t QueryDataTableModel::colCount()
|
||||||
|
{
|
||||||
|
return this->m_vec_hedlbls.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::isNeedExtendTable(size_t row, size_t column)
|
||||||
|
{
|
||||||
|
size_t max_colnum = this->m_hor_hedlbls.count() - 1 < column
|
||||||
|
? column + 1
|
||||||
|
: this->m_hor_hedlbls.count(); // 判断是否扩展列名
|
||||||
|
if(this->m_hor_hedlbls.count() <= column) {
|
||||||
|
for(int i = this->m_hor_hedlbls.count(); i <= column; i++) {
|
||||||
|
this->m_hor_hedlbls.append(QString::number(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(0 > row || column < 0) {
|
||||||
|
return;
|
||||||
|
} else if(row > this->m_vec_hedlbls.count() - 1 || column > this->m_hor_hedlbls.count() - 1) {
|
||||||
|
for(int i = 0; i <= row; i++) {
|
||||||
|
if(i >= this->m_data_map.count()) {
|
||||||
|
this->m_data_map.append(QVector<QVariant>(max_colnum));
|
||||||
|
this->colorData.append(QVector<QColor>(max_colnum));
|
||||||
|
this->m_vec_hedlbls.append(QString::number(i));
|
||||||
|
} else {
|
||||||
|
if(this->m_data_map[i].count() < column + 1) { // 扩充
|
||||||
|
this->m_data_map[i].reserve(max_colnum);
|
||||||
|
// this->colorData[i].reserve(max_colnum);
|
||||||
|
for(size_t ci = this->colorData[i].count(); ci < max_colnum; ci++) {
|
||||||
|
this->colorData[i].append(QColor(255, 255, 255));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QueryDataTableModel::clear()
|
||||||
|
{
|
||||||
|
beginResetModel();
|
||||||
|
// m_table_map.clear();
|
||||||
|
m_data_map.clear();
|
||||||
|
m_hor_hedlbls.clear();
|
||||||
|
m_vec_hedlbls.clear();
|
||||||
|
m_highlight_indexs.clear();
|
||||||
|
endResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant* QueryDataTableModel::getVariantPtr(size_t row, size_t col)
|
||||||
|
{
|
||||||
|
return &(this->m_data_map[row][col]);
|
||||||
|
// return nullptr;
|
||||||
|
}
|
||||||
|
void QueryDataTableModel::setDeleteFlag(int row, bool flag)
|
||||||
|
{
|
||||||
|
this->isdeletes[row] = flag;
|
||||||
|
if(flag) {
|
||||||
|
for(int i = 0; i < this->m_hor_hedlbls.size(); i++) {
|
||||||
|
this->colorData[row][i] = QColor(255, 0, 0); // 删除标记
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(int i = 0; i < this->m_hor_hedlbls.size(); i++) {
|
||||||
|
this->colorData[row][i] = QColor(255, 255, 255); // 非删除标记
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool QueryDataTableModel::getDeleteFlag(int row)
|
||||||
|
{
|
||||||
|
return this->isdeletes[row];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // RCSDBManagerTool
|
||||||
|
|
@ -0,0 +1,100 @@
|
||||||
|
//
|
||||||
|
// Created by 30453 on 25-6-26.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef QUERYDATATABLEMODEL_H
|
||||||
|
#define QUERYDATATABLEMODEL_H
|
||||||
|
#include "PluginRCSDBManagerAPI.h"
|
||||||
|
|
||||||
|
#include <QAbstractTableModel>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QVector>
|
||||||
|
#include <QVariant>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <RCSDBManagerClass.h>
|
||||||
|
|
||||||
|
|
||||||
|
namespace RCSDBManagerTool {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QString getSaveFilePath(QWidget* parent, const QString& caption, const QString& filter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class PLUGINRCSDBMANAGERAPI QueryDataTableModel : public QAbstractTableModel {
|
||||||
|
Q_OBJECT;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QStringList m_hor_hedlbls; // headerlabels
|
||||||
|
QStringList m_vec_hedlbls; // oids - map.keys()
|
||||||
|
QVector<QVector<QVariant>> m_data_map;
|
||||||
|
QVector<QPair<int, int>> m_highlight_indexs; // 背景高亮的indexs
|
||||||
|
QVector<QVector<QColor>> colorData;
|
||||||
|
QString csvPath;
|
||||||
|
QVector<bool> isdeletes;// 用于标记是否删除
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit QueryDataTableModel(QObject* parent = nullptr);
|
||||||
|
~QueryDataTableModel();
|
||||||
|
public:
|
||||||
|
void loadProjectDescDataSet(std::vector<ProjectDesc> projectdescSets);
|
||||||
|
|
||||||
|
void loadRCSRecordDataSet(std::vector<RCSRecord> RCSRecordSets);
|
||||||
|
|
||||||
|
void saveCSVFilePath(QString csvpath);
|
||||||
|
|
||||||
|
void saveFilePath();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
QStringList getColumnNames();
|
||||||
|
QStringList getItemDataByColumn(int colidx);
|
||||||
|
int getColumnIdxByColumName(QString ColumnName);
|
||||||
|
virtual QString getCSVPath();
|
||||||
|
|
||||||
|
// tableview 表格模型操作
|
||||||
|
void SetData(const QVector<QVector<QVariant>>& map, QStringList& colnames, QStringList& rowIds);
|
||||||
|
|
||||||
|
void setHignlightIndex(QVector<QPair<int, int>> vec_index);
|
||||||
|
|
||||||
|
virtual Qt::ItemFlags flags(const QModelIndex& index) const;
|
||||||
|
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||||
|
|
||||||
|
virtual int rowCount(const QModelIndex& parent) const;
|
||||||
|
virtual int columnCount(const QModelIndex& parent) const;
|
||||||
|
|
||||||
|
virtual QVariant data(const QModelIndex& index, int role) const;
|
||||||
|
virtual bool setData(const QModelIndex& index, const QVariant& value, int role = 2);
|
||||||
|
|
||||||
|
QString itemText(int row, int column) const;
|
||||||
|
QString itemText(const QModelIndex& index) const;
|
||||||
|
void setItemText(const QModelIndex& index, const QString& str);
|
||||||
|
void setItemText(int row, int column, const QString& str);
|
||||||
|
|
||||||
|
QVariant ItemData(const QModelIndex& index) const;
|
||||||
|
QVariant ItemData(int row, int column) const;
|
||||||
|
void SetItemData(const QModelIndex& index, const QVariant& data);
|
||||||
|
void SetItemData(int row, int column, const QVariant& data);
|
||||||
|
|
||||||
|
size_t rowCount();
|
||||||
|
size_t colCount();
|
||||||
|
|
||||||
|
void isNeedExtendTable(size_t row, size_t col);
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
QVariant* getVariantPtr(size_t row, size_t col);
|
||||||
|
|
||||||
|
virtual void setDeleteFlag(int row, bool flag);
|
||||||
|
virtual bool getDeleteFlag(int row);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void itemChanged(const QModelIndex& index, const QVariant& value);
|
||||||
|
}; // RCSDBManagerTool
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //QUERYDATATABLEMODEL_H
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
#include "PluginWBFZExchangePlugin/FEKOBaseToolClass.h"
|
#include "PluginWBFZExchangePlugin/FEKOBaseToolClass.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace RCSDBManagerTool {
|
namespace RCSDBManagerTool {
|
||||||
RCSDBManagerClass *RCSDBManagerClass::_ins = nullptr;
|
RCSDBManagerClass *RCSDBManagerClass::_ins = nullptr;
|
||||||
|
|
||||||
|
|
@ -108,7 +107,8 @@ namespace RCSDBManagerTool {
|
||||||
|
|
||||||
bool RCSDBManagerClass::deleteRCSDataRecord(int projectId, double freq, double az,
|
bool RCSDBManagerClass::deleteRCSDataRecord(int projectId, double freq, double az,
|
||||||
double inc, double transpolar) {
|
double inc, double transpolar) {
|
||||||
const char* sql = "DELETE FROM RCSDataTable WHERE ProjectID = ? AND freq = ? AND az = ? AND inc = ? AND Transpolar = ?";
|
const char *sql =
|
||||||
|
"DELETE FROM RCSDataTable WHERE ProjectID = ? AND freq = ? AND az = ? AND inc = ? AND Transpolar = ?";
|
||||||
|
|
||||||
sqlite3_stmt *stmt;
|
sqlite3_stmt *stmt;
|
||||||
if (sqlite3_prepare_v2(_db, sql, -1, &stmt, nullptr) != SQLITE_OK) {
|
if (sqlite3_prepare_v2(_db, sql, -1, &stmt, nullptr) != SQLITE_OK) {
|
||||||
|
|
@ -241,6 +241,124 @@ namespace RCSDBManagerTool {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<ProjectDesc> RCSDBManagerClass::queryPRrojectDescByProjectName(std::string pronamestr) {
|
||||||
|
std::vector<ProjectDesc> result;
|
||||||
|
|
||||||
|
// SQL 查询语句,基于项目ID查询 ProjectDesc 数据
|
||||||
|
const std::string sql = "SELECT projectID, projectName, projectDesc, projectFolder "
|
||||||
|
"FROM Projects WHERE projectname = ?";
|
||||||
|
|
||||||
|
sqlite3_stmt *stmt;
|
||||||
|
if (sqlite3_prepare_v2(_db, sql.c_str(), -1, &stmt, nullptr) != SQLITE_OK) {
|
||||||
|
qDebug() << u8"准备SQL语句失败: " << sqlite3_errmsg(_db);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlite3_bind_text(stmt, 1, pronamestr.c_str(),-1, SQLITE_TRANSIENT);
|
||||||
|
|
||||||
|
while (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||||
|
ProjectDesc record;
|
||||||
|
int colCount = sqlite3_column_count(stmt);
|
||||||
|
|
||||||
|
for (int i = 0; i < colCount; i++) {
|
||||||
|
const char *colName = sqlite3_column_name(stmt, i);
|
||||||
|
const char *colValue = reinterpret_cast<const char *>(sqlite3_column_text(stmt, i));
|
||||||
|
|
||||||
|
if (colName && colValue) {
|
||||||
|
if (strcmp(colName, "projectID") == 0) record.projectID = atoi(colValue);
|
||||||
|
else if (strcmp(colName, "projectName") == 0) record.projectName = colValue;
|
||||||
|
else if (strcmp(colName, "projectFolder") == 0) record.projectFolder = colValue;
|
||||||
|
else if (strcmp(colName, "projectDesc") == 0) record.projectDesc = colValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.push_back(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlite3_finalize(stmt);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<ProjectDesc> RCSDBManagerClass::queryPRrojectDescByProjectID(int projectID) {
|
||||||
|
std::vector<ProjectDesc> result;
|
||||||
|
|
||||||
|
// SQL 查询语句,基于项目ID查询 ProjectDesc 数据
|
||||||
|
const std::string sql = "SELECT projectID, projectName, projectDesc, projectFolder "
|
||||||
|
"FROM Projects WHERE projectID = ?";
|
||||||
|
|
||||||
|
sqlite3_stmt *stmt;
|
||||||
|
if (sqlite3_prepare_v2(_db, sql.c_str(), -1, &stmt, nullptr) != SQLITE_OK) {
|
||||||
|
qDebug() << u8"准备SQL语句失败: " << sqlite3_errmsg(_db);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlite3_bind_int(stmt, 1, projectID);
|
||||||
|
|
||||||
|
while (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||||
|
ProjectDesc record;
|
||||||
|
int colCount = sqlite3_column_count(stmt);
|
||||||
|
|
||||||
|
for (int i = 0; i < colCount; i++) {
|
||||||
|
const char *colName = sqlite3_column_name(stmt, i);
|
||||||
|
const char *colValue = reinterpret_cast<const char *>(sqlite3_column_text(stmt, i));
|
||||||
|
|
||||||
|
if (colName && colValue) {
|
||||||
|
if (strcmp(colName, "projectID") == 0) record.projectID = atoi(colValue);
|
||||||
|
else if (strcmp(colName, "projectName") == 0) record.projectName = colValue;
|
||||||
|
else if (strcmp(colName, "projectFolder") == 0) record.projectFolder = colValue;
|
||||||
|
else if (strcmp(colName, "projectDesc") == 0) record.projectDesc = colValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.push_back(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlite3_finalize(stmt);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<ProjectDesc> RCSDBManagerClass::getAllProjectRecords() {
|
||||||
|
std::vector<ProjectDesc> result;
|
||||||
|
|
||||||
|
const std::string sql = "SELECT projectID, projectName, projectDesc, projectFolder FROM Projects";
|
||||||
|
|
||||||
|
sqlite3_stmt *stmt;
|
||||||
|
if (sqlite3_prepare_v2(_db, sql.c_str(), -1, &stmt, nullptr) != SQLITE_OK) {
|
||||||
|
qDebug() << u8"准备SQL语句失败: " << sqlite3_errmsg(_db);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||||
|
ProjectDesc record;
|
||||||
|
int colCount = sqlite3_column_count(stmt);
|
||||||
|
|
||||||
|
for (int i = 0; i < colCount; i++) {
|
||||||
|
const char *colName = sqlite3_column_name(stmt, i);
|
||||||
|
const char *colValue = reinterpret_cast<const char *>(sqlite3_column_text(stmt, i));
|
||||||
|
|
||||||
|
if (colName && colValue) {
|
||||||
|
if (strcmp(colName, "projectID") == 0) record.projectID = atoi(colValue);
|
||||||
|
else if (strcmp(colName, "projectName") == 0) record.projectName = colValue;
|
||||||
|
else if (strcmp(colName, "projectFolder") == 0) record.projectFolder = colValue;
|
||||||
|
else if (strcmp(colName, "projectDesc") == 0) record.projectDesc = colValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.push_back(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
sqlite3_finalize(stmt);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RCSDBManagerClass::executeSQL(const std::string &sql) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RCSDBManagerClass::executeSQLWithParams(const std::string &sql,
|
||||||
|
const std::vector<std::pair<int, std::string> > ¶ms) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void RCSDBManagerClass::closeDatabase() {
|
void RCSDBManagerClass::closeDatabase() {
|
||||||
if (_db) {
|
if (_db) {
|
||||||
sqlite3_close(_db);
|
sqlite3_close(_db);
|
||||||
|
|
@ -361,8 +479,7 @@ namespace RCSDBManagerTool {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<RCSRecord> RCSDBManagerClass::queryProjects(int projectId,
|
std::vector<RCSRecord> RCSDBManagerClass::queryProjects(int projectId, const std::string &projectName) {
|
||||||
const std::string& projectName) {
|
|
||||||
std::vector<RCSRecord> results;
|
std::vector<RCSRecord> results;
|
||||||
if (!_db) return results;
|
if (!_db) return results;
|
||||||
|
|
||||||
|
|
@ -523,8 +640,44 @@ namespace RCSDBManagerTool {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool copyDirectory(const QString &sourcePath, const QString &targetPath, bool coverFileIfExist )
|
std::vector<std::string> RCSDBManagerClass::getAllProjectNames() {
|
||||||
{
|
// 获取RCSDBManagerClass的实例
|
||||||
|
const char *sql = "SELECT * FROM RCSProjectFolderTable WHERE 1=1";
|
||||||
|
|
||||||
|
// 调用queryProjects方法,传入默认值
|
||||||
|
sqlite3_stmt *stmt;
|
||||||
|
if (sqlite3_prepare_v2(_db, sql, -1, &stmt, nullptr) != SQLITE_OK) {
|
||||||
|
qDebug() << u8"准备SQL语句失败: " << sqlite3_errmsg(_db);
|
||||||
|
QMessageBox::warning(0, u8"警告", u8"工程表查询失败");
|
||||||
|
return std::vector<std::string>();
|
||||||
|
}
|
||||||
|
std::vector<std::string> projectNames;
|
||||||
|
while (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||||
|
ProjectDesc record;
|
||||||
|
int colCount = sqlite3_column_count(stmt);
|
||||||
|
|
||||||
|
for (int i = 0; i < colCount; i++) {
|
||||||
|
const char *colName = sqlite3_column_name(stmt, i);
|
||||||
|
const char *colValue = reinterpret_cast<const char *>(sqlite3_column_text(stmt, i));
|
||||||
|
|
||||||
|
if (colName && colValue) {
|
||||||
|
if (strcmp(colName, "projectname") == 0) {
|
||||||
|
projectNames.push_back(colValue);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return projectNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
bool copyDirectory(const QString &sourcePath, const QString &targetPath, bool coverFileIfExist) {
|
||||||
QDir sourceDir(sourcePath);
|
QDir sourceDir(sourcePath);
|
||||||
if (!sourceDir.exists()) {
|
if (!sourceDir.exists()) {
|
||||||
qDebug() << u8"Source directory not exists:" << sourcePath;
|
qDebug() << u8"Source directory not exists:" << sourcePath;
|
||||||
|
|
@ -566,8 +719,7 @@ namespace RCSDBManagerTool {
|
||||||
|
|
||||||
QString writeUTF8StringFile(QString path, QString unicodeString) {
|
QString writeUTF8StringFile(QString path, QString unicodeString) {
|
||||||
QFile fileOut(path);
|
QFile fileOut(path);
|
||||||
if (!fileOut.open(QIODevice::WriteOnly | QIODevice::Text))
|
if (!fileOut.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
{
|
|
||||||
return u8"";
|
return u8"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -578,10 +730,11 @@ namespace RCSDBManagerTool {
|
||||||
fileOut.close();
|
fileOut.close();
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
QFileInfoList findFilePath(const QString& strFilePath, const QString& strNameFilters, QDirIterator::IteratorFlag flag){
|
|
||||||
|
QFileInfoList findFilePath(const QString &strFilePath, const QString &strNameFilters,
|
||||||
|
QDirIterator::IteratorFlag flag) {
|
||||||
QFileInfoList fileList;
|
QFileInfoList fileList;
|
||||||
if (strFilePath.isEmpty() || strNameFilters.isEmpty())
|
if (strFilePath.isEmpty() || strNameFilters.isEmpty()) {
|
||||||
{
|
|
||||||
return fileList;
|
return fileList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -591,12 +744,10 @@ namespace RCSDBManagerTool {
|
||||||
dir.setPath(strFilePath);
|
dir.setPath(strFilePath);
|
||||||
dir.setNameFilters(filters);
|
dir.setNameFilters(filters);
|
||||||
QDirIterator iter(dir, flag);
|
QDirIterator iter(dir, flag);
|
||||||
while (iter.hasNext())
|
while (iter.hasNext()) {
|
||||||
{
|
|
||||||
iter.next();
|
iter.next();
|
||||||
QFileInfo info = iter.fileInfo();
|
QFileInfo info = iter.fileInfo();
|
||||||
if (info.isFile())
|
if (info.isFile()) {
|
||||||
{
|
|
||||||
fileList.append(info);
|
fileList.append(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,16 @@ namespace RCSDBManagerTool {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct ProjectDesc {
|
||||||
|
int32_t projectID;
|
||||||
|
QString projectName;
|
||||||
|
QString projectDesc;
|
||||||
|
QString projectFolder;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PLUGINRCSDBMANAGERAPI RCSDBManagerClass {
|
class PLUGINRCSDBMANAGERAPI RCSDBManagerClass {
|
||||||
public:
|
public:
|
||||||
static RCSDBManagerClass* instance();
|
static RCSDBManagerClass* instance();
|
||||||
|
|
@ -80,20 +90,23 @@ namespace RCSDBManagerTool {
|
||||||
double transpolar, double newEHReal, double newEHImag,
|
double transpolar, double newEHReal, double newEHImag,
|
||||||
double newEVReal, double newEVImag, double newRCSH, double newRCSV);
|
double newEVReal, double newEVImag, double newRCSH, double newRCSV);
|
||||||
|
|
||||||
std::vector<RCSRecord> queryRCSDataRecords(int projectId, double freq,
|
std::vector<RCSRecord> queryRCSDataRecords(int projectId, double freq,double az, double inc, double transpolar);
|
||||||
double az, double inc, double transpolar);
|
|
||||||
|
std::vector<ProjectDesc> queryPRrojectDescByProjectName(std::string pronamestr);
|
||||||
|
|
||||||
|
std::vector<ProjectDesc> queryPRrojectDescByProjectID(int projectID);
|
||||||
|
std::vector<ProjectDesc> getAllProjectRecords();
|
||||||
|
|
||||||
void closeDatabase();
|
void closeDatabase();
|
||||||
|
|
||||||
int insertProject(const std::string& projectName, const std::string& projectFolder,
|
int insertProject(const std::string& projectName, const std::string& projectFolder,
|
||||||
const std::string& desc);
|
const std::string& desc);
|
||||||
std::vector<RCSRecord> queryProjects(int projectId,
|
std::vector<RCSRecord> queryProjects(int projectId,const std::string& projectName);
|
||||||
const std::string& projectName);
|
|
||||||
bool deleteProject(int projectId);
|
bool deleteProject(int projectId);
|
||||||
|
|
||||||
bool insertRCSDataRecords(std::vector<RCSRecord>& records,
|
bool insertRCSDataRecords(std::vector<RCSRecord>& records,
|
||||||
int32_t projectID, double transpolarAngle);
|
int32_t projectID, double transpolarAngle);
|
||||||
|
std::vector<std::string> getAllProjectNames();
|
||||||
private:
|
private:
|
||||||
RCSDBManagerClass(const std::string& dbPath);
|
RCSDBManagerClass(const std::string& dbPath);
|
||||||
bool initializeDatabase(const std::string& dbFilePath);
|
bool initializeDatabase(const std::string& dbFilePath);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
//
|
||||||
|
// Created by 30453 on 25-6-26.
|
||||||
|
//
|
||||||
|
|
||||||
|
// You may need to build the project (run Qt uic code generator) to get "ui_RCSDBQueryDialog.h" resolved
|
||||||
|
|
||||||
|
#include "RCSDBQueryDialog.h"
|
||||||
|
#include "RCSDBManagerClass.h"
|
||||||
|
#include "ui_RCSDBQueryDialog.h"
|
||||||
|
#include <QStandardItemModel>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
|
namespace RCSDBManagerTool {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RCSDBQueryDialog::RCSDBQueryDialog(QWidget *parent) : QDialog(parent), ui(new Ui::RCSDBQueryDialog),
|
||||||
|
tableModel(new QStandardItemModel(this)) {
|
||||||
|
ui->setupUi(this);
|
||||||
|
this->init();
|
||||||
|
}
|
||||||
|
|
||||||
|
RCSDBQueryDialog::~RCSDBQueryDialog() {
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RCSDBQueryDialog::init() {
|
||||||
|
|
||||||
|
QObject::connect(ui->pushButtonQuery, SIGNAL(clicked()), this, SLOT(OnQueryData()));
|
||||||
|
QObject::connect(ui->pushButtonExportCSV, SIGNAL(clicked()), this, SLOT(OnExportCSV()));
|
||||||
|
|
||||||
|
RCSDBManagerClass *db = RCSDBManagerClass::instance();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void RCSDBQueryDialog::OnExportCSV() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void RCSDBQueryDialog::OnQueryData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
} // RCSDBManagerTool
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
//
|
||||||
|
// Created by 30453 on 25-6-26.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef RCSDBQUERYDIALOG_H
|
||||||
|
#define RCSDBQUERYDIALOG_H
|
||||||
|
#include "PluginRCSDBManagerAPI.h"
|
||||||
|
#include "MultiSelectComboBox.h" // 多选框
|
||||||
|
#include <QtSql/QSqlQueryModel>
|
||||||
|
#include <QStandardItemModel>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QAbstractTableModel>
|
||||||
|
#include <QtSql/QSqlTableModel>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QVector>
|
||||||
|
#include "RCSDBManagerClass.h"
|
||||||
|
|
||||||
|
namespace RCSDBManagerTool {
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class RCSDBQueryDialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class PLUGINRCSDBMANAGERAPI RCSDBQueryDialog : public QDialog {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit RCSDBQueryDialog(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
~RCSDBQueryDialog() override;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void init();
|
||||||
|
void OnExportCSV();
|
||||||
|
void OnQueryData();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::RCSDBQueryDialog *ui;
|
||||||
|
QStandardItemModel* tableModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
} // RCSDBManagerTool
|
||||||
|
|
||||||
|
#endif //RCSDBQUERYDIALOG_H
|
||||||
|
|
@ -0,0 +1,182 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>RCSDBManagerTool::RCSDBQueryDialog</class>
|
||||||
|
<widget class="QDialog" name="RCSDBManagerTool::RCSDBQueryDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>728</width>
|
||||||
|
<height>559</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>RCSDBQueryDialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>查询条件</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>80</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>查询字段:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxQueryField">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ProjectID</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>projectname</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>80</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>条件值:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxQueryValue">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonQuery">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>查询</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>工程查询结果</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="title">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QTableWidget" name="tableWidgetProjectRecord"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab_2">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>RCS查询结果</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>RCS查询结果</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableWidget" name="SqltableWidget"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButtonExportCSV">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>导出</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef TABLEVIEWMODEL_H
|
#ifndef TABLEVIEWMODEL_H
|
||||||
#define TABLEVIEWMODEL_H
|
#define TABLEVIEWMODEL_H
|
||||||
#include "WBFZExchangePluginAPI.h"
|
|
||||||
#include "AllHead.h"
|
#include "AllHead.h"
|
||||||
|
#include "WBFZExchangePluginAPI.h"
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
class AbstractTableModel : public QAbstractTableModel {
|
class WBFZAPI AbstractTableModel : public QAbstractTableModel {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -25,7 +26,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// FKEOResult.csv 表格对应类 2023.07.25 重写类
|
// FKEOResult.csv 表格对应类 2023.07.25 重写类
|
||||||
class FEKOResultCsvTableModel : public AbstractTableModel {
|
class WBFZAPI FEKOResultCsvTableModel : public AbstractTableModel {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue