Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
1 parent
5485a90385
commit
881d44f4dd
512 files changed
+6887
-6426
No files matched your search
+1
-1
@@ -92,7 +92,7 @@ bool OperatorManagementDialogModel::initModel(LtsSession::LtsSession *session, c
|
||||
{
|
||||
auto cb = [this](const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType_def::PresetGroup)
|
||||
if (group.type() == GroupType::PresetGroup)
|
||||
m_roles[group.id()] = QString::fromStdString(group.name());
|
||||
};
|
||||
dtc->groups(cb);
|
||||
|
||||
+3
-3
@@ -172,9 +172,9 @@ AssetManagement::Asset InterfaceImpl::findWorkstation(const QString &wsName)
|
||||
|
||||
auto it = std::find_if(assets.constBegin(), assets.constEnd(), [wsName](const AssetManagement::Asset &as)
|
||||
{
|
||||
return ((as.assetTypeId() == AssetManagement::AssetType_def::Workstation ||
|
||||
as.assetTypeId() == AssetManagement::AssetType_def::ProjectionWorkstation ||
|
||||
as.assetTypeId() == AssetManagement::AssetType_def::MobileAfterActionVehicle)
|
||||
return ((as.assetTypeId() == AssetManagement::AssetType::Workstation ||
|
||||
as.assetTypeId() == AssetManagement::AssetType::ProjectionWorkstation ||
|
||||
as.assetTypeId() == AssetManagement::AssetType::MobileAfterActionVehicle)
|
||||
#if !defined(QUICK_DEBUG) || !defined(LTS_DEBUG)
|
||||
&& QString::fromStdString(as.name()).toUpper() == wsName.toUpper()
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -53,7 +53,7 @@ bool RemoteShutdownDialog::init(const std::shared_ptr<AssetManagement::Interface
|
||||
|
||||
asmDtc->assets([this, &asmDtc, &wsMap](const AssetManagement::Asset & data)
|
||||
{
|
||||
if (data.assetTypeId() == AssetManagement::AssetType_def::Workstation && m_thisWsId != data.id())
|
||||
if (data.assetTypeId() == AssetManagement::AssetType::Workstation && m_thisWsId != data.id())
|
||||
{
|
||||
wsMap.insert(QString::fromStdString(asmDtc->location(data.locationId()).description()),
|
||||
WorkstationModel::WorkstationInfo(data.id(), QString::fromStdString(data.name()), data.subLocation()));
|
||||
@@ -167,7 +167,7 @@ std::vector<int> RemoteShutdownDialog::parseCurrentSelection() const
|
||||
void RemoteShutdownDialog::onConfirmActionClicked()
|
||||
{
|
||||
AssetManagement::ShutdownAction shutdownAction =
|
||||
static_cast<AssetManagement::ShutdownAction_def::type>(m_ui->cbSelectAction->currentIndex());
|
||||
static_cast<AssetManagement::ShutdownAction>(m_ui->cbSelectAction->currentIndex());
|
||||
if (shutdownAction == AssetManagement::ShutdownAction::NoAction)
|
||||
{
|
||||
LtsWidgets::LtsMessageDialog::showMessage(this, tr("An Action has to be selected!"), tr("Error"));
|
||||
|
||||
+9
-9
@@ -41,7 +41,7 @@ void GroupEditDialog::init(const Group &group,
|
||||
m_ui->cbRoles->addItem(tr("---"), 0);
|
||||
auto cbGroup = [this](const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType_def::PresetGroup)
|
||||
if (group.type() == GroupType::PresetGroup)
|
||||
m_ui->cbRoles->addItem(OperatorManagement::trGroupName(group.name()), group.id());
|
||||
};
|
||||
dtc->groups(cbGroup);
|
||||
@@ -50,13 +50,13 @@ void GroupEditDialog::init(const Group &group,
|
||||
int rolePresetId = user.rolePresetId().is_set() ? user.rolePresetId().get() : m_rolePresetId;
|
||||
m_ui->cbRoles->setCurrentIndex(m_ui->cbRoles->findData(rolePresetId));
|
||||
|
||||
if (m_group.type() == GroupType_def::OperatorGroup)
|
||||
if (m_group.type() == GroupType::OperatorGroup)
|
||||
{
|
||||
m_ui->leName->setEnabled(false);
|
||||
m_ui->leDescription->setEnabled(false);
|
||||
}
|
||||
|
||||
if (m_group.type() == GroupType_def::PresetGroup && m_group.id() != 0)
|
||||
if (m_group.type() == GroupType::PresetGroup && m_group.id() != 0)
|
||||
m_ui->leName->setEnabled(false);
|
||||
|
||||
connect(m_ui->pbLoadPreset, &QPushButton::clicked, this, &GroupEditDialog::onPbPresetClicked);
|
||||
@@ -73,9 +73,9 @@ void GroupEditDialog::init(const Group &group,
|
||||
connect(m_ui->dvMemberOf, &LtsDataView::LtsDataView::customContextMenuRequested, this, &GroupEditDialog::onContextMenuRequested);
|
||||
#endif
|
||||
|
||||
if (m_group.type() == GroupType_def::PresetGroup)
|
||||
if (m_group.type() == GroupType::PresetGroup)
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Presets"));
|
||||
else if (m_group.type() == GroupType_def::OperatorGroup)
|
||||
else if (m_group.type() == GroupType::OperatorGroup)
|
||||
setOnlineHelpFilename(QStringLiteral("Administrator-Operators"));
|
||||
}
|
||||
|
||||
@@ -103,9 +103,9 @@ GroupEditDialog::~GroupEditDialog() { delete m_ui; }
|
||||
|
||||
void GroupEditDialog::retranslate()
|
||||
{
|
||||
if (m_group.type() == GroupType_def::PresetGroup)
|
||||
if (m_group.type() == GroupType::PresetGroup)
|
||||
translate(m_ui, OperatorManagement::trGroupName(m_group.name()), m_group.id() < 1, tr("Preset"));
|
||||
else if (m_group.type() == GroupType_def::OperatorGroup)
|
||||
else if (m_group.type() == GroupType::OperatorGroup)
|
||||
translate(m_ui, OperatorManagement::trGroupName(m_group.name()), m_group.id() < 1, tr("Privileges"));
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ bool GroupEditDialog::apply()
|
||||
|
||||
if (m_group.id() == 0)
|
||||
{
|
||||
if (m_group.type() == GroupType_def::OperatorGroup)
|
||||
if (m_group.type() == GroupType::OperatorGroup)
|
||||
{
|
||||
emit newGroups(memberOf, m_ui->cbRoles->currentData().toInt());
|
||||
return true;
|
||||
@@ -142,7 +142,7 @@ bool GroupEditDialog::apply()
|
||||
{
|
||||
const std::string name = m_ui->leName->text().toStdString();
|
||||
const std::string description = m_ui->leDescription->text().toStdString();
|
||||
GroupCreateRequest req(name, description, GroupType_def::PresetGroup, false, memberOf);
|
||||
GroupCreateRequest req(name, description, GroupType::PresetGroup, false, memberOf);
|
||||
m_requestHelper->addRequest([this, req]() { return m_ftc->groupCreateRequest(req, this); });
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -50,7 +50,7 @@ QDataStream &operator>>(QDataStream &ds, Group &gp)
|
||||
gp.description(description.toStdString());
|
||||
LtsUtils::convert(aclAllow, gp.aclAllow());
|
||||
LtsUtils::convert(aclDeny, gp.aclDeny());
|
||||
gp.type(static_cast<GroupType::inner_enum>(type));
|
||||
gp.type(static_cast<GroupType>(type));
|
||||
gp.isDeleted(isDeleted);
|
||||
gp.isHidden(isHidden);
|
||||
LtsUtils::convert(isMemberOf, gp.isMemberOf());
|
||||
@@ -215,7 +215,7 @@ MembershipModel::MembershipModel(QObject *parent,
|
||||
|
||||
auto cbGroup = [this, disabledFunctionality](const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType_def::StandardGroup)
|
||||
if (group.type() == GroupType::StandardGroup)
|
||||
{
|
||||
if (disabledFunctionality.contains(group.id()) || group.isHidden())
|
||||
return;
|
||||
@@ -232,7 +232,7 @@ MembershipModel::MembershipModel(QObject *parent,
|
||||
const std::vector<int32_t> isMemberOf = opGroupItem->data().value<Group>().isMemberOf();
|
||||
auto cbGroup2 = [this, &isMemberOf, opGroupItem] (const Group &group)
|
||||
{
|
||||
if (group.type() == GroupType_def::AclGroup && contains(isMemberOf, group.id()))
|
||||
if (group.type() == GroupType::AclGroup && contains(isMemberOf, group.id()))
|
||||
opGroupItem->appendChild(createItem(QVariant::fromValue(group), QIcon()));
|
||||
};
|
||||
dtc->groups(cbGroup2);
|
||||
@@ -261,7 +261,7 @@ QVariant MembershipModel::data(const QModelIndex &index, int role) const
|
||||
if (role == Qt::CheckStateRole)
|
||||
{
|
||||
Group group = getGroupData(index);
|
||||
if (!m_bRowsAreCheckable || index.column() != 0 || group.type() != GroupType_def::StandardGroup)
|
||||
if (!m_bRowsAreCheckable || index.column() != 0 || group.type() != GroupType::StandardGroup)
|
||||
return NGLTreeModel::data(index, role);
|
||||
|
||||
return item->bIsChecked ? Qt::Checked : Qt::Unchecked;
|
||||
@@ -314,7 +314,7 @@ Qt::ItemFlags MembershipModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
Group group = getGroupData(index);
|
||||
auto ret = NGLTreeModel::flags(index);
|
||||
if (m_bRowsAreCheckable && index.column() == 0 && group.type() == GroupType_def::StandardGroup)
|
||||
if (m_bRowsAreCheckable && index.column() == 0 && group.type() == GroupType::StandardGroup)
|
||||
ret |= Qt::ItemIsUserCheckable;
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ bool GroupModel::initModel(const std::shared_ptr<Interface::Dtc> &dtc,
|
||||
connect(m_dtc.get(), &OperatorManagement::Interface::Dtc::groupChanged,
|
||||
this, &GroupModel::onDataChanged);
|
||||
m_dtc->groups([this](const OperatorManagement::Group &group) {
|
||||
if (group.type() == GroupType_def::PresetGroup)
|
||||
if (group.type() == GroupType::PresetGroup)
|
||||
insertRow(group);
|
||||
});
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ void OperatorEditDialog::showACLs()
|
||||
grp.id(0);
|
||||
grp.name(m_ui->leOperator->text().toStdString());
|
||||
grp.description(m_ui->leInfo->text().toStdString());
|
||||
grp.type(GroupType_def::OperatorGroup);
|
||||
grp.type(GroupType::OperatorGroup);
|
||||
grp.isMemberOf(m_groups);
|
||||
connect(dlg, &GroupEditDialog::newGroups, this, &OperatorEditDialog::onNewGroups);
|
||||
dlg->init(grp, m_dtc, m_ftc);
|
||||
|
||||
+2
-2
@@ -76,7 +76,7 @@ void PresetDialog::enaDisa()
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, cntSelectedRows == 1 );
|
||||
|
||||
bool deletable = cntSelectedRows > 0 &&
|
||||
(m_model->getRowData(selectedRows.at(0).row()).type() == GroupType_def::PresetGroup);
|
||||
(m_model->getRowData(selectedRows.at(0).row()).type() == GroupType::PresetGroup);
|
||||
|
||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, deletable );
|
||||
}
|
||||
@@ -95,7 +95,7 @@ void PresetDialog::onAddGroup()
|
||||
{
|
||||
GroupEditDialog *dialog = new GroupEditDialog(this);
|
||||
Group grp;
|
||||
grp.type(GroupType_def::PresetGroup);
|
||||
grp.type(GroupType::PresetGroup);
|
||||
dialog->init(grp, m_dtc, m_ftc);
|
||||
|
||||
addDialog(dialog, m_menuGroup, QLatin1String("NewPreset"), LtsWidgets::LayoutArea::eDialogTab);
|
||||
|
||||
Reference in new issue
Block a user