Добавлена настройка сравнения

This commit is contained in:
Andrey Rodionov 2016-04-11 15:58:41 +03:00
parent 3199842962
commit ea17077dc7
5 changed files with 1265 additions and 62 deletions

View File

@ -2,7 +2,7 @@
#include <QMessageBox>
#include <QDebug>
#include <QFileDialog>
#include "structuresdifference.h"
#include <QSettings>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
@ -13,6 +13,51 @@ MainWindow::MainWindow(QWidget *parent) :
connect(openFirstFileAction, SIGNAL(triggered(bool)), this, SLOT(openFirstFile()));
connect(openSecondFileAction, SIGNAL(triggered(bool)),this, SLOT(openSecondFile()));
connect(exitAction, SIGNAL(triggered(bool)),this, SLOT(close()));
m_diffModel = NULL;
QSettings settings("ASCON", "StructuresDifference");
settings.beginGroup("DiffOption");
classIdCheckBox->setChecked(settings.value("classId",true).toBool());
classBlockedCheckBox->setChecked(settings.value("classBlocked",true).toBool());
classScreenNameCheckBox->setChecked(settings.value("classScreenName",true).toBool());
classBaseClassCheckBox->setChecked(settings.value("classBaseClass",true).toBool());
classChildCheckBox->setChecked(settings.value("classChild",true).toBool());
classFilterCheckBox->setChecked(settings.value("classFilter",true).toBool());
classPermsCheckBox->setChecked(settings.value("classPerms",true).toBool());
permGroupCheckBox->setChecked(settings.value("permGroup",true).toBool());
attrIdCheckBox->setChecked(settings.value("attrId",true).toBool());
attrDataTypeCheckBox->setChecked(settings.value("attrDataType",true).toBool());
attrTypeCheckBox->setChecked(settings.value("attrType",true).toBool());
attrScreenNameCheckBox->setChecked(settings.value("attrScreenName",true).toBool());
attrAliasNameCheckBox->setChecked(settings.value("attrAliasName",true).toBool());
attrFuncReadCheckBox->setChecked(settings.value("attrFuncRead",true).toBool());
attrFuncWriteCheckBox->setChecked(settings.value("attrFuncWrite",true).toBool());
attrBlockedCheckBox->setChecked(settings.value("attrBlocked",true).toBool());
attrMeasureUnitCheckBox->setChecked(settings.value("attrMeasureUnit",true).toBool());
attrMeasureEntityCheckBox->setChecked(settings.value("attrMeasureEntity",true).toBool());
attrForbidInputCheckBox->setChecked(settings.value("attrForbidInput",true).toBool());
attrBaseClassCheckBox->setChecked(settings.value("attrBaseClass",true).toBool());
attrPrecisionCheckBox->setChecked(settings.value("attrPrecision",true).toBool());
attrGroupCheckBox->setChecked(settings.value("attrGroup",true).toBool());
attrPropCheckBox->setChecked(settings.value("attrProp",true).toBool());
attrPermsCheckBox->setChecked(settings.value("attrPerms",true).toBool());
objIdCheckBox->setChecked(settings.value("objId",true).toBool());
objOwnerIdCheckBox->setChecked(settings.value("objOwnerId",true).toBool());
objWasChangedCheckBox->setChecked(settings.value("objWasChanged",true).toBool());
objReadOnlyCheckBox->setChecked(settings.value("objReadOnly",true).toBool());
objChildsCheckBox->setChecked(settings.value("objChilds",true).toBool());
objAttrNameCheckBox->setChecked(settings.value("objAttrName",true).toBool());
objAttrValueCheckBox->setChecked(settings.value("objAttrValue",true).toBool());
objAttrMeasureUnitCheckBox->setChecked(settings.value("objAttrMeasureUnit",true).toBool());
objAttrPrecisionCheckBox->setChecked(settings.value("objAttrPrecision",true).toBool());
objAttrOwnerIdCheckBox->setChecked(settings.value("objAttrOwnerId",true).toBool());
settings.endGroup();
}
@ -40,21 +85,22 @@ void MainWindow::runDiff()
return;
}
StructuresDifference *diffModel = new StructuresDifference();
if (diffModel->connect()) {
m_diffModel = new StructuresDifference();
setCheckBox();
if (m_diffModel->connect()) {
logPlainTextEdit->clear();
vkernelLib::IVModel *vModelSrc = diffModel->loadFile(m_firstFileName);
vkernelLib::IVModel *vModelDst = diffModel->loadFile(m_secondFileName);
vkernelLib::IVModel *vModelSrc = m_diffModel->loadFile(m_firstFileName);
vkernelLib::IVModel *vModelDst = m_diffModel->loadFile(m_secondFileName);
logPlainTextEdit->appendPlainText("Первый файл: " + m_firstFileName);
logPlainTextEdit->appendPlainText("Второй файл: " + m_secondFileName);
if (vModelDst!=NULL && vModelSrc!=NULL) {
logPlainTextEdit->appendPlainText(diffModel->differenceAttrGroups(vModelSrc, vModelDst));
logPlainTextEdit->appendPlainText(diffModel->differenceModels(vModelSrc, vModelDst));
logPlainTextEdit->appendPlainText(m_diffModel->differenceAttrGroups(vModelSrc, vModelDst));
logPlainTextEdit->appendPlainText(m_diffModel->differenceModels(vModelSrc, vModelDst));
logPlainTextEdit->appendPlainText("\nПроверка закончена");
}
} else
QMessageBox::warning(this, tr("Ошибка соединения"), tr("Ошибка соединения с сервером приложений"));
delete diffModel;
delete m_diffModel;
}
void MainWindow::openFirstFile()
@ -72,3 +118,90 @@ void MainWindow::openSecondFile()
"", tr("VTP файл (*.vtp)"));
logPlainTextEdit->appendPlainText("Выбран второй файл: " + m_secondFileName);
}
void MainWindow::setCheckBox()
{
m_diffModel->setClassId(classIdCheckBox->isChecked());
m_diffModel->setClassBlocked(classBlockedCheckBox->isChecked());
m_diffModel->setClassScreenName(classScreenNameCheckBox->isChecked());
m_diffModel->setClassBaseClass(classBaseClassCheckBox->isChecked());
m_diffModel->setClassChild(classChildCheckBox->isChecked());
m_diffModel->setClassFilter(classFilterCheckBox->isChecked());
m_diffModel->setClassPerms(classPermsCheckBox->isChecked());
m_diffModel->setPermGroup(permGroupCheckBox->isChecked());
m_diffModel->setAttrId(attrIdCheckBox->isChecked());
m_diffModel->setAttrDataType(attrDataTypeCheckBox->isChecked());
m_diffModel->setAttrType(attrTypeCheckBox->isChecked());
m_diffModel->setAttrScreenName(attrScreenNameCheckBox->isChecked());
m_diffModel->setAttrAliasName(attrAliasNameCheckBox->isChecked());
m_diffModel->setAttrFuncRead(attrFuncReadCheckBox->isChecked());
m_diffModel->setAttrFuncWrite(attrFuncWriteCheckBox->isChecked());
m_diffModel->setAttrBlocked(attrBlockedCheckBox->isChecked());
m_diffModel->setAttrMeasureUnit(attrMeasureUnitCheckBox->isChecked());
m_diffModel->setAttrMeasureEntity(attrMeasureEntityCheckBox->isChecked());
m_diffModel->setAttrForbidInput(attrForbidInputCheckBox->isChecked());
m_diffModel->setAttrBaseClass(attrBaseClassCheckBox->isChecked());
m_diffModel->setAttrPrecision(attrPrecisionCheckBox->isChecked());
m_diffModel->setAttrGroup(attrGroupCheckBox->isChecked());
m_diffModel->setAttrProp(attrPropCheckBox->isChecked());
m_diffModel->setAttrPerms(attrPermsCheckBox->isChecked());
m_diffModel->setObjId(objIdCheckBox->isChecked());
m_diffModel->setObjOwnerId(objOwnerIdCheckBox->isChecked());
m_diffModel->setObjWasChanged(objWasChangedCheckBox->isChecked());
m_diffModel->setObjReadOnly(objReadOnlyCheckBox->isChecked());
m_diffModel->setObjChilds(objChildsCheckBox->isChecked());
m_diffModel->setObjAttrName(objAttrNameCheckBox->isChecked());
m_diffModel->setObjAttrValue(objAttrValueCheckBox->isChecked());
m_diffModel->setObjAttrMeasureUnit(objAttrMeasureUnitCheckBox->isChecked());
m_diffModel->setObjAttrPrecision(objAttrPrecisionCheckBox->isChecked());
m_diffModel->setObjAttrOwnerId(objAttrOwnerIdCheckBox->isChecked());
}
void MainWindow::closeEvent(QCloseEvent *event)
{
QSettings settings("ASCON", "StructuresDifference");
settings.beginGroup("DiffOption");
settings.setValue("classId", classIdCheckBox->isChecked());
settings.setValue("classBlocked", classBlockedCheckBox->isChecked());
settings.setValue("classScreenName", classScreenNameCheckBox->isChecked());
settings.setValue("classBaseClass", classBaseClassCheckBox->isChecked());
settings.setValue("classChild", classChildCheckBox->isChecked());
settings.setValue("classFilter", classFilterCheckBox->isChecked());
settings.setValue("classPerms", classPermsCheckBox->isChecked());
settings.setValue("permGroup", permGroupCheckBox->isChecked());
settings.setValue("attrId", attrIdCheckBox->isChecked());
settings.setValue("attrDataType", attrDataTypeCheckBox->isChecked());
settings.setValue("attrType", attrTypeCheckBox->isChecked());
settings.setValue("attrScreenName", attrScreenNameCheckBox->isChecked());
settings.setValue("attrAliasName", attrAliasNameCheckBox->isChecked());
settings.setValue("attrFuncRead", attrFuncReadCheckBox->isChecked());
settings.setValue("attrFuncWrite", attrFuncWriteCheckBox->isChecked());
settings.setValue("attrBlocked", attrBlockedCheckBox->isChecked());
settings.setValue("attrMeasureUnit", attrMeasureUnitCheckBox->isChecked());
settings.setValue("attrMeasureEntity", attrMeasureEntityCheckBox->isChecked());
settings.setValue("attrForbidInput", attrForbidInputCheckBox->isChecked());
settings.setValue("attrBaseClass", attrBaseClassCheckBox->isChecked());
settings.setValue("attrPrecision", attrPrecisionCheckBox->isChecked());
settings.setValue("attrGroup", attrGroupCheckBox->isChecked());
settings.setValue("attrProp", attrPropCheckBox->isChecked());
settings.setValue("attrPerms", attrPermsCheckBox->isChecked());
settings.setValue("objId", objIdCheckBox->isChecked());
settings.setValue("objOwnerId", objOwnerIdCheckBox->isChecked());
settings.setValue("objWasChanged", objWasChangedCheckBox->isChecked());
settings.setValue("objReadOnly", objReadOnlyCheckBox->isChecked());
settings.setValue("objChilds", objChildsCheckBox->isChecked());
settings.setValue("objAttrName", objAttrNameCheckBox->isChecked());
settings.setValue("objAttrValue", objAttrValueCheckBox->isChecked());
settings.setValue("objAttrMeasureUnit", objAttrMeasureUnitCheckBox->isChecked());
settings.setValue("objAttrPrecision", objAttrPrecisionCheckBox->isChecked());
settings.setValue("objAttrOwnerId", objAttrOwnerIdCheckBox->isChecked());
settings.endGroup();
event->accept();
}

View File

@ -2,6 +2,7 @@
#define MAINWINDOW_H
#include "ui_mainwindow.h"
#include "structuresdifference.h"
class MainWindow : public QMainWindow, private Ui::MainWindow
{
@ -15,10 +16,13 @@ private slots:
void runDiff();
void openFirstFile();
void openSecondFile();
void setCheckBox();
void closeEvent(QCloseEvent *event);
private:
QString m_firstFileName;
QString m_secondFileName;
StructuresDifference *m_diffModel;
};
#endif // MAINWINDOW_H

View File

@ -6,15 +6,19 @@
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>437</height>
<width>797</width>
<height>586</height>
</rect>
</property>
<property name="windowTitle">
<string>Сравнение моделей данных Вертикаль</string>
</property>
<property name="windowIcon">
<iconset resource="qrc.qrc">
<normaloff>:/icons/run.svg</normaloff>:/icons/run.svg</iconset>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPlainTextEdit" name="logPlainTextEdit"/>
</item>
@ -25,7 +29,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<width>797</width>
<height>18</height>
</rect>
</property>
@ -61,6 +65,514 @@
<addaction name="saveLogFileAction"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QDockWidget" name="dockWidget">
<property name="windowTitle">
<string>Элементы для сравнения</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QToolBox" name="toolBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>270</width>
<height>490</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="tabSpacing">
<number>0</number>
</property>
<widget class="QWidget" name="page">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>268</width>
<height>446</height>
</rect>
</property>
<attribute name="label">
<string>Модель данных</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Класс</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1">
<widget class="QCheckBox" name="classScreenNameCheckBox">
<property name="text">
<string>Экранное имя</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="classBlockedCheckBox">
<property name="text">
<string>Блокировка</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="classIdCheckBox">
<property name="text">
<string>Идентификатор</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="classPermsCheckBox">
<property name="text">
<string>Права доступа</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="classBaseClassCheckBox">
<property name="text">
<string>Базовый класс</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Атрибут</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="5" column="0">
<widget class="QCheckBox" name="attrFuncReadCheckBox">
<property name="text">
<string>Функция чтения</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="attrTypeCheckBox">
<property name="text">
<string>Тип атрибута</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="attrIdCheckBox">
<property name="text">
<string>Идентификатор</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="attrForbidInputCheckBox">
<property name="text">
<string>Ввод из списка</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="attrScreenNameCheckBox">
<property name="text">
<string>Экранное имя</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="attrDataTypeCheckBox">
<property name="text">
<string>Тип данных</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="attrMeasureEntityCheckBox">
<property name="text">
<string>Величина</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="attrAliasNameCheckBox">
<property name="text">
<string>Спавочники</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="attrPrecisionCheckBox">
<property name="text">
<string>Точность</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="attrFuncWriteCheckBox">
<property name="text">
<string>Функция записи</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="attrMeasureUnitCheckBox">
<property name="text">
<string>Един. величины</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="attrBaseClassCheckBox">
<property name="text">
<string>Базовый класс</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="attrGroupCheckBox">
<property name="text">
<string>Группа</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="attrBlockedCheckBox">
<property name="text">
<string>Блокировка</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QCheckBox" name="attrPermsCheckBox">
<property name="text">
<string>Права доступа</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QCheckBox" name="attrPropCheckBox">
<property name="text">
<string>Свойства</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Другое</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QCheckBox" name="classFilterCheckBox">
<property name="text">
<string>Фильтры</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="classChildCheckBox">
<property name="text">
<string>Связи</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="permGroupCheckBox">
<property name="text">
<string>Роли пользователей (группы)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>251</width>
<height>267</height>
</rect>
</property>
<attribute name="label">
<string>Данные</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Объект</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<widget class="QCheckBox" name="objIdCheckBox">
<property name="text">
<string>Идентификатор</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="objReadOnlyCheckBox">
<property name="text">
<string>Только чтение</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="objOwnerIdCheckBox">
<property name="text">
<string>Владелец</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="objWasChangedCheckBox">
<property name="text">
<string>Изменение</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Атрибут объекта</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="1">
<widget class="QCheckBox" name="objAttrNameCheckBox">
<property name="text">
<string>Наименование</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="objAttrValueCheckBox">
<property name="text">
<string>Значение</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="objAttrMeasureUnitCheckBox">
<property name="text">
<string>Един. величины</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="objAttrPrecisionCheckBox">
<property name="text">
<string>Точность</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="objAttrOwnerIdCheckBox">
<property name="text">
<string>Владелец</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Другое</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QCheckBox" name="objChildsCheckBox">
<property name="text">
<string>Связи</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
<action name="openFirstFileAction">
<property name="icon">
<iconset resource="qrc.qrc">

View File

@ -12,6 +12,45 @@ StructuresDifference::StructuresDifference(QObject *parent) : QObject(parent)
::CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE,
RPC_C_IMP_LEVEL_DELEGATE, NULL, 0, NULL);
uniRef = NULL;
m_classId = true;
m_classBlocked = true;
m_classScreenName = true;
m_classBaseClass = true;
m_classChild = true;
m_classFilter = true;
m_classPerms = true;
m_permGroup = true;
m_attrId = true;
m_attrDataType = true;
m_attrType = true;
m_attrScreenName = true;
m_attrAliasName = true;
m_attrFuncRead = true;
m_attrFuncWrite = true;
m_attrBlocked = true;
m_attrMeasureUnit = true;
m_attrMeasureEntity = true;
m_attrForbidInput = true;
m_attrBaseClass = true;
m_attrPrecision = true;
m_attrGroup = true;
m_attrProp = true;
m_attrPerms = true;
m_objId = true;
m_objOwnerId = true;
m_objWasChanged = true;
m_objReadOnly = true;
m_objChilds = true;
m_objAttrName = true;
m_objAttrValue = true;
m_objAttrMeasureUnit = true;
m_objAttrPrecision = true;
m_objAttrOwnerId = true;
}
bool StructuresDifference::connect()
@ -47,6 +86,7 @@ vkernelLib::IVModel *StructuresDifference::loadFile(QString filename)
QString StructuresDifference::differenceAttrGroups(vkernelLib::IVModel *vModelSrc, vkernelLib::IVModel *vModelDst)
{
QString result;
m_scrtSrc = vModelSrc->vrGetLocalSecurity();
m_scrtDst = vModelDst->vrGetLocalSecurity();
for (int i= 0;i < uniRef->GlobalVars()->Logon()->ListGroupsUser()->CountGroupsUser; i++)
@ -58,9 +98,10 @@ QString StructuresDifference::differenceAttrGroups(vkernelLib::IVModel *vModelSr
if (groupIdSrc==0 || groupIdDst==0) {
result = result + "\nНе существует группа: "
+ groupName + "("
+ groupGuid + ")";
if (!m_permGroup)
result = result + "\nНе существует группа: "
+ groupName + "("
+ groupGuid + ")";
continue;
}
@ -73,6 +114,8 @@ QString StructuresDifference::differenceAttrGroups(vkernelLib::IVModel *vModelSr
QString StructuresDifference::differenceClassPerms(vkernelLib::IVClass *vClassSrc, vkernelLib::IVClass *vClassDst)
{
if (!m_classPerms) return "";
const int classPermMask = vkernelLib::SF_LCK
| vkernelLib::SF_WRT
| vkernelLib::SF_VSB
@ -111,6 +154,8 @@ QString StructuresDifference::differenceClassPerms(vkernelLib::IVClass *vClassSr
QString StructuresDifference::differenceAttrPerms(vkernelLib::IVClassValue *vAttrSrc, vkernelLib::IVClassValue *vAttrDst)
{
if (!m_attrPerms) return "";
const int smplAttrPermMask = vkernelLib::SF_WRT
| vkernelLib::SF_VSB;
@ -171,28 +216,37 @@ QString StructuresDifference::differenceObjects(vkernelLib::IVObject *vObjectSrc
return result;
}
if (vObjectSrc->vrObjStrID() != vObjectDst->vrObjStrID())
if (vObjectSrc->vrObjStrID() != vObjectDst->vrObjStrID() && m_objId)
result = result + "\n Идентификатор: "
+ from_bstr_t(vObjectSrc->vrObjStrID()) + " != "
+ from_bstr_t(vObjectDst->vrObjStrID());
if (vObjectSrc->vrOwnerID != vObjectDst->vrOwnerID)
if (vObjectSrc->vrOwnerID != vObjectDst->vrOwnerID && m_objOwnerId)
result = result + "\n Владелец: "
+ from_bstr_t(vObjectSrc->vrOwnerID) + " != "
+ from_bstr_t(vObjectDst->vrOwnerID);
if (vObjectSrc->vrWasChanged != vObjectDst->vrWasChanged)
if (vObjectSrc->vrWasChanged != vObjectDst->vrWasChanged && m_objWasChanged)
result = result + "\n Возможность изменения: изменено";
if (vObjectSrc->vrReadOnly != vObjectDst->vrReadOnly)
if (vObjectSrc->vrReadOnly != vObjectDst->vrReadOnly && m_objReadOnly)
result = result + "\n Только чтение: "
+ vObjectSrc->vrReadOnly + " != "
+ vObjectDst->vrReadOnly;
result += differenceObjectLinks(vObjectSrc, vObjectDst);
for (int i=0; i<vObjectSrc->vrAttrCount(); i++) {
vkernelLib::IVAttribute *attrSrc = vObjectSrc->vrAttrByIndex(i);
vkernelLib::IVAttribute *attrDst = vObjectDst->vrAttrByName(attrSrc->vrName);
result += differenceAttrObjects(attrSrc, attrDst);
}
if (m_objAttrName || m_objAttrValue || m_objAttrMeasureUnit
|| m_objAttrPrecision || m_objAttrOwnerId)
for (int i=0; i<vObjectSrc->vrAttrCount(); i++) {
vkernelLib::IVAttribute *attrSrc = vObjectSrc->vrAttrByIndex(i);
for (int j=0; j<vObjectDst->vrAttrCount(); j++) {
vkernelLib::IVAttribute *attrDst = vObjectDst->vrAttrByIndex(j);
if (attrSrc->vrName == attrDst->vrName) {
result += differenceAttrObjects(attrSrc, attrDst);
break;
}
if (j==vObjectDst->vrAttrCount()-1)
result = "\n Не существует атрибут: " + from_bstr_t(attrSrc->vrName);
}
}
if (!result.isEmpty())
result = "\n\nОбъект класса \""
@ -205,6 +259,8 @@ QString StructuresDifference::differenceObjects(vkernelLib::IVObject *vObjectSrc
QString StructuresDifference::differenceObjectLinks(vkernelLib::IVObject *vObjectSrc ,vkernelLib::IVObject *vObjectDst)
{
if (!m_objChilds) return "";
QString result;
vkernelLib::IVObjectVector *vObjsSrc = vObjectSrc->vrObjectsVector();
vkernelLib::IVObjectVector *vObjsDst = vObjectDst->vrObjectsVector();
@ -467,10 +523,16 @@ bool StructuresDifference::differenceIDispatchs(_variant_t varSrc, _variant_t va
vkernelLib::IVFile *iObjDst = from_vdispatch<vkernelLib::IVFile>(varDst);
if (iObjSrc && iObjDst) {
QFile fileSrc(from_bstr_t(iObjSrc->vsInternalFullName));
QFile fileDst(from_bstr_t(iObjDst->vsInternalFullName));
bool openedSrc = fileSrc.open(QIODevice::ReadOnly);
bool openedDst = fileDst.open(QIODevice::ReadOnly);
bool openedSrc = false;
bool openedDst = false;
QString filenameSrc(from_bstr_t(iObjSrc->vsInternalFullName));
QString filenameDst(from_bstr_t(iObjDst->vsInternalFullName));
QFile fileSrc(filenameSrc);
QFile fileDst(filenameDst);
if (fileSrc.exists()) openedSrc = fileSrc.open(QIODevice::ReadOnly);
if (fileDst.exists()) openedDst = fileDst.open(QIODevice::ReadOnly);
if (openedSrc) {
if (openedDst) {
while (!fileSrc.atEnd() && !fileDst.atEnd()) {
@ -498,6 +560,346 @@ bool StructuresDifference::differenceIDispatchs(_variant_t varSrc, _variant_t va
return false;
}
bool StructuresDifference::classId() const
{
return m_classId;
}
void StructuresDifference::setClassId(bool classId)
{
m_classId = classId;
}
bool StructuresDifference::classBlocked() const
{
return m_classBlocked;
}
void StructuresDifference::setClassBlocked(bool classBlocked)
{
m_classBlocked = classBlocked;
}
bool StructuresDifference::classScreenName() const
{
return m_classScreenName;
}
void StructuresDifference::setClassScreenName(bool classScreenName)
{
m_classScreenName = classScreenName;
}
bool StructuresDifference::classBaseClass() const
{
return m_classBaseClass;
}
void StructuresDifference::setClassBaseClass(bool classBaseClass)
{
m_classBaseClass = classBaseClass;
}
bool StructuresDifference::attrId() const
{
return m_attrId;
}
void StructuresDifference::setAttrId(bool attrId)
{
m_attrId = attrId;
}
bool StructuresDifference::attrDataType() const
{
return m_attrDataType;
}
void StructuresDifference::setAttrDataType(bool attrDataType)
{
m_attrDataType = attrDataType;
}
bool StructuresDifference::attrType() const
{
return m_attrType;
}
void StructuresDifference::setAttrType(bool attrType)
{
m_attrType = attrType;
}
bool StructuresDifference::attrScreenName() const
{
return m_attrScreenName;
}
void StructuresDifference::setAttrScreenName(bool attrScreenName)
{
m_attrScreenName = attrScreenName;
}
bool StructuresDifference::attrAliasName() const
{
return m_attrAliasName;
}
void StructuresDifference::setAttrAliasName(bool attrAliasName)
{
m_attrAliasName = attrAliasName;
}
bool StructuresDifference::attrFuncRead() const
{
return m_attrFuncRead;
}
void StructuresDifference::setAttrFuncRead(bool attrFuncRead)
{
m_attrFuncRead = attrFuncRead;
}
bool StructuresDifference::attrFuncWrite() const
{
return m_attrFuncWrite;
}
void StructuresDifference::setAttrFuncWrite(bool attrFuncWrite)
{
m_attrFuncWrite = attrFuncWrite;
}
bool StructuresDifference::attrBlocked() const
{
return m_attrBlocked;
}
void StructuresDifference::setAttrBlocked(bool attrBlocked)
{
m_attrBlocked = attrBlocked;
}
bool StructuresDifference::attrMeasureUnit() const
{
return m_attrMeasureUnit;
}
void StructuresDifference::setAttrMeasureUnit(bool attrMeasureUnit)
{
m_attrMeasureUnit = attrMeasureUnit;
}
bool StructuresDifference::attrMeasureEntity() const
{
return m_attrMeasureEntity;
}
void StructuresDifference::setAttrMeasureEntity(bool attrMeasureEntity)
{
m_attrMeasureEntity = attrMeasureEntity;
}
bool StructuresDifference::attrForbidInput() const
{
return m_attrForbidInput;
}
void StructuresDifference::setAttrForbidInput(bool attrForbidInput)
{
m_attrForbidInput = attrForbidInput;
}
bool StructuresDifference::attrBaseClass() const
{
return m_attrBaseClass;
}
void StructuresDifference::setAttrBaseClass(bool attrBaseClass)
{
m_attrBaseClass = attrBaseClass;
}
bool StructuresDifference::attrPrecision() const
{
return m_attrPrecision;
}
void StructuresDifference::setAttrPrecision(bool attrPrecision)
{
m_attrPrecision = attrPrecision;
}
bool StructuresDifference::attrGroup() const
{
return m_attrGroup;
}
void StructuresDifference::setAttrGroup(bool attrGroup)
{
m_attrGroup = attrGroup;
}
bool StructuresDifference::classChild() const
{
return m_classChild;
}
void StructuresDifference::setClassChild(bool classChild)
{
m_classChild = classChild;
}
bool StructuresDifference::classFilter() const
{
return m_classFilter;
}
void StructuresDifference::setClassFilter(bool classFilter)
{
m_classFilter = classFilter;
}
bool StructuresDifference::classPerms() const
{
return m_classPerms;
}
void StructuresDifference::setClassPerms(bool classPerms)
{
m_classPerms = classPerms;
}
bool StructuresDifference::attrProp() const
{
return m_attrProp;
}
void StructuresDifference::setAttrProp(bool attrProp)
{
m_attrProp = attrProp;
}
bool StructuresDifference::attrPerms() const
{
return m_attrPerms;
}
void StructuresDifference::setAttrPerms(bool attrPerms)
{
m_attrPerms = attrPerms;
}
bool StructuresDifference::permGroup() const
{
return m_permGroup;
}
void StructuresDifference::setPermGroup(bool permGroup)
{
m_permGroup = permGroup;
}
bool StructuresDifference::objId() const
{
return m_objId;
}
void StructuresDifference::setObjId(bool objId)
{
m_objId = objId;
}
bool StructuresDifference::objOwnerId() const
{
return m_objOwnerId;
}
void StructuresDifference::setObjOwnerId(bool objOwnerId)
{
m_objOwnerId = objOwnerId;
}
bool StructuresDifference::objWasChanged() const
{
return m_objWasChanged;
}
void StructuresDifference::setObjWasChanged(bool objWasChanged)
{
m_objWasChanged = objWasChanged;
}
bool StructuresDifference::objReadOnly() const
{
return m_objReadOnly;
}
void StructuresDifference::setObjReadOnly(bool objReadOnly)
{
m_objReadOnly = objReadOnly;
}
bool StructuresDifference::objAttrName() const
{
return m_objAttrName;
}
void StructuresDifference::setObjAttrName(bool objAttrName)
{
m_objAttrName = objAttrName;
}
bool StructuresDifference::objAttrValue() const
{
return m_objAttrValue;
}
void StructuresDifference::setObjAttrValue(bool objAttrValue)
{
m_objAttrValue = objAttrValue;
}
bool StructuresDifference::objAttrMeasureUnit() const
{
return m_objAttrMeasureUnit;
}
void StructuresDifference::setObjAttrMeasureUnit(bool objAttrMeasureUnit)
{
m_objAttrMeasureUnit = objAttrMeasureUnit;
}
bool StructuresDifference::objAttrPrecision() const
{
return m_objAttrPrecision;
}
void StructuresDifference::setObjAttrPrecision(bool objAttrPrecision)
{
m_objAttrPrecision = objAttrPrecision;
}
bool StructuresDifference::objAttrOwnerId() const
{
return m_objAttrOwnerId;
}
void StructuresDifference::setObjAttrOwnerId(bool objAttrOwnerID)
{
m_objAttrOwnerId = objAttrOwnerID;
}
bool StructuresDifference::objChilds() const
{
return m_objChilds;
}
void StructuresDifference::setObjChilds(bool objChilds)
{
m_objChilds = objChilds;
}
QString StructuresDifference::differenceAttrObjects(vkernelLib::IVAttribute *attrSrc,vkernelLib::IVAttribute *attrDst)
{
QString result;
@ -506,11 +908,11 @@ QString StructuresDifference::differenceAttrObjects(vkernelLib::IVAttribute *att
result = "\n Не существует атрибут: " + from_bstr_t(attrSrc->vrName);
return result;
}
if (attrSrc->vrName != attrDst->vrName)
if (attrSrc->vrName != attrDst->vrName && m_objAttrName)
result = result + "\n Наименование: "
+ from_bstr_t(attrSrc->vrName) + " != "
+ from_bstr_t(attrDst->vrName);
if (attrSrc->vrValue != attrDst->vrValue) {
if (attrSrc->vrValue != attrDst->vrValue && m_objAttrValue) {
if (attrSrc->vrValue.vt & VT_DISPATCH) {
if (differenceIDispatchs(attrSrc->vrValue,
attrDst->vrValue,
@ -523,14 +925,14 @@ QString StructuresDifference::differenceAttrObjects(vkernelLib::IVAttribute *att
+ from_variant_t(attrDst->vrValue).toString() + "\"";
}
if (attrSrc->vrMeasureUnit != attrDst->vrMeasureUnit)
if (attrSrc->vrMeasureUnit != attrDst->vrMeasureUnit && m_objAttrMeasureUnit)
result = result + "\n ЕИ: "
+ from_bstr_t(attrSrc->vrMeasureUnit) + " != "
+ from_bstr_t(attrDst->vrMeasureUnit);
if (attrSrc->vrPrecision != attrDst->vrPrecision)
if (attrSrc->vrPrecision != attrDst->vrPrecision && m_objAttrPrecision)
result = result + "\n Точность: изменена";
if (attrSrc->vrOwnerID != attrDst->vrOwnerID)
if (attrSrc->vrOwnerID != attrDst->vrOwnerID && m_objAttrOwnerId)
result = result + "\n Владелец: "
+ from_bstr_t(attrSrc->vrOwnerID) + " != "
+ from_bstr_t(attrDst->vrOwnerID);
@ -588,27 +990,27 @@ QString StructuresDifference::differenceAttrs(vkernelLib::IVClassValue *vAttrSrc
&& nameAttr.compare("afterupdate", Qt::CaseInsensitive)==0
&& nameAttr.compare("canchange", Qt::CaseInsensitive)==0
&& nameAttr.startsWith("diag_", Qt::CaseInsensitive)==0;
if (vAttrSrc->vrClassValueID != vAttrDst->vrClassValueID && sysFunc)
if (vAttrSrc->vrClassValueID != vAttrDst->vrClassValueID && sysFunc && m_attrId)
result = result + "\n Идентификатор: "
+ from_guid(vAttrSrc->vrClassValueID) + " != "
+ from_guid(vAttrDst->vrClassValueID);
if (vAttrSrc->GetvrDataType() != vAttrDst->GetvrDataType())
if (vAttrSrc->GetvrDataType() != vAttrDst->GetvrDataType() && m_attrDataType)
result = result + "\n Тип данных: "
+ from_guid(vAttrSrc->GetvrDataType()) + " != "
+ from_guid(vAttrDst->GetvrDataType());
if (vAttrSrc->vrType != vAttrDst->vrType)
if (vAttrSrc->vrType != vAttrDst->vrType && m_attrType)
result = result + "\n Тип атрибута: "
+ vAttrSrc->vrType + " != "
+ vAttrDst->vrType;
if (vAttrSrc->vrScreenName != vAttrDst->vrScreenName)
if (vAttrSrc->vrScreenName != vAttrDst->vrScreenName && m_attrScreenName)
result = result + "\n Экранное имя: "
+ from_bstr_t(vAttrSrc->vrScreenName) + " != "
+ from_bstr_t(vAttrDst->vrScreenName);
if (vAttrSrc->vrAliasName != vAttrDst->vrAliasName)
if (vAttrSrc->vrAliasName != vAttrDst->vrAliasName && m_attrAliasName)
result = result + "\n Справочники: "
+ from_bstr_t(vAttrSrc->vrAliasName) + " != "
+ from_bstr_t(vAttrDst->vrAliasName);
@ -630,7 +1032,7 @@ QString StructuresDifference::differenceAttrs(vkernelLib::IVClassValue *vAttrSrc
if (vAttrCodeDst->vrName == vAttrDst->vrFunctionCode)
break;
}
if (vAttrCodeSrc != NULL && vAttrCodeDst != NULL)
if (vAttrCodeSrc != NULL && vAttrCodeDst != NULL && m_attrFuncRead)
if (vAttrCodeSrc->vrFunctionCode != vAttrCodeDst->vrFunctionCode)
result = result + "\n Функция чтения: изменена";
@ -647,50 +1049,50 @@ QString StructuresDifference::differenceAttrs(vkernelLib::IVClassValue *vAttrSrc
break;
}
if (vAttrCodeSrc != NULL && vAttrCodeDst != NULL)
if (vAttrCodeSrc->vrCalcSetFunction != vAttrCodeDst->vrCalcSetFunction)
if (vAttrCodeSrc->vrCalcSetFunction != vAttrCodeDst->vrCalcSetFunction && m_attrFuncWrite)
result = result + "\n Функция записи: изменена";
} else {
if (vAttrSrc->vrFunctionCode != vAttrDst->vrFunctionCode) {
if (vAttrSrc->vrFunctionCode != vAttrDst->vrFunctionCode && m_attrFuncRead) {
result = result + "\n Код функции: изменён";
// result = result + "\n" +"\""+ from_bstr_t(vAttrSrc->vrFunctionCode)+"\"";
// result = result + "\n !=";
// result = result + "\n" +"\"" + from_bstr_t(vAttrDst->vrFunctionCode)+"\"";
}
if (vAttrSrc->vrCalcSetFunction != vAttrDst->vrCalcSetFunction)
if (vAttrSrc->vrCalcSetFunction != vAttrDst->vrCalcSetFunction && m_attrFuncWrite)
result = result + "\n Функция записи: изменена";
}
if (vAttrSrc->vrBlocked != vAttrDst->vrBlocked)
if (vAttrSrc->vrBlocked != vAttrDst->vrBlocked && m_attrBlocked)
result = result + "\n Блокировка: "
+ vAttrSrc->vrBlocked + " != "
+ vAttrDst->vrBlocked;
if (vAttrSrc->vrMeasureUnit != vAttrDst->vrMeasureUnit)
if (vAttrSrc->vrMeasureUnit != vAttrDst->vrMeasureUnit && m_attrMeasureUnit)
result = result + "\n ЕИ: "
+ from_bstr_t(vAttrSrc->vrMeasureUnit) + " != "
+ from_bstr_t(vAttrDst->vrMeasureUnit);
if (vAttrSrc->vrMeasureEntity != vAttrDst->vrMeasureEntity)
if (vAttrSrc->vrMeasureEntity != vAttrDst->vrMeasureEntity && m_attrMeasureEntity)
result = result + "\n ЕВ: "
+ from_bstr_t(vAttrSrc->vrMeasureEntity) + " != "
+ from_bstr_t(vAttrDst->vrMeasureEntity);
if (vAttrSrc->vrForbidInput != vAttrDst->vrForbidInput)
if (vAttrSrc->vrForbidInput != vAttrDst->vrForbidInput && m_attrForbidInput)
result = result + "\n Ввод только из списка: "
+ vAttrSrc->vrForbidInput + " != "
+ vAttrDst->vrForbidInput;
if (baseClassGuidSrc != baseClassGuidDst && sysFunc)
if (baseClassGuidSrc != baseClassGuidDst && sysFunc && m_attrBaseClass)
result = result + "\n Базовый класс: "
+ from_guid(baseClassGuidSrc) + " != "
+ from_guid(baseClassGuidDst);
if (vAttrSrc->vrPrecision != vAttrDst->vrPrecision)
if (vAttrSrc->vrPrecision != vAttrDst->vrPrecision && m_attrPrecision)
result = result + "\n Точность: изменена";
if (vAttrSrc->vrGroup != vAttrDst->vrGroup)
if (vAttrSrc->vrGroup != vAttrDst->vrGroup && m_attrGroup)
result = result + "\n Группа: "
+ from_bstr_t(vAttrSrc->vrGroup) + " != "
+ from_bstr_t(vAttrDst->vrGroup);
@ -704,6 +1106,8 @@ QString StructuresDifference::differenceAttrs(vkernelLib::IVClassValue *vAttrSrc
QString StructuresDifference::differencePropAttrs(vkernelLib::IVClassValue *vAttrSrc, vkernelLib::IVClassValue *vAttrDst)
{
if (!m_attrProp) return "";
QString result;
vkernelLib::IVProperties *vPropsSrc = vAttrSrc->vrProperties();
vkernelLib::IVProperties *vPropsDst = vAttrDst->vrProperties();
@ -731,7 +1135,7 @@ QString StructuresDifference::differenceClasses(vkernelLib::IVClass *vClassSrc,
result += this->differenceClassPerms(vClassSrc, vClassDst);
if (vClassSrc->vrClassID != vClassDst->vrClassID) {
if (vClassSrc->vrClassID != vClassDst->vrClassID && m_classId) {
result = result + "\n Идентификатор: "
+ from_guid(vClassSrc->vrClassID) + "!="
+ from_guid(vClassDst->vrClassID);
@ -742,7 +1146,7 @@ QString StructuresDifference::differenceClasses(vkernelLib::IVClass *vClassSrc,
+ vClassSrc->vrBlocked + "!="
+ vClassDst->vrBlocked;
if (vClassSrc->vrScreenName != vClassDst->vrScreenName)
if (vClassSrc->vrScreenName != vClassDst->vrScreenName && m_classScreenName)
result = result + "\n Экранноё имя: "
+ from_bstr_t(vClassSrc->vrScreenName) + "!="
+ from_bstr_t(vClassDst->vrScreenName);
@ -751,24 +1155,29 @@ QString StructuresDifference::differenceClasses(vkernelLib::IVClass *vClassSrc,
vkernelLib::IVClass *vBaseClassDst = vClassDst->vrBaseClass;
GUID baseClassGuidSrc = (vBaseClassSrc != NULL) ? vBaseClassSrc->vrClassID : GUID_NULL;
GUID baseClassGuidDst = (vBaseClassDst != NULL) ? vBaseClassDst->vrClassID : GUID_NULL;
if (baseClassGuidSrc != baseClassGuidDst)
if (baseClassGuidSrc != baseClassGuidDst && m_classBaseClass)
result = result + "\n Базовый класс: "
+ from_guid(baseClassGuidSrc) + " != "
+ from_guid(baseClassGuidDst);
result += differenceClassLinks(vClassSrc, vClassDst);
for (int j=0; j<vClassSrc->vrClassValuesCount(); j++){
vkernelLib::IVClassValue *vAttrSrc = vClassSrc->vriClassValueItem(j);
for (int k=0; k<vClassDst->vrClassValuesCount(); k++){
vkernelLib::IVClassValue *vAttrDst = vClassDst->vriClassValueItem(k);
if (vAttrSrc->vrName == vAttrDst->vrName) {
result += differenceAttrs(vAttrSrc, vAttrDst);
break;
} else if (k == vClassDst->vrClassValuesCount()-1)
result += differenceAttrs(vAttrSrc, NULL);
if (m_attrId || m_attrDataType || m_attrType || m_attrScreenName
|| m_attrAliasName || m_attrFuncRead || m_attrFuncWrite
|| m_attrBlocked || m_attrMeasureUnit || m_attrMeasureEntity
|| m_attrForbidInput || m_attrBaseClass || m_attrPrecision
|| m_attrGroup || m_attrProp || m_attrPerms)
for (int j=0; j<vClassSrc->vrClassValuesCount(); j++){
vkernelLib::IVClassValue *vAttrSrc = vClassSrc->vriClassValueItem(j);
for (int k=0; k<vClassDst->vrClassValuesCount(); k++){
vkernelLib::IVClassValue *vAttrDst = vClassDst->vriClassValueItem(k);
if (vAttrSrc->vrName == vAttrDst->vrName) {
result += differenceAttrs(vAttrSrc, vAttrDst);
break;
} else if (k == vClassDst->vrClassValuesCount()-1)
result += differenceAttrs(vAttrSrc, NULL);
}
}
}
if (!result.isEmpty())
result = "\n\nКласс: " + from_bstr_t(vClassSrc->vrName) + result;
@ -777,6 +1186,8 @@ QString StructuresDifference::differenceClasses(vkernelLib::IVClass *vClassSrc,
QString StructuresDifference::differenceClassLinks(vkernelLib::IVClass *vClassSrc, vkernelLib::IVClass *vClassDst)
{
if (!m_classChild) return "";
QString result;
for (int i=0; i < vClassSrc->vrChildsCount(); i++){
vkernelLib::IVClass *vClassChildSrc = vClassSrc->vriChildClassItem(i);
@ -812,6 +1223,9 @@ QString StructuresDifference::differenceModels(vkernelLib::IVModel *vModelSrc, v
}
QString StructuresDifference::differenceFilters (vkernelLib::IVModel *vModelSrc, vkernelLib::IVModel *vModelDst) {
if (!m_classFilter) return "";
QString result;
vkernelLib::IVClassVector *vClassVectorSrc = vModelSrc->vrGetClassVector();

View File

@ -62,6 +62,108 @@ public:
bool differenceIDispatchs(_variant_t varSrc, _variant_t varDst, GUID dataType);
bool classId() const;
void setClassId(bool classId);
bool classBlocked() const;
void setClassBlocked(bool classBlocked);
bool classScreenName() const;
void setClassScreenName(bool classScreenName);
bool classBaseClass() const;
void setClassBaseClass(bool classBaseClass);
bool attrId() const;
void setAttrId(bool attrId);
bool attrDataType() const;
void setAttrDataType(bool attrDataType);
bool attrType() const;
void setAttrType(bool attrType);
bool attrScreenName() const;
void setAttrScreenName(bool attrScreenName);
bool attrAliasName() const;
void setAttrAliasName(bool attrAliasName);
bool attrFuncRead() const;
void setAttrFuncRead(bool attrFuncRead);
bool attrFuncWrite() const;
void setAttrFuncWrite(bool attrFuncWrite);
bool attrBlocked() const;
void setAttrBlocked(bool attrBlocked);
bool attrMeasureUnit() const;
void setAttrMeasureUnit(bool attrMeasureUnit);
bool attrMeasureEntity() const;
void setAttrMeasureEntity(bool attrMeasureEntity);
bool attrForbidInput() const;
void setAttrForbidInput(bool attrForbidInput);
bool attrBaseClass() const;
void setAttrBaseClass(bool attrBaseClass);
bool attrPrecision() const;
void setAttrPrecision(bool attrPrecision);
bool attrGroup() const;
void setAttrGroup(bool attrGroup);
bool classChild() const;
void setClassChild(bool classChild);
bool classFilter() const;
void setClassFilter(bool classFilter);
bool classPerms() const;
void setClassPerms(bool classPerms);
bool attrProp() const;
void setAttrProp(bool attrProp);
bool attrPerms() const;
void setAttrPerms(bool attrPerms);
bool permGroup() const;
void setPermGroup(bool permGroup);
bool objId() const;
void setObjId(bool objId);
bool objOwnerId() const;
void setObjOwnerId(bool objOwnerId);
bool objWasChanged() const;
void setObjWasChanged(bool objWasChanged);
bool objReadOnly() const;
void setObjReadOnly(bool objReadOnly);
bool objAttrName() const;
void setObjAttrName(bool objAttrName);
bool objAttrValue() const;
void setObjAttrValue(bool objAttrValue);
bool objAttrMeasureUnit() const;
void setObjAttrMeasureUnit(bool objAttrMeasureUnit);
bool objAttrPrecision() const;
void setObjAttrPrecision(bool objAttrPrecision);
bool objAttrOwnerId() const;
void setObjAttrOwnerId(bool objAttrOwnerId);
bool objChilds() const;
void setObjChilds(bool objChilds);
private:
UniReference::IUniRefer* uniRef;
@ -71,6 +173,44 @@ private:
vkernelLib::IVLocalSecurity *m_scrtSrc;
vkernelLib::IVLocalSecurity *m_scrtDst;
bool m_classId;
bool m_classBlocked;
bool m_classScreenName;
bool m_classBaseClass;
bool m_classChild;
bool m_classFilter;
bool m_classPerms;
bool m_permGroup;
bool m_attrId;
bool m_attrDataType;
bool m_attrType;
bool m_attrScreenName;
bool m_attrAliasName;
bool m_attrFuncRead;
bool m_attrFuncWrite;
bool m_attrBlocked;
bool m_attrMeasureUnit;
bool m_attrMeasureEntity;
bool m_attrForbidInput;
bool m_attrBaseClass;
bool m_attrPrecision;
bool m_attrGroup;
bool m_attrProp;
bool m_attrPerms;
bool m_objId;
bool m_objOwnerId;
bool m_objWasChanged;
bool m_objReadOnly;
bool m_objChilds;
bool m_objAttrName;
bool m_objAttrValue;
bool m_objAttrMeasureUnit;
bool m_objAttrPrecision;
bool m_objAttrOwnerId;
};
#endif // DIFFMODEL_H