2025-09-05 17:30:07 +08:00
|
|
|
#include <QMessageBox>
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
#include "diagramEditor/diagramEditorTransDetailSettingDlg.h"
|
|
|
|
|
#include "diagramEditor/diagramEditorTransDetailAddDlg.h"
|
|
|
|
|
#include "diagramEditor/diagramEditorTransPreviewDlg.h"
|
|
|
|
|
#include "diagramEditor/diagramEditorWizard.h"
|
|
|
|
|
#include "ui_diagramEditorTransDetailSettingDlg.h"
|
|
|
|
|
#include "diagramEditor/diagramEditorBaseBlock.h"
|
|
|
|
|
#include "graphicsDataModel/diagramEditorModel.h"
|
|
|
|
|
#include "topologyManager.h"
|
|
|
|
|
#include "diagramEditor/diagramEditorTransPreviewDlg.h"
|
|
|
|
|
|
|
|
|
|
DiagramEditorTransDetailSettingDlg::DiagramEditorTransDetailSettingDlg(QWidget *parent)
|
|
|
|
|
: QDialog(parent)
|
|
|
|
|
, ui(new Ui::diagramEditorTransDetailSettingDlg)
|
|
|
|
|
,_pAddDlg(nullptr)
|
|
|
|
|
,_curOperateObj(nullptr)
|
|
|
|
|
,_compoModel(nullptr)
|
|
|
|
|
,_pPreviewDlg(nullptr)
|
|
|
|
|
,_pModel(nullptr)
|
|
|
|
|
,_curOperateRouteView(nullptr)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
this->setWindowFlags(Qt::FramelessWindowHint | windowFlags());
|
|
|
|
|
this->setWindowModality(Qt::WindowModal);
|
|
|
|
|
setStyleSheet("background-color: white;");
|
|
|
|
|
initial();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DiagramEditorTransDetailSettingDlg::~DiagramEditorTransDetailSettingDlg()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::initial()
|
|
|
|
|
{
|
|
|
|
|
_compoModel = new QStandardItemModel(this);
|
|
|
|
|
for(int i = 0;i < 3;++i){
|
|
|
|
|
auto pModel = new QStandardItemModel(this);
|
|
|
|
|
pModel->setHorizontalHeaderLabels({"线路名", "包含设备"});
|
|
|
|
|
_routeModels[i] = pModel;
|
|
|
|
|
if(i == 0){
|
|
|
|
|
ui->tableView_hv->setModel(pModel);
|
|
|
|
|
}
|
|
|
|
|
else if(i == 1){
|
|
|
|
|
ui->tableView_mv->setModel(pModel);
|
|
|
|
|
}
|
|
|
|
|
else if(i == 2){
|
|
|
|
|
ui->tableView_lv->setModel(pModel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
connect(ui->btn_add,&QPushButton::clicked,this,&DiagramEditorTransDetailSettingDlg::onAddClicked);
|
|
|
|
|
connect(ui->btn_ok,&QPushButton::clicked,this,&DiagramEditorTransDetailSettingDlg::onOkClicked);
|
|
|
|
|
connect(ui->btn_cancel,&QPushButton::clicked,this,&DiagramEditorTransDetailSettingDlg::onCancelClicked);
|
|
|
|
|
connect(ui->btn_previewEquips,&QPushButton::clicked,this,&DiagramEditorTransDetailSettingDlg::onPreviewNeutralClicked);
|
|
|
|
|
connect(ui->btn_previewTrans,&QPushButton::clicked,this,&DiagramEditorTransDetailSettingDlg::onPreviewTransClicked);
|
|
|
|
|
connect(ui->tableView_hv, &QTableView::customContextMenuRequested, this, &DiagramEditorTransDetailSettingDlg::onRouteRbtnClicked);
|
|
|
|
|
connect(ui->tableView_mv, &QTableView::customContextMenuRequested, this, &DiagramEditorTransDetailSettingDlg::onRouteRbtnClicked);
|
|
|
|
|
connect(ui->tableView_lv, &QTableView::customContextMenuRequested, this, &DiagramEditorTransDetailSettingDlg::onRouteRbtnClicked);
|
|
|
|
|
|
|
|
|
|
ui->tableView_hv->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
|
ui->tableView_hv->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
|
|
|
ui->tableView_hv->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
|
ui->tableView_hv->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
|
|
ui->tableView_hv->verticalHeader()->setVisible(false);
|
|
|
|
|
|
|
|
|
|
ui->tableView_mv->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
|
ui->tableView_mv->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
|
|
|
ui->tableView_mv->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
|
ui->tableView_mv->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
|
|
ui->tableView_mv->verticalHeader()->setVisible(false);
|
|
|
|
|
|
|
|
|
|
ui->tableView_lv->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
|
ui->tableView_lv->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
|
|
|
ui->tableView_lv->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
|
ui->tableView_lv->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
|
|
ui->tableView_lv->verticalHeader()->setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::refreshModel()
|
|
|
|
|
{
|
|
|
|
|
if(_curOperateObj){
|
|
|
|
|
_compoModel->clear();
|
|
|
|
|
_compoModel->setColumnCount(5);
|
|
|
|
|
_compoModel->setHorizontalHeaderLabels({"分类", "名称", "类型", "关联对象", "引用线路"});
|
2025-09-19 18:11:28 +08:00
|
|
|
auto transInfo = _curOperateObj->getTranInfo();
|
|
|
|
|
|
|
|
|
|
for(auto& comp:transInfo.mapComponent){
|
2025-09-05 17:30:07 +08:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(auto pModel:_routeModels){
|
|
|
|
|
pModel->clear();
|
|
|
|
|
pModel->setColumnCount(2);
|
|
|
|
|
pModel->setHorizontalHeaderLabels({"线路名", "包含设备"});
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-19 18:11:28 +08:00
|
|
|
setTransInfo(transInfo); //更新路径数据到本界面
|
|
|
|
|
for(auto it = transInfo.mapNeutral.begin();it != transInfo.mapNeutral.end();++it){
|
|
|
|
|
for(auto& route:it.value().mapRoute){
|
2025-09-05 17:30:07 +08:00
|
|
|
QString sRoute = route.sRouteName;
|
|
|
|
|
QStringList lstComp;
|
|
|
|
|
for(auto& comp:route.lstCompo){
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
auto routeModel = _routeModels.value(it.key());
|
|
|
|
|
if(routeModel)
|
|
|
|
|
routeModel->appendRow(lstItems);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::showDlg(DiagramEditorTransformerBlock* p)
|
|
|
|
|
{
|
|
|
|
|
show();
|
|
|
|
|
_curOperateObj = p;
|
|
|
|
|
refreshModel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onAddClicked()
|
|
|
|
|
{
|
|
|
|
|
if(_pAddDlg == nullptr){
|
|
|
|
|
_pAddDlg = new DiagramEditorTransDetailAddDlg(this);
|
|
|
|
|
_pAddDlg->setParent(this);
|
|
|
|
|
}
|
|
|
|
|
int n = ui->tabWidget->currentIndex();
|
|
|
|
|
_pAddDlg->showDlg(n);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onOkClicked()
|
|
|
|
|
{
|
|
|
|
|
//将ui设置的参数更新到对应block
|
|
|
|
|
if(_curOperateObj){
|
2025-09-19 18:11:28 +08:00
|
|
|
//_curOperateObj->setRouteInfoMaps(_mapsRouteInfo);
|
2025-09-05 17:30:07 +08:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
int nDir = itemName->data(Qt::UserRole+1).toInt(); //连接方向
|
|
|
|
|
QPoint deltaPos = itemName->data(Qt::UserRole+2).toPoint(); //相对位置
|
|
|
|
|
QUuid uid = itemName->data(Qt::UserRole+3).toUuid(); //uid
|
|
|
|
|
int nVal = itemName->data(Qt::UserRole+4).toInt(); //标志
|
|
|
|
|
int nRotate = itemName->data(Qt::UserRole+5).toInt(); //旋转角度
|
2025-09-19 18:11:28 +08:00
|
|
|
int nBindType = itemBind->data(Qt::UserRole+1).toInt();
|
2025-09-05 17:30:07 +08:00
|
|
|
|
|
|
|
|
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();
|
2025-09-19 18:11:28 +08:00
|
|
|
compoInfo.nBindType = nBindType;
|
|
|
|
|
compoInfo.nBindPara = itemBind->data(Qt::UserRole+2).toInt();
|
|
|
|
|
compoInfo.sBindParent = itemBind->data(Qt::UserRole+3).toString();
|
2025-09-05 17:30:07 +08:00
|
|
|
compoInfo.sUsedRoute = itemRoute->text().split(",");
|
|
|
|
|
compoInfo.nUsedDirection = nDir;
|
|
|
|
|
compoInfo.deltaPos = deltaPos;
|
|
|
|
|
compoInfo.uid = uid;
|
|
|
|
|
compoInfo.nFlag = nVal;
|
|
|
|
|
compoInfo.nRotate = nRotate;
|
|
|
|
|
|
|
|
|
|
mapComponents.insert(compoInfo.sName,compoInfo);
|
|
|
|
|
}
|
2025-09-19 18:11:28 +08:00
|
|
|
//_curOperateObj->setComponentMap(mapComponents);
|
|
|
|
|
_transInfo.mapComponent = mapComponents;
|
|
|
|
|
if(_transInfo.mapNeutral.contains(0)){
|
|
|
|
|
_transInfo.mapNeutral[0].nType = 0;
|
|
|
|
|
_transInfo.mapNeutral[0].delPoint = QPointF(100,-100);
|
|
|
|
|
}
|
|
|
|
|
if(_transInfo.mapNeutral.contains(1)){
|
|
|
|
|
_transInfo.mapNeutral[1].nType = 1;
|
|
|
|
|
_transInfo.mapNeutral[1].delPoint = QPointF(-100,-50);
|
|
|
|
|
}
|
|
|
|
|
if(_transInfo.mapNeutral.contains(2)){
|
|
|
|
|
_transInfo.mapNeutral[2].nType = 2;
|
|
|
|
|
_transInfo.mapNeutral[2].delPoint = QPointF(100,0);
|
|
|
|
|
}
|
|
|
|
|
_curOperateObj->setTransInfo(_transInfo);
|
2025-09-05 17:30:07 +08:00
|
|
|
TopologyManager::instance().clearGlobalBlockData(_curOperateObj->getName());
|
|
|
|
|
TopologyManager::instance().moveTempBlockData();
|
|
|
|
|
_curOperateObj = nullptr;
|
|
|
|
|
}
|
|
|
|
|
hide();
|
|
|
|
|
_pModel->clearCurPreview(); //关闭时清除预览Item
|
|
|
|
|
//todo:清除mainPanel中的对应item(如果存在)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onCancelClicked()
|
|
|
|
|
{
|
|
|
|
|
hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onRouteDeleteClicked()
|
|
|
|
|
{
|
|
|
|
|
// 获取当前选中的索引
|
|
|
|
|
QModelIndexList selectedIndexes = _curOperateRouteView->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();
|
|
|
|
|
|
|
|
|
|
// 移除行
|
|
|
|
|
int n = ui->tabWidget->currentIndex();
|
|
|
|
|
foreach (int row, rowsToRemove) {
|
|
|
|
|
QList<QStandardItem*> rowItems;
|
|
|
|
|
for (int col = 0; col < _routeModels.value(n)->columnCount(); ++col) {
|
|
|
|
|
QStandardItem *item = _routeModels.value(n)->takeItem(row, col);
|
|
|
|
|
rowItems.append(item);
|
|
|
|
|
}
|
|
|
|
|
qDeleteAll(rowItems); //take的item不释放
|
|
|
|
|
_routeModels.value(n)->removeRow(row);
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-19 18:11:28 +08:00
|
|
|
//_mapsRouteInfo.value(n).remove(sName); //同步移除数据
|
|
|
|
|
_transInfo.mapNeutral.value(n).mapRoute.remove(sName); //同步移除数据
|
2025-09-05 17:30:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onRouteRbtnClicked(const QPoint &pos)
|
|
|
|
|
{
|
|
|
|
|
int n = ui->tabWidget->currentIndex();
|
|
|
|
|
if(n == 0){ //高压中性点v
|
|
|
|
|
_curOperateRouteView = ui->tableView_hv;
|
|
|
|
|
}
|
|
|
|
|
else if(n == 1){ //中压
|
|
|
|
|
_curOperateRouteView = ui->tableView_mv;
|
|
|
|
|
}
|
|
|
|
|
else if(n == 2){ //低压
|
|
|
|
|
_curOperateRouteView = ui->tableView_lv;
|
|
|
|
|
}
|
|
|
|
|
if(_curOperateRouteView){
|
|
|
|
|
QModelIndex index = _curOperateRouteView->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, &DiagramEditorTransDetailSettingDlg::onRouteDeleteClicked);
|
|
|
|
|
//连接修改
|
|
|
|
|
connect(modifyAction, &QAction::triggered, this, &DiagramEditorTransDetailSettingDlg::onRouteEditClicked);
|
|
|
|
|
|
|
|
|
|
// 在点击位置显示菜单
|
|
|
|
|
menu.exec(_curOperateRouteView->mapToGlobal(pos));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onRouteEditClicked()
|
|
|
|
|
{
|
|
|
|
|
if(_pAddDlg == nullptr){
|
|
|
|
|
_pAddDlg = new DiagramEditorTransDetailAddDlg(this);
|
|
|
|
|
_pAddDlg->setParent(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取当前选中的索引
|
|
|
|
|
QModelIndexList selectedIndexes = _curOperateRouteView->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();
|
|
|
|
|
|
|
|
|
|
int n = ui->tabWidget->currentIndex();
|
2025-09-19 18:11:28 +08:00
|
|
|
//auto routeInfo = _mapsRouteInfo.value(n).value(sName);
|
|
|
|
|
auto routeInfo = _transInfo.mapNeutral.value(n).mapRoute.value(sName);
|
2025-09-05 17:30:07 +08:00
|
|
|
_pAddDlg->showDlg(routeInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onPreviewNeutralClicked()
|
|
|
|
|
{
|
|
|
|
|
if(_pPreviewDlg == nullptr){
|
|
|
|
|
_pPreviewDlg = new DiagramEditorTransPreviewDlg(this);
|
|
|
|
|
_pPreviewDlg->setParent(this);
|
|
|
|
|
_pModel->setCurTransComponentModel(_compoModel);
|
|
|
|
|
_pModel->setCurTransRouteModels(_routeModels);
|
|
|
|
|
}
|
|
|
|
|
if(!_pPreviewDlg->isVisible()){
|
|
|
|
|
int n = ui->tabWidget->currentIndex();
|
|
|
|
|
_pPreviewDlg->showDlg(n);
|
|
|
|
|
_pModel->clearCurPreview();
|
|
|
|
|
_pModel->generateTempTrans(n);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
_pPreviewDlg->hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DiagramEditorTransDetailSettingDlg::onPreviewTransClicked()
|
|
|
|
|
{
|
|
|
|
|
if(_pPreviewDlg == nullptr){
|
|
|
|
|
_pPreviewDlg = new DiagramEditorTransPreviewDlg(this);
|
|
|
|
|
_pPreviewDlg->setParent(this);
|
|
|
|
|
_pModel->setCurTransComponentModel(_compoModel);
|
|
|
|
|
_pModel->setCurTransRouteModels(_routeModels);
|
|
|
|
|
}
|
|
|
|
|
if(!_pPreviewDlg->isVisible()){
|
|
|
|
|
_pPreviewDlg->showDlg(3);
|
|
|
|
|
_pModel->clearCurPreview();
|
|
|
|
|
_pModel->generateTempTrans(3,_curOperateObj);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
_pPreviewDlg->hide();
|
|
|
|
|
}
|