Select ONLY the first level of components in the system and nor also the sub-componets - m2doc

in my Capella project I would like to select only the first level of the components of my System and not all the sub components.
I try this:
self.eAllContents (la::LogicalComponent).eContents (la::LogicalComponent)
But it select before the the first level of the components of my system but then select also all the sub-systems of the components of first level and I don't want this.
How can I do?
Thank you so much

You probably want to use a more specific expression in this case:
selection.ownedArchitectures->filter(la::LogicalArchitecture).ownedLogicalComponentPkg.ownedLogicalComponents
This will list all LogicalComponent in the root LogicalComponentPkg.

Related

how to access image property list and manipulate in MITK

I am developing a plugin for MITK, which is a tookit for medical imaging. I want to access the full path of image that is loaded in the data manager.
There are properties of images like name, opacity, path etc.
I searched MITK documentation but I could not find any proper information related to that.
Can you please help me?
If you want to see the 'path' in the UI, you can use the Properties plugin, available in the MITK Workbench and in your own app if you decided to include it.
If you want to access the content of the 'path' property in the code, then you need a mitk::DataNode in the current scope, because properties are usually related to node.
std::string path;
node->GetStringProperty("path", path);
Note that this won't give you the full path though. For some reason, MITK decided to remove the extension in this property, thus giving something like D://Data/brain instead of the D://Data/brain.nii.gz that I wanted.
AFAIK, there's currently no 100% safe way to get the real full path in MITK, but one could easily search on the file system using path + ".*" and hoping that it returns only one result :)
The property is not on the DataNode but in the BaseData in it. There is a 'path' property there. You can see its value when right-click the image and selecting 'details'

SVG Font Inkscape two not connected path as one glyph

Can anyone tell me, why I can't use not connected paths as one glyph? e.g. I selected 2 stars and wanted to make them as one glyphe, but Inkscape just use the first selected one.
Maybe you are looking for the combine operation (CTRL-K) which will make a single path out of two. Should do what you expect if they are not overlapping, else try the path union (CTRL-+)

Path shortener with MFC

I need to display paths in the context menu in my app and need to find a way to shorted them. For instance, what Microsoft apps do in their "Recently Used" list, if the original path is c:\ClientName\ProjectName\ProgramName\ComponentName\SomeFileName.cpp I need it to be converted into something like c:\ClientName\...\SomeFileName.cpp.
So I'm curious if there's any built-in means to do this with C++/MFC or maybe a WinAPI?
Use PathCompacPathEx that will truncate a path by replacing path components with ellipses.
There is Win32 API to get short path name called GetShortPathName, read below. It may help.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364989(v=vs.85).aspx

What would be the SQL script to generate Sitecore Broken Link Report

I'm helping our Editors to clean up broken links and have been looking for answers to the following:
The Broken Link Report cannot be exported or sorted so it's not very useful (we have many broken links ~2000). Is there a SQL script that I can run to create the same report?
If an Editor fix a link, Rerun the report doesn't seem to take the item off the report. Does she have to Rebuild Link Database every time?
The Links button in the menu is helpful, but it is listing All Versions of referrers. Is there a SQL script to find only the lastest version?
When delete or archive an item and let Sitecore remove broke links, will all the affected items be published?
We are dealing with a large report (~2000 items) due to not maintaining it diligently. The goal is to reduce the number to 100~200 and keep it under control from now on. Any general advice on how to clean up broken links report is appreciated.
For your first (and partly third) questions:
In the Core database you can check what gets executed on the click of the Broken Link Report (the item that defines it is located in : /sitecore/content/Documents and settings/All users/Start menu/Right/Reporting Tools/Scan for Broken Links.
The application that gets started is /Applications/Tools/Broken Links.aspx, so if we look at *webroot*/sitecore/shell/Applications/Tools/Broken Links/Broken links.xml, we can see that the code used for it is Sitecore.Shell.Applications.Tools.BrokenLinks.BrokenLinksForm in the Sitecore.Client assembly.
Using Reflector you can see what it's executing. For your requirements, what I would say would be the easiest is to create your own version of the BrokenLinksForm, possibly simply adding an export functionality on it, or modify the code so it only takes the latest version. From looking at it very quickly I think the code to change (which is actually in the nested Scanner class) is:
...
foreach (ItemLink link in Globals.LinkDatabase.GetBrokenLinks(database))
{
list.Add(link);
}
...
You could possibly check whether the link item is the latest version, possibly by using something like
...
var version = link.GetSourceItem();
if (version.Versions.GetLatestVersion().Version == link.SourceItemVersion)
{
list.Add(link);
}
...
While you're at it you could of course also put in some sorting functionality :-)
It doesn't translate 1-on-1 with the Links button in the menu, but it should give you some pointers in the right direction.
As to your 2nd question: I believe that yes, the Link database does need to be rebuilt. I don't know if Sitecore has a schedule set up by default, but you could create your own agent in the <scheduling> node in the web.config to do this after X time.
Your last question: If you delete or archive an item and have Sitecore remove the broken links the affected items will, by default, not be published. If you have an auto-publish set up it'll show up of course.

Find member variable using Locator in Qt Creator

Qt Creator has the Locator box, which allows you to easily find classes, methods, etc. Is there a way to use it to find class member variables, as well?
Using . <expr> will show member variables too, but that is only for searching inside the current file, not globally.
This the Locator:
By default, there is not such feature, but as said in the doc you can create a filter (I can't test it now, but I'll try this soon):
To create a locator filter:
In the locator, select Options > Configure to open the Locator options.
In the Filter Configuration dialog:
Name your filter.
Select at least one directory. The locator searches directories recursively.
Define the file pattern as a comma separated list. For example, to search all .h and .cpp files, enter *.h, *.cpp
Specify the prefix string.
To show only results matching this filter, select Limit to prefix.
Click OK.
QtCreator have no such feature - member variables are not good candidates for pivot points in search. If you want find usages of particular member, use "find symbol usages" (Ctrl+Shift+U when cursor is under symbol). If you want to find members of particular type, use usual search in regular expressions mode, something like:
\w+\s*\*\s*\w+\s*;
And limit scope to headers only (i.e use "*.h" file mask).
Have you tried using the 'Advanced...' option in the locator? You can change the scope of the search to the Current Project, All Projects, Files on the System, etc. I use this to even search for strings I use for debug output in my code.