add diagram editor bay setting ui
This commit is contained in:
parent
834759aad5
commit
93282923d4
|
|
@ -422,11 +422,17 @@ enum class EditorItemType //组态编辑中的图形项类型
|
||||||
none //空白占位图
|
none //空白占位图
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct EditorTransConnection //组态变压器连接信息
|
||||||
|
{
|
||||||
|
QString sName;
|
||||||
|
int nPara = 0; //012,高中低侧
|
||||||
|
};
|
||||||
|
|
||||||
struct DiagramEditorWizardTransformerInfo //组态变压器信息
|
struct DiagramEditorWizardTransformerInfo //组态变压器信息
|
||||||
{
|
{
|
||||||
QString sName;
|
QString sName;
|
||||||
TransformerType nType;
|
TransformerType nType;
|
||||||
QList<QString> lstBindObj; //连接的对象
|
QList<EditorTransConnection> lstBindObj; //连接的对象
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DiagramEditorWizardBayInfo //组态间隔信息
|
struct DiagramEditorWizardBayInfo //组态间隔信息
|
||||||
|
|
@ -436,6 +442,21 @@ struct DiagramEditorWizardBayInfo //组态间隔信息
|
||||||
QList<QString> lstBindObj; //连接的对象
|
QList<QString> lstBindObj; //连接的对象
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct DiagramEditorComponentInfo //组态设备信息
|
||||||
|
{
|
||||||
|
int nCategory = 0; //分类 0电气设备1连接关系
|
||||||
|
QString sName;
|
||||||
|
int nType = 0; //类型 1母线2异步电动机3断路器4电缆5电流互感器6电压互感器7隔离开关8接地开关9快速接地开关10双掷接地隔离开关11带电指示器12避雷器13电缆出线套筒14电缆端
|
||||||
|
QString sBindObj; //所关联的实体名 (母线block,间隔block)
|
||||||
|
QStringList sUsedRoute; //使用设备的线路名
|
||||||
|
};
|
||||||
|
|
||||||
|
struct DiagramEditorBayRouteInfo //间隔中单条线路信息
|
||||||
|
{
|
||||||
|
QString sRouteName;
|
||||||
|
QMap<QString,DiagramEditorComponentInfo> mapCompo;
|
||||||
|
};
|
||||||
|
|
||||||
enum class DiagramEditorStructType
|
enum class DiagramEditorStructType
|
||||||
{
|
{
|
||||||
block = 0, //模块(母线段、间隔、变压器)
|
block = 0, //模块(母线段、间隔、变压器)
|
||||||
|
|
@ -454,6 +475,7 @@ struct DiagramEditorBriefConnect //组态编辑时连接信息
|
||||||
QUuid uid;
|
QUuid uid;
|
||||||
DiagramEditorConnectType con1;
|
DiagramEditorConnectType con1;
|
||||||
DiagramEditorConnectType con2;
|
DiagramEditorConnectType con2;
|
||||||
|
int nPara = 0; //万用参数(变压器中表示连接位置,0高压侧,1中压侧,2低压侧)
|
||||||
|
|
||||||
bool operator==(const DiagramEditorBriefConnect& obj)
|
bool operator==(const DiagramEditorBriefConnect& obj)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ set(DIAGRAMCAVAS_HEADER_FILES
|
||||||
include/diagramEditor/diagramEditorBaseBlock.h
|
include/diagramEditor/diagramEditorBaseBlock.h
|
||||||
include/diagramEditor/diagramEditorStructContainer.h
|
include/diagramEditor/diagramEditorStructContainer.h
|
||||||
include/diagramEditor/diagramEditorBaySettingDlg.h
|
include/diagramEditor/diagramEditorBaySettingDlg.h
|
||||||
|
include/diagramEditor/diagramEditorBayDetailSettingDlg.h
|
||||||
|
include/diagramEditor/diagramEditorBayDetailAddDlg.h
|
||||||
include/diagramEditor/diagramEditorTransSettingDlg.h
|
include/diagramEditor/diagramEditorTransSettingDlg.h
|
||||||
include/graphicsDataModel/baseModel.h
|
include/graphicsDataModel/baseModel.h
|
||||||
include/graphicsDataModel/fixedPortsModel.h
|
include/graphicsDataModel/fixedPortsModel.h
|
||||||
|
|
@ -118,6 +120,8 @@ set(DIAGRAMCAVAS_SOURCE_FILES
|
||||||
source/diagramEditor/diagramEditorBaseBlock.cpp
|
source/diagramEditor/diagramEditorBaseBlock.cpp
|
||||||
source/diagramEditor/diagramEditorStructContainer.cpp
|
source/diagramEditor/diagramEditorStructContainer.cpp
|
||||||
source/diagramEditor/diagramEditorBaySettingDlg.cpp
|
source/diagramEditor/diagramEditorBaySettingDlg.cpp
|
||||||
|
source/diagramEditor/diagramEditorBayDetailSettingDlg.cpp
|
||||||
|
source/diagramEditor/diagramEditorBayDetailAddDlg.cpp
|
||||||
source/diagramEditor/diagramEditorTransSettingDlg.cpp
|
source/diagramEditor/diagramEditorTransSettingDlg.cpp
|
||||||
source/graphicsDataModel/baseModel.cpp
|
source/graphicsDataModel/baseModel.cpp
|
||||||
source/graphicsDataModel/fixedPortsModel.cpp
|
source/graphicsDataModel/fixedPortsModel.cpp
|
||||||
|
|
@ -170,6 +174,8 @@ set(UI_FILES
|
||||||
ui/bayManagerContentDlg.ui
|
ui/bayManagerContentDlg.ui
|
||||||
ui/diagramEditorBaySettingDlg.ui
|
ui/diagramEditorBaySettingDlg.ui
|
||||||
ui/diagramEditorTransSettingDlg.ui
|
ui/diagramEditorTransSettingDlg.ui
|
||||||
|
ui/diagramEditorBayDetailSettingDlg.ui
|
||||||
|
ui/diagramEditorBayDetailAddDlg.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,14 @@ public:
|
||||||
virtual ~DiagramEditorBayBlock();
|
virtual ~DiagramEditorBayBlock();
|
||||||
virtual void setBayType(BayType typ) {nBayType = typ;}
|
virtual void setBayType(BayType typ) {nBayType = typ;}
|
||||||
virtual BayType getBayType() {return nBayType;}
|
virtual BayType getBayType() {return nBayType;}
|
||||||
|
virtual void setRouteInfoMap(QMap<QString,DiagramEditorBayRouteInfo> info) {mapRouteInfo = info;}
|
||||||
|
virtual QMap<QString,DiagramEditorBayRouteInfo>& getRouteInfoMap() {return mapRouteInfo;}
|
||||||
|
virtual void setComponentMap(QMap<QString,DiagramEditorComponentInfo> info) {mapComponents = info;}
|
||||||
|
virtual QMap<QString,DiagramEditorComponentInfo>& getComponentMap() {return mapComponents;}
|
||||||
protected:
|
protected:
|
||||||
BayType nBayType;
|
BayType nBayType;
|
||||||
|
QMap<QString,DiagramEditorBayRouteInfo> mapRouteInfo; //间隔中的线路信息
|
||||||
|
QMap<QString,DiagramEditorComponentInfo> mapComponents; //间隔中的所有设备信息
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************transformer单元****************************/
|
/***************************transformer单元****************************/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
#ifndef DIAGRAMEDITORBAYDETAILADDDLG_H
|
||||||
|
#define DIAGRAMEDITORBAYDETAILADDDLG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
namespace Ui { class diagramEditorBayDetailAddDlg; }
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
class DiagramEditorBayDetailSettingDlg;
|
||||||
|
|
||||||
|
class DiagramEditorBayDetailAddDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
DiagramEditorBayDetailAddDlg(QWidget *parent = nullptr);
|
||||||
|
~DiagramEditorBayDetailAddDlg();
|
||||||
|
|
||||||
|
void initial();
|
||||||
|
void showDlg();
|
||||||
|
void showDlg(DiagramEditorBayRouteInfo info); //编辑
|
||||||
|
void setParent(DiagramEditorBayDetailSettingDlg* p) {_pParent = p;}
|
||||||
|
public slots:
|
||||||
|
void onAddClicked();
|
||||||
|
void onDeleteClicked();
|
||||||
|
void onSaveClicked();
|
||||||
|
void onOkClicked();
|
||||||
|
void onCancelClicked();
|
||||||
|
void onCategoryChanged(const QString&);
|
||||||
|
|
||||||
|
void onComponentDeleteClicked();
|
||||||
|
void onComponentRbtnClicked(const QPoint &pos);
|
||||||
|
void onRouteDeleteClicked();
|
||||||
|
void onRouteRbtnClicked(const QPoint &pos); //线路右键菜单
|
||||||
|
private:
|
||||||
|
Ui::diagramEditorBayDetailAddDlg *ui;
|
||||||
|
QStandardItemModel* _selectedModel;
|
||||||
|
DiagramEditorBayDetailSettingDlg* _pParent;
|
||||||
|
int _curMode; //0新建1修改
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
#ifndef DIAGRAMEDITORBAYDETAILSETTINGDLG_H
|
||||||
|
#define DIAGRAMEDITORBAYDETAILSETTINGDLG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
namespace Ui { class diagramEditorBayDetailSettingDlg; }
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
class DiagramEditorWizard;
|
||||||
|
class DiagramEditorBayDetailAddDlg;
|
||||||
|
class DiagramEditorBayBlock;
|
||||||
|
|
||||||
|
class DiagramEditorBayDetailSettingDlg : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
DiagramEditorBayDetailSettingDlg(QWidget *parent = nullptr);
|
||||||
|
~DiagramEditorBayDetailSettingDlg();
|
||||||
|
|
||||||
|
void initial();
|
||||||
|
void refreshModel(); //刷新view显示的model
|
||||||
|
void showDlg(DiagramEditorBayBlock*);
|
||||||
|
void setParent(DiagramEditorWizard* p) {_pWizard = p;}
|
||||||
|
QStandardItemModel* getComponentModel() {return _compoModel;}
|
||||||
|
QStandardItemModel* getRouteModel() {return _routeModel;}
|
||||||
|
void setRouteMap(QMap<QString,DiagramEditorBayRouteInfo> map) {_mapRouteInfo = map;}
|
||||||
|
QMap<QString,DiagramEditorBayRouteInfo>& getRouteMap(){return _mapRouteInfo;}
|
||||||
|
public slots:
|
||||||
|
void onAddClicked();
|
||||||
|
void onOkClicked();
|
||||||
|
void onCancelClicked();
|
||||||
|
|
||||||
|
void onRouteDeleteClicked();
|
||||||
|
void onRouteRbtnClicked(const QPoint &pos); //线路右键菜单
|
||||||
|
void onRouteEditClicked();
|
||||||
|
private:
|
||||||
|
Ui::diagramEditorBayDetailSettingDlg *ui;
|
||||||
|
DiagramEditorBayDetailAddDlg* _pAddDlg;
|
||||||
|
DiagramEditorWizard* _pWizard;
|
||||||
|
DiagramEditorBayBlock* _curOperateObj; //当前加载的block对象
|
||||||
|
QStandardItemModel* _compoModel; //设备库model
|
||||||
|
QStandardItemModel* _routeModel; //所有线路model
|
||||||
|
QMap<QString,DiagramEditorBayRouteInfo> _mapRouteInfo; //所有线路信息
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -58,7 +58,7 @@ public:
|
||||||
DiagramEditorBaySettingDlg* getBaySettingDlg() {return _baySettingDlg;}
|
DiagramEditorBaySettingDlg* getBaySettingDlg() {return _baySettingDlg;}
|
||||||
void flushTransPage(); //刷新变压器界面
|
void flushTransPage(); //刷新变压器界面
|
||||||
int getContainerIndex(int nLevel,DiagramEditorStructContainer*); //返回目标层级container的序号
|
int getContainerIndex(int nLevel,DiagramEditorStructContainer*); //返回目标层级container的序号
|
||||||
QUuid addConnection(const QString& str1,const QString& str2,int nType1,int nType2,bool bCover = false); //插入连接
|
QUuid addConnection(const QString& str1,const QString& str2,int nType1,int nType2,int nPara = 0); //插入连接
|
||||||
QMap<QUuid,DiagramEditorBriefConnect>& getConnection() {return _mapConnect;}
|
QMap<QUuid,DiagramEditorBriefConnect>& getConnection() {return _mapConnect;}
|
||||||
void removeConnection(QUuid);
|
void removeConnection(QUuid);
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,11 @@ public:
|
||||||
virtual QRectF boundingRect() const {return m_boundingRect;}
|
virtual QRectF boundingRect() const {return m_boundingRect;}
|
||||||
virtual void setBlockData(QPointer<DiagramEditorBaseBlock> p){_pBlock = p;}
|
virtual void setBlockData(QPointer<DiagramEditorBaseBlock> p){_pBlock = p;}
|
||||||
virtual QPointer<DiagramEditorBaseBlock> getBlockData(){return _pBlock;}
|
virtual QPointer<DiagramEditorBaseBlock> getBlockData(){return _pBlock;}
|
||||||
|
signals:
|
||||||
|
void itemDbClicked(QPointer<DiagramEditorBaseBlock>);
|
||||||
protected:
|
protected:
|
||||||
virtual QPainterPath shape();
|
virtual QPainterPath shape();
|
||||||
|
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) override;
|
||||||
protected:
|
protected:
|
||||||
QString sName;
|
QString sName;
|
||||||
EditorItemType nType;
|
EditorItemType nType;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ class EditContainerItem;
|
||||||
class DiagramEditorWizard;
|
class DiagramEditorWizard;
|
||||||
class DiagramEditorBaseBlock;
|
class DiagramEditorBaseBlock;
|
||||||
class EditBaseItem;
|
class EditBaseItem;
|
||||||
|
class DiagramEditorBayDetailSettingDlg;
|
||||||
|
|
||||||
class EditPanel : public QWidget
|
class EditPanel : public QWidget
|
||||||
{
|
{
|
||||||
|
|
@ -31,6 +32,7 @@ public:
|
||||||
public slots:
|
public slots:
|
||||||
void onWidthChanged(int width);
|
void onWidthChanged(int width);
|
||||||
void onContainerSizeChanged(EditContainerItem*); //容器大小改变时调整内部大小
|
void onContainerSizeChanged(EditContainerItem*); //容器大小改变时调整内部大小
|
||||||
|
void onItemDbClicked(QPointer<DiagramEditorBaseBlock>); //item双击事件
|
||||||
private:
|
private:
|
||||||
void initial();
|
void initial();
|
||||||
void calculateContainerWidth(EditContainerItem*); //根据间隔数量计算容器宽度 todo:区分上下间隔
|
void calculateContainerWidth(EditContainerItem*); //根据间隔数量计算容器宽度 todo:区分上下间隔
|
||||||
|
|
@ -41,6 +43,7 @@ private:
|
||||||
EditScene* m_pEditScene;
|
EditScene* m_pEditScene;
|
||||||
QVBoxLayout* _layout;
|
QVBoxLayout* _layout;
|
||||||
EditMainRect* _mainWidget;
|
EditMainRect* _mainWidget;
|
||||||
|
DiagramEditorBayDetailSettingDlg* _bayDetailSetting;
|
||||||
QGraphicsLinearLayout* _widgetLayout;
|
QGraphicsLinearLayout* _widgetLayout;
|
||||||
QGraphicsProxyWidget* m_addBtnPro;
|
QGraphicsProxyWidget* m_addBtnPro;
|
||||||
int _maxWidth;
|
int _maxWidth;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,541 @@
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QMenu>
|
||||||
|
#include "diagramEditor/diagramEditorBayDetailAddDlg.h"
|
||||||
|
#include "diagramEditor/diagramEditorBayDetailSettingDlg.h"
|
||||||
|
#include "ui_diagramEditorBayDetailAddDlg.h"
|
||||||
|
|
||||||
|
DiagramEditorBayDetailAddDlg::DiagramEditorBayDetailAddDlg(QWidget *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
, ui(new Ui::diagramEditorBayDetailAddDlg)
|
||||||
|
,_selectedModel(nullptr)
|
||||||
|
,_pParent(nullptr)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
this->setWindowFlags(Qt::FramelessWindowHint | windowFlags());
|
||||||
|
this->setWindowModality(Qt::WindowModal);
|
||||||
|
initial();
|
||||||
|
}
|
||||||
|
|
||||||
|
DiagramEditorBayDetailAddDlg::~DiagramEditorBayDetailAddDlg()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::initial()
|
||||||
|
{
|
||||||
|
_curMode = 0;
|
||||||
|
_selectedModel = new QStandardItemModel(this);
|
||||||
|
_selectedModel->setHorizontalHeaderLabels({"分类", "名称", "类型", "关联对象", "引用线路"});
|
||||||
|
ui->tableView_selected->setModel(_selectedModel);
|
||||||
|
connect(ui->btn_add,&QPushButton::clicked,this,&DiagramEditorBayDetailAddDlg::onAddClicked);
|
||||||
|
//connect(ui->btn_delete,&QPushButton::clicked,this,&DiagramEditorBayDetailAddDlg::onDeleteClicked);
|
||||||
|
connect(ui->btn_save,&QPushButton::clicked,this,&DiagramEditorBayDetailAddDlg::onSaveClicked);
|
||||||
|
connect(ui->btn_ok,&QPushButton::clicked,this,&DiagramEditorBayDetailAddDlg::onOkClicked);
|
||||||
|
connect(ui->btn_cancel,&QPushButton::clicked,this,&DiagramEditorBayDetailAddDlg::onCancelClicked);
|
||||||
|
connect(ui->cb_category,&QComboBox::currentTextChanged,this,&DiagramEditorBayDetailAddDlg::onCategoryChanged);
|
||||||
|
connect(ui->tableView_selected, &QTableView::customContextMenuRequested, this, &DiagramEditorBayDetailAddDlg::onRouteRbtnClicked);
|
||||||
|
connect(ui->tableView_items, &QTableView::customContextMenuRequested, this, &DiagramEditorBayDetailAddDlg::onComponentRbtnClicked);
|
||||||
|
|
||||||
|
ui->cb_type->addItem("母线",1);
|
||||||
|
ui->cb_type->addItem("异步电动机",2);
|
||||||
|
ui->cb_type->addItem("断路器",3);
|
||||||
|
ui->cb_type->addItem("电缆",4);
|
||||||
|
ui->cb_type->addItem("电流互感器",5);
|
||||||
|
ui->cb_type->addItem("电压互感器",6);
|
||||||
|
ui->cb_type->addItem("隔离开关",7);
|
||||||
|
ui->cb_type->addItem("接地开关",8);
|
||||||
|
ui->cb_type->addItem("快速接地开关",9);
|
||||||
|
ui->cb_type->addItem("双掷接地隔离开关",10);
|
||||||
|
ui->cb_type->addItem("带电指示器",11);
|
||||||
|
ui->cb_type->addItem("避雷器",12);
|
||||||
|
ui->cb_type->addItem("电缆出线套筒",13);
|
||||||
|
ui->cb_type->addItem("电缆端",14);
|
||||||
|
|
||||||
|
ui->tableView_items->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
ui->tableView_items->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
|
ui->tableView_items->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
ui->tableView_items->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
|
ui->tableView_items->verticalHeader()->setVisible(false);
|
||||||
|
|
||||||
|
ui->tableView_selected->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
ui->tableView_selected->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
|
ui->tableView_selected->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
ui->tableView_selected->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
|
ui->tableView_selected->verticalHeader()->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::showDlg()
|
||||||
|
{
|
||||||
|
if(_pParent){
|
||||||
|
_selectedModel->clear();
|
||||||
|
_selectedModel->setHorizontalHeaderLabels({"分类", "名称", "类型", "关联对象", "引用线路"});
|
||||||
|
show();
|
||||||
|
auto pCompo = _pParent->getComponentModel();
|
||||||
|
auto pRoute = _pParent->getRouteModel();
|
||||||
|
int n = pRoute->rowCount();
|
||||||
|
ui->le_routeName->setText("线路"+QString::number(n+1));
|
||||||
|
ui->tableView_items->setModel(pCompo);
|
||||||
|
ui->label->setText("新建线路");
|
||||||
|
ui->le_routeName->setReadOnly(true);
|
||||||
|
_curMode = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::showDlg(DiagramEditorBayRouteInfo info)
|
||||||
|
{
|
||||||
|
if(_pParent){
|
||||||
|
_selectedModel->clear();
|
||||||
|
_selectedModel->setHorizontalHeaderLabels({"分类", "名称", "类型", "关联对象", "引用线路"});
|
||||||
|
ui->le_routeName->setText(info.sRouteName);
|
||||||
|
for(auto& component:info.mapCompo){
|
||||||
|
|
||||||
|
QStandardItem *itemCate = new QStandardItem();
|
||||||
|
QStandardItem *itemName = new QStandardItem();
|
||||||
|
QStandardItem *itemType = new QStandardItem();
|
||||||
|
QStandardItem *itemObj = new QStandardItem();
|
||||||
|
QStandardItem *itemRoute = new QStandardItem();
|
||||||
|
|
||||||
|
QString sCate;
|
||||||
|
QString sType;
|
||||||
|
if(component.nCategory == 0){
|
||||||
|
sCate = "电气设备";
|
||||||
|
if(component.nType == 1){
|
||||||
|
sType = "母线";
|
||||||
|
}
|
||||||
|
else if(component.nType == 2){
|
||||||
|
sType = "异步电动机";
|
||||||
|
}
|
||||||
|
else if(component.nType == 3){
|
||||||
|
sType = "断路器";
|
||||||
|
}
|
||||||
|
else if(component.nType == 4){
|
||||||
|
sType = "电缆";
|
||||||
|
}
|
||||||
|
else if(component.nType == 5){
|
||||||
|
sType = "电流互感器";
|
||||||
|
}
|
||||||
|
else if(component.nType == 6){
|
||||||
|
sType = "电压互感器";
|
||||||
|
}
|
||||||
|
else if(component.nType == 7){
|
||||||
|
sType = "隔离开关";
|
||||||
|
}
|
||||||
|
else if(component.nType == 8){
|
||||||
|
sType = "接地开关";
|
||||||
|
}
|
||||||
|
else if(component.nType == 9){
|
||||||
|
sType = "快速接地开关";
|
||||||
|
}
|
||||||
|
else if(component.nType == 10){
|
||||||
|
sType = "双掷接地隔离开关";
|
||||||
|
}
|
||||||
|
else if(component.nType == 11){
|
||||||
|
sType = "带电指示器";
|
||||||
|
}
|
||||||
|
else if(component.nType == 12){
|
||||||
|
sType = "避雷器";
|
||||||
|
}
|
||||||
|
else if(component.nType == 13){
|
||||||
|
sType = "电缆出线套筒";
|
||||||
|
}
|
||||||
|
else if(component.nType == 14){
|
||||||
|
sType = "电缆端";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(component.nCategory == 1){
|
||||||
|
sCate = "连接关系";
|
||||||
|
if(component.nType == 1){
|
||||||
|
sType = "连接点";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
itemCate->setText(sCate);
|
||||||
|
itemName->setText(component.sName);
|
||||||
|
itemType->setText(sType);
|
||||||
|
itemObj->setText(component.sBindObj);
|
||||||
|
itemRoute->setText(component.sUsedRoute.join(","));
|
||||||
|
|
||||||
|
QList<QStandardItem*> lstItems;
|
||||||
|
lstItems<<itemCate<<itemName<<itemType<<itemObj<<itemRoute;
|
||||||
|
_selectedModel->appendRow(lstItems);
|
||||||
|
}
|
||||||
|
show();
|
||||||
|
ui->label->setText("编辑线路");
|
||||||
|
ui->le_routeName->setReadOnly(false);
|
||||||
|
_curMode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onAddClicked()
|
||||||
|
{
|
||||||
|
// 获取当前选中的索引
|
||||||
|
QModelIndexList selectedIndexes = ui->tableView_items->selectionModel()->selectedRows();
|
||||||
|
if (selectedIndexes.isEmpty()) {
|
||||||
|
return; // 没有选中任何行
|
||||||
|
}
|
||||||
|
|
||||||
|
QSet<int> uniqueRows;
|
||||||
|
foreach (const QModelIndex &index, selectedIndexes) {
|
||||||
|
uniqueRows.insert(index.row());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto pCompoModel = _pParent->getComponentModel();
|
||||||
|
|
||||||
|
foreach (int row, uniqueRows) {
|
||||||
|
QStandardItem *sourceItemName = pCompoModel->item(row, 1); //名称
|
||||||
|
int rowCount = _selectedModel->rowCount();
|
||||||
|
for(int i = 0;i < rowCount;++i){
|
||||||
|
QStandardItem *item = _selectedModel->item(i, 1);
|
||||||
|
if(item->text() == sourceItemName->text()){
|
||||||
|
QMessageBox::information(NULL, QString("提示"), QString::fromWCharArray(L"线路中设备已存在"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QStandardItem*> newRowItems;
|
||||||
|
for (int col = 0; col < pCompoModel->columnCount(); ++col) {
|
||||||
|
QStandardItem *sourceItem = pCompoModel->item(row, col);
|
||||||
|
if (sourceItem) {
|
||||||
|
// 创建深拷贝(重要!)
|
||||||
|
if(col == 4){ //线路引用,特殊处理
|
||||||
|
QString strAllRoute;
|
||||||
|
QString strCurRoute = ui->le_routeName->text();
|
||||||
|
|
||||||
|
if(!strAllRoute.contains(strCurRoute)){ //第一个引用不加符号
|
||||||
|
if(strAllRoute.isEmpty())
|
||||||
|
sourceItem->setText(strCurRoute);
|
||||||
|
else
|
||||||
|
sourceItem->setText(strAllRoute+","+strCurRoute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QStandardItem *newItem = sourceItem->clone();
|
||||||
|
newRowItems.append(newItem);
|
||||||
|
} else {
|
||||||
|
// 如果单元格为空,创建空项目
|
||||||
|
newRowItems.append(new QStandardItem());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_selectedModel->appendRow(newRowItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onDeleteClicked()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onSaveClicked()
|
||||||
|
{
|
||||||
|
QString sCategory = ui->cb_category->currentText();
|
||||||
|
QString sName = ui->le_name->text();
|
||||||
|
QString sType = ui->cb_type->currentText();
|
||||||
|
int nType = ui->cb_type->currentData().toInt();
|
||||||
|
QString sBindObj = ui->cb_bindObj->currentText();
|
||||||
|
|
||||||
|
if(_pParent){
|
||||||
|
auto pCompoModel = _pParent->getComponentModel();
|
||||||
|
int rowCount = pCompoModel->rowCount();
|
||||||
|
for(int i = 0;i < rowCount;++i){
|
||||||
|
QStandardItem *item = pCompoModel->item(i, 1);
|
||||||
|
if(item->text() == sName){
|
||||||
|
QMessageBox::information(NULL, QString("提示"), QString::fromWCharArray(L"设备名重复"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QStandardItem *itemCate = new QStandardItem();
|
||||||
|
QStandardItem *itemName = new QStandardItem();
|
||||||
|
QStandardItem *itemType = new QStandardItem();
|
||||||
|
QStandardItem *itemObj = new QStandardItem();
|
||||||
|
QStandardItem *itemRoute = new QStandardItem();
|
||||||
|
itemCate->setText(sCategory);
|
||||||
|
itemName->setText(sName);
|
||||||
|
itemType->setText(sType);
|
||||||
|
itemType->setData(nType);
|
||||||
|
itemObj->setText(sBindObj);
|
||||||
|
|
||||||
|
QList<QStandardItem*> lstItems;
|
||||||
|
lstItems<<itemCate<<itemName<<itemType<<itemObj<<itemRoute;
|
||||||
|
pCompoModel->appendRow(lstItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onOkClicked()
|
||||||
|
{
|
||||||
|
QString sRoute = ui->le_routeName->text();
|
||||||
|
auto& mapRoute = _pParent->getRouteMap();
|
||||||
|
QStringList lstName; //线路的设备列表
|
||||||
|
DiagramEditorBayRouteInfo routeInfo;
|
||||||
|
routeInfo.sRouteName = sRoute;
|
||||||
|
|
||||||
|
int rowCount = _selectedModel->rowCount();
|
||||||
|
for(int i = 0;i < rowCount;++i){
|
||||||
|
DiagramEditorComponentInfo compoInfo;
|
||||||
|
QStandardItem *itemCategory = _selectedModel->item(i, 0);
|
||||||
|
QStandardItem *itemName = _selectedModel->item(i, 1);
|
||||||
|
QStandardItem *itemType = _selectedModel->item(i, 2);
|
||||||
|
QStandardItem *itemBind = _selectedModel->item(i, 3);
|
||||||
|
QStandardItem *itemAllRoute = _selectedModel->item(i, 4);
|
||||||
|
|
||||||
|
QString sCate = itemCategory->text();
|
||||||
|
QString sName = itemName->text();
|
||||||
|
QString sType = itemType->text();
|
||||||
|
QString sBind = itemBind->text();
|
||||||
|
QString sAllRoute = itemAllRoute->text();
|
||||||
|
|
||||||
|
int nCate = 0;
|
||||||
|
if(sCate == "电气设备")
|
||||||
|
nCate = 0;
|
||||||
|
else if(sCate == "连接关系")
|
||||||
|
nCate = 1;
|
||||||
|
|
||||||
|
int nType = 0;
|
||||||
|
nType = itemType->data().toInt();
|
||||||
|
|
||||||
|
compoInfo.nCategory = nCate;
|
||||||
|
compoInfo.sName = sName;
|
||||||
|
compoInfo.nType = nType;
|
||||||
|
compoInfo.sBindObj = sBind;
|
||||||
|
compoInfo.sUsedRoute = sAllRoute.split(",");
|
||||||
|
|
||||||
|
routeInfo.mapCompo.insert(sName,compoInfo);
|
||||||
|
lstName.append(sName);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString strCompoNames = lstName.join(",");
|
||||||
|
|
||||||
|
if(_curMode == 0){
|
||||||
|
if(mapRoute.contains(sRoute)){
|
||||||
|
QMessageBox::information(NULL, QString("提示"), QString::fromWCharArray(L"线路名重复"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mapRoute.insert(sRoute,routeInfo); //插入线路到parent存储中
|
||||||
|
|
||||||
|
QStandardItem *itemRoute = new QStandardItem();
|
||||||
|
QStandardItem *itemNames = new QStandardItem();
|
||||||
|
itemRoute->setText(sRoute);
|
||||||
|
itemNames->setText(strCompoNames);
|
||||||
|
|
||||||
|
QList<QStandardItem*> lstItems;
|
||||||
|
lstItems<<itemRoute<<itemNames;
|
||||||
|
|
||||||
|
auto pRoute = _pParent->getRouteModel();
|
||||||
|
pRoute->appendRow(lstItems);
|
||||||
|
}
|
||||||
|
else if(_curMode == 1){
|
||||||
|
mapRoute[sRoute] = routeInfo;
|
||||||
|
auto pRoute = _pParent->getRouteModel();
|
||||||
|
int nCount = pRoute->rowCount();
|
||||||
|
for(int i = 0;i < rowCount;++i){
|
||||||
|
QStandardItem *itemName = pRoute->item(i, 0);
|
||||||
|
if(itemName->text() == sRoute){
|
||||||
|
QStandardItem *itemRoutes = pRoute->item(i, 1);
|
||||||
|
itemRoutes->setText(strCompoNames);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onCancelClicked()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onCategoryChanged(const QString& str)
|
||||||
|
{
|
||||||
|
ui->cb_type->clear();
|
||||||
|
if(str == "电气设备"){
|
||||||
|
QStringList lst;
|
||||||
|
ui->cb_type->addItem("母线",1);
|
||||||
|
ui->cb_type->addItem("异步电动机",2);
|
||||||
|
ui->cb_type->addItem("断路器",3);
|
||||||
|
ui->cb_type->addItem("电缆",4);
|
||||||
|
ui->cb_type->addItem("电流互感器",5);
|
||||||
|
ui->cb_type->addItem("电压互感器",6);
|
||||||
|
ui->cb_type->addItem("隔离开关",7);
|
||||||
|
ui->cb_type->addItem("接地开关",8);
|
||||||
|
ui->cb_type->addItem("快速接地开关",9);
|
||||||
|
ui->cb_type->addItem("双掷接地隔离开关",10);
|
||||||
|
ui->cb_type->addItem("带电指示器",11);
|
||||||
|
ui->cb_type->addItem("避雷器",12);
|
||||||
|
ui->cb_type->addItem("电缆出线套筒",13);
|
||||||
|
ui->cb_type->addItem("电缆端",14);
|
||||||
|
}
|
||||||
|
else if(str == "连接关系"){
|
||||||
|
ui->cb_type->addItem("连接点",1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onComponentDeleteClicked()
|
||||||
|
{
|
||||||
|
// 获取当前选中的索引
|
||||||
|
QModelIndexList selectedIndexes = ui->tableView_items->selectionModel()->selectedRows();
|
||||||
|
if (selectedIndexes.isEmpty()) {
|
||||||
|
return; // 没有选中任何行
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取行号并排序(从大到小删除避免索引变化)
|
||||||
|
QList<int> rowsToRemove;
|
||||||
|
foreach (const QModelIndex &index, selectedIndexes) {
|
||||||
|
rowsToRemove.append(index.row());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前选中的第一项索引
|
||||||
|
QModelIndex index = selectedIndexes.first();
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex indexName = index.sibling(index.row(),1);
|
||||||
|
QString sName = indexName.data().toString();
|
||||||
|
|
||||||
|
bool bUsed = false;
|
||||||
|
auto& mapRoute = _pParent->getRouteMap(); //检索所有路线,判断设备占用情况
|
||||||
|
for(auto& route:mapRoute){
|
||||||
|
QString sRoute = route.sRouteName;
|
||||||
|
for(auto& compo:route.mapCompo){
|
||||||
|
if(compo.sName == sName){
|
||||||
|
bUsed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
auto pCompoModel = _pParent->getComponentModel();
|
||||||
|
if(bUsed){
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setText(QString::fromWCharArray(L"提示"));
|
||||||
|
msgBox.setInformativeText(QString::fromWCharArray(L"设备已被使用,是否保存?"));
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
|
||||||
|
msgBox.setDefaultButton(QMessageBox::Cancel);
|
||||||
|
int ret = msgBox.exec();
|
||||||
|
|
||||||
|
switch (ret) {
|
||||||
|
case QMessageBox::Ok: //同步删除所有占用对象
|
||||||
|
{
|
||||||
|
for(auto& route:mapRoute){
|
||||||
|
QString sRoute = route.sRouteName;
|
||||||
|
route.mapCompo.remove(sName);
|
||||||
|
}
|
||||||
|
//todo:刷新主界面
|
||||||
|
|
||||||
|
foreach (int row, rowsToRemove) {
|
||||||
|
QList<QStandardItem*> rowItems;
|
||||||
|
for (int col = 0; col < pCompoModel->columnCount(); ++col) {
|
||||||
|
QStandardItem *item = pCompoModel->takeItem(row, col);
|
||||||
|
rowItems.append(item);
|
||||||
|
}
|
||||||
|
qDeleteAll(rowItems); //take的item不释放
|
||||||
|
pCompoModel->removeRow(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case QMessageBox::Cancel:
|
||||||
|
// Cancel was clicked
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// should never be reached
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// 移除行
|
||||||
|
foreach (int row, rowsToRemove) {
|
||||||
|
QList<QStandardItem*> rowItems;
|
||||||
|
for (int col = 0; col < pCompoModel->columnCount(); ++col) {
|
||||||
|
QStandardItem *item = pCompoModel->takeItem(row, col);
|
||||||
|
rowItems.append(item);
|
||||||
|
}
|
||||||
|
qDeleteAll(rowItems); //take的item不释放
|
||||||
|
pCompoModel->removeRow(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onComponentRbtnClicked(const QPoint &pos)
|
||||||
|
{
|
||||||
|
QModelIndex index = ui->tableView_items->indexAt(pos);
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return; // 如果点击的是空白区域,直接返回
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu menu;
|
||||||
|
QAction *deleteAction = new QAction("删除", this);
|
||||||
|
menu.addAction(deleteAction);
|
||||||
|
|
||||||
|
// 连接删除菜单项的触发信号与槽函数
|
||||||
|
connect(deleteAction, &QAction::triggered, this, &DiagramEditorBayDetailAddDlg::onComponentDeleteClicked);
|
||||||
|
|
||||||
|
// 在点击位置显示菜单
|
||||||
|
menu.exec(ui->tableView_items->mapToGlobal(pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onRouteDeleteClicked()
|
||||||
|
{
|
||||||
|
// 获取当前选中的索引
|
||||||
|
QModelIndexList selectedIndexes = ui->tableView_selected->selectionModel()->selectedRows();
|
||||||
|
if (selectedIndexes.isEmpty()) {
|
||||||
|
return; // 没有选中任何行
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取行号并排序(从大到小删除避免索引变化)
|
||||||
|
QList<int> rowsToRemove;
|
||||||
|
foreach (const QModelIndex &index, selectedIndexes) {
|
||||||
|
rowsToRemove.append(index.row());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前选中的第一项索引
|
||||||
|
QModelIndex index = selectedIndexes.first();
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex indexName = index.sibling(index.row(),1);
|
||||||
|
QString sName = indexName.data().toString();
|
||||||
|
|
||||||
|
// 移除行
|
||||||
|
foreach (int row, rowsToRemove) {
|
||||||
|
QList<QStandardItem*> rowItems;
|
||||||
|
for (int col = 0; col < _selectedModel->columnCount(); ++col) {
|
||||||
|
QStandardItem *item = _selectedModel->takeItem(row, col);
|
||||||
|
rowItems.append(item);
|
||||||
|
}
|
||||||
|
qDeleteAll(rowItems); //take的item不释放
|
||||||
|
_selectedModel->removeRow(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString sRoute = ui->le_routeName->text();
|
||||||
|
auto pCompoModel = _pParent->getComponentModel();
|
||||||
|
int rowCount = pCompoModel->rowCount(); //移除设备库占用记录
|
||||||
|
for(int i = 0;i < rowCount;++i){
|
||||||
|
QStandardItem *itemName = pCompoModel->item(i, 1);
|
||||||
|
if(itemName->text() == sName){
|
||||||
|
QStandardItem *itemUsed = pCompoModel->item(i, 4);
|
||||||
|
QString sUsed = itemUsed->text();
|
||||||
|
QStringList lst = sUsed.split(",");
|
||||||
|
lst.removeAll(sRoute);
|
||||||
|
itemUsed->setText(lst.join(","));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailAddDlg::onRouteRbtnClicked(const QPoint &pos)
|
||||||
|
{
|
||||||
|
QModelIndex index = ui->tableView_selected->indexAt(pos);
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return; // 如果点击的是空白区域,直接返回
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu menu;
|
||||||
|
QAction *deleteAction = new QAction("移除", this);
|
||||||
|
menu.addAction(deleteAction);
|
||||||
|
|
||||||
|
// 连接删除菜单项的触发信号与槽函数
|
||||||
|
connect(deleteAction, &QAction::triggered, this, &DiagramEditorBayDetailAddDlg::onRouteDeleteClicked);
|
||||||
|
|
||||||
|
// 在点击位置显示菜单
|
||||||
|
menu.exec(ui->tableView_selected->mapToGlobal(pos));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,298 @@
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QMenu>
|
||||||
|
#include "diagramEditor/diagramEditorBayDetailSettingDlg.h"
|
||||||
|
#include "diagramEditor/diagramEditorBayDetailAddDlg.h"
|
||||||
|
#include "diagramEditor/diagramEditorWizard.h"
|
||||||
|
#include "ui_diagramEditorBayDetailSettingDlg.h"
|
||||||
|
#include "diagramEditor/diagramEditorBaseBlock.h"
|
||||||
|
|
||||||
|
DiagramEditorBayDetailSettingDlg::DiagramEditorBayDetailSettingDlg(QWidget *parent)
|
||||||
|
: QDialog(parent)
|
||||||
|
, ui(new Ui::diagramEditorBayDetailSettingDlg)
|
||||||
|
,_pAddDlg(nullptr)
|
||||||
|
,_curOperateObj(nullptr)
|
||||||
|
,_compoModel(nullptr)
|
||||||
|
,_routeModel(nullptr)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
this->setWindowFlags(Qt::FramelessWindowHint | windowFlags());
|
||||||
|
this->setWindowModality(Qt::WindowModal);
|
||||||
|
setStyleSheet("background-color: white;");
|
||||||
|
initial();
|
||||||
|
}
|
||||||
|
|
||||||
|
DiagramEditorBayDetailSettingDlg::~DiagramEditorBayDetailSettingDlg()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::initial()
|
||||||
|
{
|
||||||
|
_compoModel = new QStandardItemModel(this);
|
||||||
|
_routeModel = new QStandardItemModel(this);
|
||||||
|
_routeModel->setHorizontalHeaderLabels({"线路名", "包含设备"});
|
||||||
|
ui->tableView->setModel(_routeModel);
|
||||||
|
connect(ui->btn_add,&QPushButton::clicked,this,&DiagramEditorBayDetailSettingDlg::onAddClicked);
|
||||||
|
connect(ui->btn_ok,&QPushButton::clicked,this,&DiagramEditorBayDetailSettingDlg::onOkClicked);
|
||||||
|
connect(ui->btn_cancel,&QPushButton::clicked,this,&DiagramEditorBayDetailSettingDlg::onCancelClicked);
|
||||||
|
connect(ui->tableView, &QTableView::customContextMenuRequested, this, &DiagramEditorBayDetailSettingDlg::onRouteRbtnClicked);
|
||||||
|
|
||||||
|
ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
|
ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
|
ui->tableView->verticalHeader()->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::refreshModel()
|
||||||
|
{
|
||||||
|
if(_curOperateObj){
|
||||||
|
_compoModel->clear();
|
||||||
|
_compoModel->setColumnCount(5);
|
||||||
|
_compoModel->setHorizontalHeaderLabels({"分类", "名称", "类型", "关联对象", "引用线路"});
|
||||||
|
auto mapComponent = _curOperateObj->getComponentMap();
|
||||||
|
for(auto& comp:mapComponent){
|
||||||
|
DiagramEditorComponentInfo info = comp;
|
||||||
|
QStandardItem *itemCate = new QStandardItem();
|
||||||
|
QStandardItem *itemName = new QStandardItem();
|
||||||
|
QStandardItem *itemType = new QStandardItem();
|
||||||
|
QStandardItem *itemObj = new QStandardItem();
|
||||||
|
QStandardItem *itemRoute = new QStandardItem();
|
||||||
|
QString sCategory;
|
||||||
|
if(info.nCategory == 0){
|
||||||
|
sCategory = "设备";
|
||||||
|
}
|
||||||
|
else if(info.nCategory == 1){
|
||||||
|
sCategory = "连接关系";
|
||||||
|
}
|
||||||
|
QString sType;
|
||||||
|
if(info.nType == 1)
|
||||||
|
{
|
||||||
|
sType = "母线";
|
||||||
|
}
|
||||||
|
else if(info.nType == 2)
|
||||||
|
{
|
||||||
|
sType = "异步电动机";
|
||||||
|
}
|
||||||
|
else if(info.nType == 3)
|
||||||
|
{
|
||||||
|
sType = "断路器";
|
||||||
|
}
|
||||||
|
else if(info.nType == 4)
|
||||||
|
{
|
||||||
|
sType = "电缆";
|
||||||
|
}
|
||||||
|
else if(info.nType == 5)
|
||||||
|
{
|
||||||
|
sType = "电流互感器";
|
||||||
|
}
|
||||||
|
else if(info.nType == 6)
|
||||||
|
{
|
||||||
|
sType = "电压互感器";
|
||||||
|
}
|
||||||
|
else if(info.nType == 7)
|
||||||
|
{
|
||||||
|
sType = "隔离开关";
|
||||||
|
}
|
||||||
|
else if(info.nType == 8)
|
||||||
|
{
|
||||||
|
sType = "接地开关";
|
||||||
|
}
|
||||||
|
else if(info.nType == 9)
|
||||||
|
{
|
||||||
|
sType = "快速接地开关";
|
||||||
|
}
|
||||||
|
else if(info.nType == 10)
|
||||||
|
{
|
||||||
|
sType = "双掷接地隔离开关";
|
||||||
|
}
|
||||||
|
else if(info.nType == 11)
|
||||||
|
{
|
||||||
|
sType = "带点指示器";
|
||||||
|
}
|
||||||
|
else if(info.nType == 12)
|
||||||
|
{
|
||||||
|
sType = "避雷器";
|
||||||
|
}
|
||||||
|
else if(info.nType == 13)
|
||||||
|
{
|
||||||
|
sType = "电缆出线套筒";
|
||||||
|
}
|
||||||
|
else if(info.nType == 14)
|
||||||
|
{
|
||||||
|
sType = "电缆端";
|
||||||
|
}
|
||||||
|
itemCate->setText(sCategory);
|
||||||
|
itemName->setText(info.sName);
|
||||||
|
itemType->setText(sType);
|
||||||
|
itemObj->setText(info.sBindObj);
|
||||||
|
itemRoute->setText(info.sUsedRoute.join("、"));
|
||||||
|
|
||||||
|
QList<QStandardItem*> lstItems;
|
||||||
|
lstItems<<itemCate<<itemName<<itemType<<itemObj<<itemRoute;
|
||||||
|
_compoModel->appendRow(lstItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
_routeModel->clear();
|
||||||
|
_routeModel->setColumnCount(2);
|
||||||
|
_routeModel->setHorizontalHeaderLabels({"线路名", "包含设备"});
|
||||||
|
auto mapRoute = _curOperateObj->getRouteInfoMap();
|
||||||
|
setRouteMap(mapRoute); //更新路径数据到本界面
|
||||||
|
for(auto& route:mapRoute){
|
||||||
|
QString sRoute = route.sRouteName;
|
||||||
|
QStringList lstComp;
|
||||||
|
for(auto& comp:route.mapCompo){
|
||||||
|
lstComp.append(comp.sName);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStandardItem *itemRoute = new QStandardItem();
|
||||||
|
QStandardItem *itemComponents = new QStandardItem();
|
||||||
|
|
||||||
|
itemRoute->setText(sRoute);
|
||||||
|
itemComponents->setText(lstComp.join(","));
|
||||||
|
QList<QStandardItem*> lstItems;
|
||||||
|
lstItems<<itemRoute<<itemComponents;
|
||||||
|
|
||||||
|
_routeModel->appendRow(lstItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::showDlg(DiagramEditorBayBlock* p)
|
||||||
|
{
|
||||||
|
show();
|
||||||
|
_curOperateObj = p;
|
||||||
|
refreshModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::onAddClicked()
|
||||||
|
{
|
||||||
|
if(_pAddDlg == nullptr){
|
||||||
|
_pAddDlg = new DiagramEditorBayDetailAddDlg(this);
|
||||||
|
_pAddDlg->setParent(this);
|
||||||
|
}
|
||||||
|
_pAddDlg->showDlg();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::onOkClicked()
|
||||||
|
{
|
||||||
|
//将ui设置的参数更新到对应block
|
||||||
|
if(_curOperateObj){
|
||||||
|
_curOperateObj->setRouteInfoMap(_mapRouteInfo);
|
||||||
|
|
||||||
|
QMap<QString,DiagramEditorComponentInfo> mapComponents;
|
||||||
|
int nRowCount = _compoModel->rowCount();
|
||||||
|
for(int i = 0;i < nRowCount;++i){
|
||||||
|
QStandardItem *itemCate = _compoModel->item(i, 0);
|
||||||
|
QStandardItem *itemName = _compoModel->item(i, 1);
|
||||||
|
QStandardItem *itemType = _compoModel->item(i, 2);
|
||||||
|
QStandardItem *itemBind = _compoModel->item(i, 3);
|
||||||
|
QStandardItem *itemRoute = _compoModel->item(i, 4);
|
||||||
|
|
||||||
|
DiagramEditorComponentInfo compoInfo;
|
||||||
|
if(itemCate->text() == "电气设备"){
|
||||||
|
compoInfo.nCategory = 0;
|
||||||
|
}
|
||||||
|
else if(itemCate->text() == "连接关系"){
|
||||||
|
compoInfo.nCategory = 1;
|
||||||
|
}
|
||||||
|
compoInfo.sName = itemName->text();
|
||||||
|
compoInfo.nType = itemType->data().toInt();
|
||||||
|
compoInfo.sBindObj = itemBind->text();
|
||||||
|
compoInfo.sUsedRoute = itemRoute->text().split(",");
|
||||||
|
|
||||||
|
mapComponents.insert(compoInfo.sName,compoInfo);
|
||||||
|
}
|
||||||
|
_curOperateObj->setComponentMap(mapComponents);
|
||||||
|
_curOperateObj = nullptr;
|
||||||
|
}
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::onCancelClicked()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::onRouteDeleteClicked()
|
||||||
|
{
|
||||||
|
// 获取当前选中的索引
|
||||||
|
QModelIndexList selectedIndexes = ui->tableView->selectionModel()->selectedRows();
|
||||||
|
if (selectedIndexes.isEmpty()) {
|
||||||
|
return; // 没有选中任何行
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取行号并排序(从大到小删除避免索引变化)
|
||||||
|
QList<int> rowsToRemove;
|
||||||
|
foreach (const QModelIndex &index, selectedIndexes) {
|
||||||
|
rowsToRemove.append(index.row());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前选中的第一项索引
|
||||||
|
QModelIndex index = selectedIndexes.first();
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex indexName = index.sibling(index.row(),0);
|
||||||
|
QString sName = indexName.data().toString();
|
||||||
|
|
||||||
|
// 移除行
|
||||||
|
foreach (int row, rowsToRemove) {
|
||||||
|
QList<QStandardItem*> rowItems;
|
||||||
|
for (int col = 0; col < _routeModel->columnCount(); ++col) {
|
||||||
|
QStandardItem *item = _routeModel->takeItem(row, col);
|
||||||
|
rowItems.append(item);
|
||||||
|
}
|
||||||
|
qDeleteAll(rowItems); //take的item不释放
|
||||||
|
_routeModel->removeRow(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
_mapRouteInfo.remove(sName); //同步移除数据
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::onRouteRbtnClicked(const QPoint &pos)
|
||||||
|
{
|
||||||
|
QModelIndex index = ui->tableView->indexAt(pos);
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return; // 如果点击的是空白区域,直接返回
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu menu;
|
||||||
|
QAction *deleteAction = new QAction("删除", this);
|
||||||
|
QAction *modifyAction = new QAction("修改", this);
|
||||||
|
menu.addAction(deleteAction);
|
||||||
|
menu.addAction(modifyAction);
|
||||||
|
|
||||||
|
// 连接删除菜单项的触发信号与槽函数
|
||||||
|
connect(deleteAction, &QAction::triggered, this, &DiagramEditorBayDetailSettingDlg::onRouteDeleteClicked);
|
||||||
|
//连接修改
|
||||||
|
connect(modifyAction, &QAction::triggered, this, &DiagramEditorBayDetailSettingDlg::onRouteEditClicked);
|
||||||
|
|
||||||
|
// 在点击位置显示菜单
|
||||||
|
menu.exec(ui->tableView->mapToGlobal(pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiagramEditorBayDetailSettingDlg::onRouteEditClicked()
|
||||||
|
{
|
||||||
|
if(_pAddDlg == nullptr){
|
||||||
|
_pAddDlg = new DiagramEditorBayDetailAddDlg(this);
|
||||||
|
_pAddDlg->setParent(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前选中的索引
|
||||||
|
QModelIndexList selectedIndexes = ui->tableView->selectionModel()->selectedRows();
|
||||||
|
if (selectedIndexes.isEmpty()) {
|
||||||
|
return; // 没有选中任何行
|
||||||
|
}
|
||||||
|
// 获取当前选中的第一项索引
|
||||||
|
QModelIndex index = selectedIndexes.first();
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
QModelIndex indexName = index.sibling(index.row(),0);
|
||||||
|
QString sName = indexName.data().toString();
|
||||||
|
|
||||||
|
auto routeInfo = _mapRouteInfo.value(sName);
|
||||||
|
_pAddDlg->showDlg(routeInfo);
|
||||||
|
}
|
||||||
|
|
@ -147,7 +147,7 @@ void DiagramEditorBaySettingDlg::onOkClicked()
|
||||||
_curOperateBlock->clearConnect();
|
_curOperateBlock->clearConnect();
|
||||||
|
|
||||||
for(int i = 0;i < ui->listWidget->count();++i){
|
for(int i = 0;i < ui->listWidget->count();++i){
|
||||||
QUuid uid = _pWizard->addConnection(_curOperateBlock->getName(),ui->listWidget->item(i)->text(),2,1,true);
|
QUuid uid = _pWizard->addConnection(_curOperateBlock->getName(),ui->listWidget->item(i)->text(),2,1);
|
||||||
_curOperateBlock->addConnect(uid);
|
_curOperateBlock->addConnect(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ void DiagramEditorTransSettingDlg::showDlg(DiagramEditorTransformerBlock* p)
|
||||||
ui->le_name->setText(p->getName());
|
ui->le_name->setText(p->getName());
|
||||||
if(p){
|
if(p){
|
||||||
auto lstCon = p->getConnect();
|
auto lstCon = p->getConnect();
|
||||||
QStringList lst;
|
/*QStringList lst;
|
||||||
for(auto& conId:lstCon){
|
for(auto& conId:lstCon){
|
||||||
if(_pWizard->getConnection().contains(conId)){
|
if(_pWizard->getConnection().contains(conId)){
|
||||||
auto con = _pWizard->getConnection().value(conId);
|
auto con = _pWizard->getConnection().value(conId);
|
||||||
|
|
@ -51,7 +51,36 @@ void DiagramEditorTransSettingDlg::showDlg(DiagramEditorTransformerBlock* p)
|
||||||
lst.append(sOpposite);
|
lst.append(sOpposite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui->listWidget->addItems(lst);
|
ui->listWidget->addItems(lst);*/
|
||||||
|
|
||||||
|
for(auto& conId:lstCon){
|
||||||
|
if(_pWizard->getConnection().contains(conId)){
|
||||||
|
auto con = _pWizard->getConnection().value(conId);
|
||||||
|
QString sOpposite = con.getOppositeName(p->getName());
|
||||||
|
|
||||||
|
QString sPos;
|
||||||
|
if(con.nPara == 0){
|
||||||
|
sPos = "高压侧";
|
||||||
|
}
|
||||||
|
else if(con.nPara == 1){
|
||||||
|
sPos = "中压侧";
|
||||||
|
}
|
||||||
|
else if(con.nPara == 2){
|
||||||
|
sPos = "低压侧";
|
||||||
|
}
|
||||||
|
|
||||||
|
int row = ui->tableWidget->rowCount();
|
||||||
|
ui->tableWidget->insertRow(row);
|
||||||
|
|
||||||
|
//名称
|
||||||
|
QTableWidgetItem* nameItem = new QTableWidgetItem(sOpposite);
|
||||||
|
ui->tableWidget->setItem(row, 0, nameItem);
|
||||||
|
|
||||||
|
//位置
|
||||||
|
QTableWidgetItem* posItem = new QTableWidgetItem(sPos);
|
||||||
|
ui->tableWidget->setItem(row, 1, posItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -61,7 +90,8 @@ void DiagramEditorTransSettingDlg::addNewTrans()
|
||||||
ui->cb_type->setCurrentIndex(0);
|
ui->cb_type->setCurrentIndex(0);
|
||||||
ui->cb_level->clear();
|
ui->cb_level->clear();
|
||||||
ui->cb_target->clear();
|
ui->cb_target->clear();
|
||||||
ui->listWidget->clear();
|
ui->tableWidget->clearContents();
|
||||||
|
ui->tableWidget->setRowCount(0);
|
||||||
if(_pWizard){
|
if(_pWizard){
|
||||||
auto mapAllCon = _pWizard->getContainerStruct();
|
auto mapAllCon = _pWizard->getContainerStruct();
|
||||||
for(auto iter = mapAllCon.begin();iter != mapAllCon.end();++iter){
|
for(auto iter = mapAllCon.begin();iter != mapAllCon.end();++iter){
|
||||||
|
|
@ -83,24 +113,66 @@ void DiagramEditorTransSettingDlg::initial()
|
||||||
connect(ui->cb_bayType,&QComboBox::currentIndexChanged,this,&DiagramEditorTransSettingDlg::onBayTypeChanged);
|
connect(ui->cb_bayType,&QComboBox::currentIndexChanged,this,&DiagramEditorTransSettingDlg::onBayTypeChanged);
|
||||||
ui->cb_bayType->setItemData(0,3); //将类型与item关联
|
ui->cb_bayType->setItemData(0,3); //将类型与item关联
|
||||||
ui->cb_bayType->setItemData(1,4);
|
ui->cb_bayType->setItemData(1,4);
|
||||||
|
|
||||||
|
QStringList headerText;
|
||||||
|
headerText<<"间隔名称"<<"连接对象";
|
||||||
|
ui->tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||||
|
ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||||
|
ui->tableWidget->setColumnCount(headerText.count());
|
||||||
|
ui->tableWidget->setHorizontalHeaderLabels(headerText);
|
||||||
|
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
|
ui->tableWidget->verticalHeader()->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiagramEditorTransSettingDlg::onAddClicked()
|
void DiagramEditorTransSettingDlg::onAddClicked()
|
||||||
{
|
{
|
||||||
QString str = ui->cb_target->currentText();
|
QString str = ui->cb_target->currentText();
|
||||||
auto lst = ui->listWidget->findItems(str,Qt::MatchExactly);
|
|
||||||
if(lst.size() == 0){ //为空才添加
|
for(int i = 0;i < ui->tableWidget->rowCount();++i){
|
||||||
ui->listWidget->addItem(str);
|
QString sName = ui->tableWidget->item(i,0)->text();
|
||||||
|
if(str == sName)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int row = ui->tableWidget->rowCount();
|
||||||
|
ui->tableWidget->insertRow(row);
|
||||||
|
|
||||||
|
//名称
|
||||||
|
QTableWidgetItem* nameItem = new QTableWidgetItem(str);
|
||||||
|
ui->tableWidget->setItem(row, 0, nameItem);
|
||||||
|
|
||||||
|
//位置
|
||||||
|
QTableWidgetItem* posItem = new QTableWidgetItem(ui->cb_toPos->currentText());
|
||||||
|
ui->tableWidget->setItem(row, 1, posItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiagramEditorTransSettingDlg::onDeleteClicked()
|
void DiagramEditorTransSettingDlg::onDeleteClicked()
|
||||||
{
|
{
|
||||||
int n = ui->listWidget->currentRow();
|
// 获取当前选中的索引
|
||||||
if(n){
|
QModelIndexList selectedIndexes = ui->tableWidget->selectionModel()->selectedRows();
|
||||||
auto pItem = ui->listWidget->takeItem(n);
|
if (selectedIndexes.isEmpty()) {
|
||||||
delete pItem;
|
return; // 没有选中任何行
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取当前选中的第一项索引
|
||||||
|
QModelIndex index = selectedIndexes.first();
|
||||||
|
if (!index.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QModelIndex indexName = index.sibling(index.row(),0);
|
||||||
|
/*QString sName = indexName.data().toString();
|
||||||
|
if(_pWizard){
|
||||||
|
//delete con?
|
||||||
|
}*/
|
||||||
|
|
||||||
|
int currentRow = ui->tableWidget->currentRow();
|
||||||
|
if (currentRow == -1) {
|
||||||
|
return; // 没有选中行
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->tableWidget->removeRow(currentRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiagramEditorTransSettingDlg::onOkClicked()
|
void DiagramEditorTransSettingDlg::onOkClicked()
|
||||||
|
|
@ -117,9 +189,25 @@ void DiagramEditorTransSettingDlg::onOkClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList lst;
|
QList<EditorTransConnection> lst;
|
||||||
for(int i = 0;i < ui->listWidget->count();++i){
|
for(int i = 0;i < ui->tableWidget->rowCount();++i){
|
||||||
lst.append(ui->listWidget->item(i)->text());
|
QString sPos = ui->tableWidget->item(i,1)->text();
|
||||||
|
int nVal = 0;
|
||||||
|
if(sPos == "高压侧"){
|
||||||
|
nVal = 0;
|
||||||
|
}
|
||||||
|
else if(sPos == "中压侧")
|
||||||
|
{
|
||||||
|
nVal = 1;
|
||||||
|
}
|
||||||
|
else if(sPos == "低压侧")
|
||||||
|
{
|
||||||
|
nVal = 2;
|
||||||
|
}
|
||||||
|
EditorTransConnection con;
|
||||||
|
con.sName = ui->tableWidget->item(i,0)->text();
|
||||||
|
con.nPara = nVal;
|
||||||
|
lst.append(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
DiagramEditorWizardTransformerInfo info;
|
DiagramEditorWizardTransformerInfo info;
|
||||||
|
|
@ -135,10 +223,24 @@ void DiagramEditorTransSettingDlg::onOkClicked()
|
||||||
_curOperateBlock->setTransType(nType);
|
_curOperateBlock->setTransType(nType);
|
||||||
_curOperateBlock->clearConnect();
|
_curOperateBlock->clearConnect();
|
||||||
|
|
||||||
for(int i = 0;i < ui->listWidget->count();++i){
|
for(int i = 0;i < ui->tableWidget->rowCount();++i){
|
||||||
QUuid uid = _pWizard->addConnection(_curOperateBlock->getName(),ui->listWidget->item(i)->text(),3,2,true);
|
QString sPos = ui->tableWidget->item(i,1)->text();
|
||||||
|
int nVal = 0;
|
||||||
|
if(sPos == "高压侧"){
|
||||||
|
nVal = 0;
|
||||||
|
}
|
||||||
|
else if(sPos == "中压侧")
|
||||||
|
{
|
||||||
|
nVal = 1;
|
||||||
|
}
|
||||||
|
else if(sPos == "低压侧")
|
||||||
|
{
|
||||||
|
nVal = 2;
|
||||||
|
}
|
||||||
|
QUuid uid = _pWizard->addConnection(_curOperateBlock->getName(),ui->tableWidget->item(i,0)->text(),3,2,nVal);
|
||||||
_curOperateBlock->addConnect(uid);
|
_curOperateBlock->addConnect(uid);
|
||||||
}
|
}
|
||||||
|
//todo: may delete
|
||||||
|
|
||||||
_pWizard->flushTransPage();
|
_pWizard->flushTransPage();
|
||||||
_curOperateBlock = nullptr;
|
_curOperateBlock = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -221,12 +221,35 @@ void DiagramEditorWizard::flushTransPage()
|
||||||
info.sName = pItem->getName();
|
info.sName = pItem->getName();
|
||||||
info.nType = pItem->getTransType();
|
info.nType = pItem->getTransType();
|
||||||
auto lstCon = pItem->getConnect(); //获取间隔所连对象的名称
|
auto lstCon = pItem->getConnect(); //获取间隔所连对象的名称
|
||||||
for(auto& conId:lstCon){
|
/*for(auto& conId:lstCon){
|
||||||
if(_mapConnect.contains(conId)){
|
if(_mapConnect.contains(conId)){
|
||||||
auto con = _mapConnect.value(conId);
|
auto con = _mapConnect.value(conId);
|
||||||
QString sOpposite = con.getOppositeName(pItem->getName());
|
QString sOpposite = con.getOppositeName(pItem->getName());
|
||||||
info.lstBindObj.append(sOpposite);
|
info.lstBindObj.append(sOpposite);
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
for(auto& conId:lstCon){
|
||||||
|
if(_mapConnect.contains(conId)){
|
||||||
|
auto con = _mapConnect.value(conId);
|
||||||
|
QString sOpposite = con.getOppositeName(pItem->getName());
|
||||||
|
|
||||||
|
QString sPos;
|
||||||
|
if(con.nPara == 0){
|
||||||
|
sPos = "高压侧";
|
||||||
|
}
|
||||||
|
else if(con.nPara == 1){
|
||||||
|
sPos = "中压侧";
|
||||||
|
}
|
||||||
|
else if(con.nPara == 2){
|
||||||
|
sPos = "低压侧";
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorTransConnection editorCon;
|
||||||
|
editorCon.nPara = con.nPara;
|
||||||
|
editorCon.sName = sOpposite;
|
||||||
|
info.lstBindObj.append(editorCon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addTransformer(info);
|
addTransformer(info);
|
||||||
|
|
@ -247,7 +270,7 @@ int DiagramEditorWizard::getContainerIndex(int nLevel,DiagramEditorStructContain
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
QUuid DiagramEditorWizard::addConnection(const QString& str1,const QString& str2,int nType1,int nType2,bool bCover)
|
QUuid DiagramEditorWizard::addConnection(const QString& str1,const QString& str2,int nType1,int nType2,int nPara)
|
||||||
{
|
{
|
||||||
for(auto& con:_mapConnect){
|
for(auto& con:_mapConnect){
|
||||||
if((con.con1.sName == str1 && con.con2.sName == str2) || (con.con1.sName == str2 && con.con2.sName == str1)){ //已存在不插入
|
if((con.con1.sName == str1 && con.con2.sName == str2) || (con.con1.sName == str2 && con.con2.sName == str1)){ //已存在不插入
|
||||||
|
|
@ -261,6 +284,7 @@ QUuid DiagramEditorWizard::addConnection(const QString& str1,const QString& str2
|
||||||
con.con1.nType = nType1;
|
con.con1.nType = nType1;
|
||||||
con.con2.sName = str2;
|
con.con2.sName = str2;
|
||||||
con.con2.nType = nType2;
|
con.con2.nType = nType2;
|
||||||
|
con.nPara = nPara;
|
||||||
|
|
||||||
_mapConnect.insert(con.uid,con);
|
_mapConnect.insert(con.uid,con);
|
||||||
return con.uid;
|
return con.uid;
|
||||||
|
|
@ -296,7 +320,11 @@ void DiagramEditorWizard::addTransformer(DiagramEditorWizardTransformerInfo info
|
||||||
ui->tableWidget_trans->setItem(row, 1, typeItem);
|
ui->tableWidget_trans->setItem(row, 1, typeItem);
|
||||||
|
|
||||||
//连接
|
//连接
|
||||||
QTableWidgetItem* connectItem = new QTableWidgetItem(info.lstBindObj.join("、"));
|
QString str;
|
||||||
|
for(auto& obj:info.lstBindObj){
|
||||||
|
str += obj.sName+"、";
|
||||||
|
}
|
||||||
|
QTableWidgetItem* connectItem = new QTableWidgetItem(str);
|
||||||
ui->tableWidget_trans->setItem(row, 2, connectItem);
|
ui->tableWidget_trans->setItem(row, 2, connectItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -542,8 +570,8 @@ void DiagramEditorWizard::onAddTransFinished(DiagramEditorWizardTransformerInfo
|
||||||
pTrans->setType(3);
|
pTrans->setType(3);
|
||||||
pTrans->setTransType(info.nType);
|
pTrans->setTransType(info.nType);
|
||||||
|
|
||||||
for(auto& sName:info.lstBindObj){
|
for(auto& obj:info.lstBindObj){
|
||||||
QUuid uid = addConnection(pTrans->getName(),sName,3,2);
|
QUuid uid = addConnection(pTrans->getName(),obj.sName,3,2,obj.nPara);
|
||||||
pTrans->addConnect(uid);
|
pTrans->addConnect(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "diagramEditor/editItems.h"
|
#include "diagramEditor/editItems.h"
|
||||||
|
#include "diagramEditor/diagramEditorBaseBlock.h"
|
||||||
|
|
||||||
EditBaseItem::EditBaseItem(QGraphicsItem *parent)
|
EditBaseItem::EditBaseItem(QGraphicsItem *parent)
|
||||||
: QGraphicsWidget(parent)
|
: QGraphicsWidget(parent)
|
||||||
|
|
@ -19,6 +20,12 @@ QPainterPath EditBaseItem::shape()
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditBaseItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
|
||||||
|
{
|
||||||
|
qDebug() << "Element double-clicked!";
|
||||||
|
emit itemDbClicked(_pBlock);
|
||||||
|
}
|
||||||
|
|
||||||
/********************bus*********************/
|
/********************bus*********************/
|
||||||
EditBusItem::EditBusItem(QGraphicsItem *parent)
|
EditBusItem::EditBusItem(QGraphicsItem *parent)
|
||||||
: EditBaseItem(parent)
|
: EditBaseItem(parent)
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,14 @@
|
||||||
#include "diagramEditor/diagramEditorStructContainer.h"
|
#include "diagramEditor/diagramEditorStructContainer.h"
|
||||||
#include "diagramEditor/diagramEditorBaseBlock.h"
|
#include "diagramEditor/diagramEditorBaseBlock.h"
|
||||||
#include "diagramEditor/editItems.h"
|
#include "diagramEditor/editItems.h"
|
||||||
|
#include "diagramEditor/diagramEditorBayDetailSettingDlg.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
EditPanel::EditPanel(QWidget *parent)
|
EditPanel::EditPanel(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
,_curWizard(nullptr)
|
,_curWizard(nullptr)
|
||||||
|
,_bayDetailSetting(nullptr)
|
||||||
{
|
{
|
||||||
_maxWidth = 0;
|
_maxWidth = 0;
|
||||||
_maxHeight = 0;
|
_maxHeight = 0;
|
||||||
|
|
@ -97,6 +99,7 @@ void EditPanel::initByWizardInfo()
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if(pItem){
|
if(pItem){
|
||||||
|
connect(pItem,&EditBaseItem::itemDbClicked,this,&EditPanel::onItemDbClicked);
|
||||||
pItem->setName(pBlock->getName());
|
pItem->setName(pBlock->getName());
|
||||||
pItem->setBlockData(pBlock);
|
pItem->setBlockData(pBlock);
|
||||||
layH->addItem(pItem);
|
layH->addItem(pItem);
|
||||||
|
|
@ -182,6 +185,7 @@ void EditPanel::initByWizardInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pItem){
|
if(pItem){
|
||||||
|
connect(pItem,&EditBaseItem::itemDbClicked,this,&EditPanel::onItemDbClicked);
|
||||||
pItem->setName(pBlock->getName());
|
pItem->setName(pBlock->getName());
|
||||||
pItem->setBlockData(pBlock);
|
pItem->setBlockData(pBlock);
|
||||||
layH->addItem(pItem);
|
layH->addItem(pItem);
|
||||||
|
|
@ -212,6 +216,7 @@ void EditPanel::initBlockConnection()
|
||||||
auto mapCon = _curWizard->getConnection();
|
auto mapCon = _curWizard->getConnection();
|
||||||
//todo:添加过的不再添加
|
//todo:添加过的不再添加
|
||||||
for(auto& con:mapCon){
|
for(auto& con:mapCon){
|
||||||
|
int nPara = con.nPara;
|
||||||
auto item1 = _curWizard->getBlockByName_all(con.con1.sName);
|
auto item1 = _curWizard->getBlockByName_all(con.con1.sName);
|
||||||
auto item2 = _curWizard->getBlockByName_all(con.con2.sName);
|
auto item2 = _curWizard->getBlockByName_all(con.con2.sName);
|
||||||
|
|
||||||
|
|
@ -289,7 +294,7 @@ void EditPanel::initBlockConnection()
|
||||||
pTrans = dynamic_cast<DiagramEditorTransformerBlock*>(item1);
|
pTrans = dynamic_cast<DiagramEditorTransformerBlock*>(item1);
|
||||||
pBay = dynamic_cast<DiagramEditorBayBlock*>(item2);
|
pBay = dynamic_cast<DiagramEditorBayBlock*>(item2);
|
||||||
}
|
}
|
||||||
else if(nT2 == 3){
|
else if(nT2 == 3){ //todo:此分支暂不起作用
|
||||||
pTrans = dynamic_cast<DiagramEditorTransformerBlock*>(item2);
|
pTrans = dynamic_cast<DiagramEditorTransformerBlock*>(item2);
|
||||||
pBay = dynamic_cast<DiagramEditorBayBlock*>(item1);
|
pBay = dynamic_cast<DiagramEditorBayBlock*>(item1);
|
||||||
}
|
}
|
||||||
|
|
@ -305,8 +310,26 @@ void EditPanel::initBlockConnection()
|
||||||
center1 += QPointF(0,pItem1->boundingRect().height());
|
center1 += QPointF(0,pItem1->boundingRect().height());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{ //三绕组 //todo:手动区分三绕组
|
else{ //三绕组
|
||||||
|
if(nPara == 0){ //高压侧
|
||||||
|
center2 += QPointF(0,pItem2->boundingRect().height());
|
||||||
|
}
|
||||||
|
else if(nPara == 1){ //中压
|
||||||
|
if(center1.x() < center2.x()){ //变压器在左
|
||||||
|
center1 += QPointF(pItem1->boundingRect().width()*0.5,pItem1->boundingRect().height()*0.5);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
center1 -= QPointF(pItem1->boundingRect().width()*0.5,0);
|
||||||
|
center1 += QPointF(0,pItem1->boundingRect().height()*0.5);
|
||||||
|
}
|
||||||
|
pLine->setStartPoint(center1);
|
||||||
|
pLine->setEndPoint(center2);
|
||||||
|
pLine->calculatePath();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if(nPara == 2){ //低压
|
||||||
|
center1 += QPointF(0,pItem1->boundingRect().height());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pLine->setStartPoint(center1);
|
pLine->setStartPoint(center1);
|
||||||
|
|
@ -351,6 +374,21 @@ void EditPanel::onContainerSizeChanged(EditContainerItem* pItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EditPanel::onItemDbClicked(QPointer<DiagramEditorBaseBlock> pBlock)
|
||||||
|
{
|
||||||
|
if(pBlock->getType() == 2){ //间隔
|
||||||
|
if(_bayDetailSetting == nullptr){
|
||||||
|
_bayDetailSetting = new DiagramEditorBayDetailSettingDlg(this);
|
||||||
|
}
|
||||||
|
auto pBay = dynamic_cast<DiagramEditorBayBlock*>(pBlock.data());
|
||||||
|
if(pBay)
|
||||||
|
_bayDetailSetting->showDlg(pBay);
|
||||||
|
}
|
||||||
|
else if(pBlock->getType() == 3){ //变压器
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EditPanel::initial()
|
void EditPanel::initial()
|
||||||
{
|
{
|
||||||
_mainWidget = new EditMainRect;
|
_mainWidget = new EditMainRect;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,381 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>diagramEditorBayDetailAddDlg</class>
|
||||||
|
<widget class="QDialog" name="diagramEditorBayDetailAddDlg">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>650</width>
|
||||||
|
<height>460</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2" columnstretch="1,3">
|
||||||
|
<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>
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QWidget" name="widget" native="true">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">background-color: rgb(210, 210, 210);</string>
|
||||||
|
</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">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color: rgb(0, 0, 0);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>新增线路</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>536</width>
|
||||||
|
<height>18</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QWidget" name="widget_4" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,1,3">
|
||||||
|
<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_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>线路名:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_routeName"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>449</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>编辑设备</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>分类:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QComboBox" name="cb_category">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>电气设备</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>连接关系</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>名称:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QLineEdit" name="le_name"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>类型:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QComboBox" name="cb_type"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>关联实体:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QComboBox" name="cb_bindObj"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1" colspan="2">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>84</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" colspan="3">
|
||||||
|
<widget class="QWidget" name="widget_3" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<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>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>35</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_save">
|
||||||
|
<property name="text">
|
||||||
|
<string>保存</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>34</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="title">
|
||||||
|
<string>设备库</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0" colspan="3">
|
||||||
|
<widget class="QTableView" name="tableView_items"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="horizontalSpacer_6">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>186</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QPushButton" name="btn_add">
|
||||||
|
<property name="text">
|
||||||
|
<string>添加到线路</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<spacer name="horizontalSpacer_7">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>186</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>线路设备列表</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableView" name="tableView_selected"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="2">
|
||||||
|
<widget class="QWidget" name="widget_2" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<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>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>540</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_ok">
|
||||||
|
<property name="text">
|
||||||
|
<string>确定</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_cancel">
|
||||||
|
<property name="text">
|
||||||
|
<string>取消</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
|
|
@ -0,0 +1,219 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>diagramEditorBayDetailSettingDlg</class>
|
||||||
|
<widget class="QDialog" name="diagramEditorBayDetailSettingDlg">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>650</width>
|
||||||
|
<height>460</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<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="QWidget" name="widget" native="true">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">background-color: rgb(217, 217, 217);</string>
|
||||||
|
</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">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color: rgb(0, 0, 0);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>间隔详细设置</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>530</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_3" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<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>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_add">
|
||||||
|
<property name="text">
|
||||||
|
<string>新增线路</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_preview">
|
||||||
|
<property name="text">
|
||||||
|
<string>预览间隔</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>结构设置</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTableView" name="tableView"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_2" native="true">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>间隔设置:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_load">
|
||||||
|
<property name="text">
|
||||||
|
<string>载入</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_save">
|
||||||
|
<property name="text">
|
||||||
|
<string>保存</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>91</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_ok">
|
||||||
|
<property name="text">
|
||||||
|
<string>确定</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btn_cancel">
|
||||||
|
<property name="text">
|
||||||
|
<string>取消</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
|
|
@ -246,7 +246,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QListWidget" name="listWidget"/>
|
<widget class="QTableWidget" name="tableWidget"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue