Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ArmarXGui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
ArmarXGui
Commits
6fb8538f
Commit
6fb8538f
authored
1 year ago
by
Peter Naumann
Browse files
Options
Downloads
Patches
Plain Diff
Indicate source scenario and package for linked applications
parent
d6b193a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!90
Extended support for linked scenarios
Pipeline
#15703
failed
1 year ago
Stage: build-and-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp
+43
-2
43 additions, 2 deletions
...i-plugins/ScenarioManager/gui/detailedapplicationview.cpp
with
43 additions
and
2 deletions
source/ArmarXGui/gui-plugins/ScenarioManager/gui/detailedapplicationview.cpp
+
43
−
2
View file @
6fb8538f
...
...
@@ -31,12 +31,35 @@
#include
<ArmarXCore/core/util/algorithm.h>
#include
<ArmarXCore/core/application/properties/PropertyDefinitionContainer.h>
#include
<ArmarXCore/core/application/properties/PropertyDefinitionHelpFormatter.h>
#include
<ArmarXCore/util/ScenarioManagerCommon/parser/XMLScenarioParser.h>
#include
<ArmarXCore/util/ScenarioManagerCommon/parser/PackageBuilder.h>
#define UPDATE_TIMER_INTERVAL 500
using
namespace
ScenarioManager
;
using
namespace
Data_Structure
;
// Returns {package, scenario}
std
::
pair
<
std
::
string
,
std
::
string
>
scenarioInfoFromLink
(
const
std
::
filesystem
::
path
&
linkpath
)
{
auto
instancePath
=
std
::
filesystem
::
canonical
(
linkpath
);
auto
scenarioFolder
=
instancePath
.
parent_path
().
parent_path
();
std
::
string
scenarioName
=
scenarioFolder
.
filename
();
auto
scenarioScx
=
scenarioFolder
/
(
scenarioName
+
".scx"
);
if
(
!
std
::
filesystem
::
exists
(
scenarioScx
))
{
return
{
"unknown"
,
"unknown"
};
}
auto
packageName
=
ScenarioManager
::
Parser
::
XMLScenarioParser
().
getPackageNameFromScx
(
scenarioScx
);
if
(
packageName
.
empty
())
{
return
{
"unknown"
,
scenarioName
};
}
return
{
packageName
,
scenarioName
};
}
DetailedApplicationView
::
DetailedApplicationView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
DetailedApplicationView
),
...
...
@@ -210,9 +233,27 @@ void DetailedApplicationView::showApplicationInstance(ApplicationInstancePtr app
ui
->
makeLocalButton
->
setVisible
(
readOnly
);
ui
->
addParameterButton
->
setVisible
(
!
readOnly
);
std
::
string
label
=
appInstance
->
getName
();
if
(
readOnly
)
{
auto
[
package
,
scenario
]
=
scenarioInfoFromLink
(
appInstance
->
getConfigPath
());
label
+=
" -> "
+
scenario
;
std
::
string
tooltip
;
if
(
package
==
"unknown"
)
{
tooltip
=
"Could not determine original scenario for config '"
+
std
::
string
(
std
::
filesystem
::
canonical
(
appInstance
->
getConfigPath
()))
+
"'"
;
}
else
{
tooltip
=
"Original is in "
+
(
package
==
"unknown"
?
"unknown package"
:
"package "
+
package
)
+
", scenario "
+
scenario
;
}
ui
->
dataLabel
->
setToolTip
(
QString
::
fromStdString
(
tooltip
));
}
ui
->
dataLabel
->
setText
(
QString
::
fromStdString
(
label
));
ui
->
dataLabel
->
setText
(
QString
::
fromStdString
(
appInstance
->
getName
()));
ui
->
stateLabel
->
setText
(
QString
::
fromStdString
(
appInstance
->
getStatus
()));
statusUpdateRelevant
=
true
;
lastAppInstance
=
appInstance
;
lastScenario
=
ScenarioPtr
(
nullptr
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment