Skip to content

Commit

Permalink
Adapt to updated OMS API
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Apr 18, 2018
1 parent 1fae0b2 commit ff9e939
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Component/Component.cpp
Expand Up @@ -1655,7 +1655,7 @@ void Component::drawInterfacePoints()
void Component::drawOMSElementConnectors()
{
if (mpLibraryTreeItem->getOMSElement()) {
oms_connector_t** pInterfaces = mpLibraryTreeItem->getOMSElement()->interfaces;
oms_connector_t** pInterfaces = mpLibraryTreeItem->getOMSElement()->connectors;
ComponentInfo *pComponentInfo = 0;
QString name;
for (int i = 0 ; pInterfaces[i] ; i++) {
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Component/FMUProperties.cpp
Expand Up @@ -139,7 +139,7 @@ FMUPropertiesDialog::FMUPropertiesDialog(Component *pComponent, QWidget *pParent
mParameterLineEdits.clear();
int index = 0;
if (mpComponent->getLibraryTreeItem()->getOMSElement()) {
oms_connector_t** pInterfaces = mpComponent->getLibraryTreeItem()->getOMSElement()->interfaces;
oms_connector_t** pInterfaces = mpComponent->getLibraryTreeItem()->getOMSElement()->connectors;
for (int i = 0 ; pInterfaces[i] ; i++) {
if (pInterfaces[i]->causality == oms_causality_parameter) {
index++;
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Modeling/Commands.cpp
Expand Up @@ -1811,7 +1811,7 @@ void FMUPropertiesCommand::redo()
// Parameters
int index = 0;
if (mpComponent->getLibraryTreeItem()->getOMSElement()) {
oms_connector_t** pInterfaces = mpComponent->getLibraryTreeItem()->getOMSElement()->interfaces;
oms_connector_t** pInterfaces = mpComponent->getLibraryTreeItem()->getOMSElement()->connectors;
for (int i = 0 ; pInterfaces[i] ; i++) {
if (pInterfaces[i]->causality == oms_causality_parameter) {
QString parameterValue = mNewFMUProperties.mParameterValues.at(index);
Expand Down Expand Up @@ -1850,7 +1850,7 @@ void FMUPropertiesCommand::undo()
// Parameters
int index = 0;
if (mpComponent->getLibraryTreeItem()->getOMSElement()) {
oms_connector_t** pInterfaces = mpComponent->getLibraryTreeItem()->getOMSElement()->interfaces;
oms_connector_t** pInterfaces = mpComponent->getLibraryTreeItem()->getOMSElement()->connectors;
for (int i = 0 ; pInterfaces[i] ; i++) {
if (pInterfaces[i]->causality == oms_causality_parameter) {
QString parameterValue = mOldFMUProperties.mParameterValues.at(index);
Expand Down
6 changes: 4 additions & 2 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -2473,8 +2473,8 @@ void LibraryTreeModel::createLibraryTreeItems(LibraryTreeItem *pLibraryTreeItem)
QString("%1.%2").arg(pLibraryTreeItem->getNameStructure())
.arg(name), "", pLibraryTreeItem->isSaved(),
pLibraryTreeItem);
for (int j = 0 ; pElements[i]->interfaces[j] ; j++) {
QString name = StringHandler::getLastWordAfterDot(pElements[i]->interfaces[j]->name);
for (int j = 0 ; pElements[i]->connectors[j] ; j++) {
QString name = StringHandler::getLastWordAfterDot(pElements[i]->connectors[j]->name);
name = name.split(':', QString::SkipEmptyParts).last();
createLibraryTreeItemImpl(LibraryTreeItem::OMS, name,
QString("%1.%2").arg(pComponentLibraryTreeItem->getNameStructure()).arg(name),
Expand Down Expand Up @@ -2955,10 +2955,12 @@ void LibraryTreeView::createActions()
// simulate OMSimulator model action
mpSimulateOMSModelAction = new QAction(QIcon(":/Resources/icons/tlm-simulate.svg"), Helper::simulate, this);
mpSimulateOMSModelAction->setStatusTip(Helper::simulateOMSModelTip);
mpSimulateOMSModelAction->setEnabled(false);
connect(mpSimulateOMSModelAction, SIGNAL(triggered(bool)), SLOT(simulateOMSModel()));
// rename OMSimulator model Action
mpRenameOMSModelAction = new QAction(Helper::rename, this);
mpRenameOMSModelAction->setStatusTip(Helper::renameOMSModelTip);
mpRenameOMSModelAction->setEnabled(false);
connect(mpRenameOMSModelAction, SIGNAL(triggered()), SLOT(renameOMSModel()));
// unload OMSimulator model Action
mpUnloadOMSModelAction = new QAction(QIcon(":/Resources/icons/delete.svg"), Helper::unloadClass, this);
Expand Down

0 comments on commit ff9e939

Please sign in to comment.