osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Configuration flag for deactivating an annex #2288

Closed jjhugues closed 3 years ago

jjhugues commented 4 years ago

In some cases, one may want to deactivate an annex from the regular parsing phase. For instance apply analyses that do not depend on them

One may imagine a configuration parameter for that, that would simply deactivate the corresponding registered parser

An open question could be: how about analysis? We could have a warning if EMV2 is disabled when trying to run FHA or FTA

lwrage commented 3 years ago

We need the following:

asazonova commented 3 years ago

@jjhugues did you intend the flag to be project specific (project A can use annex B, but project C can NOT use annex B) or is the flag should be applied to all projects (if annex B flag is unchecked, then it can NOT be used in project A and project C)

asazonova commented 3 years ago

@AaronGreenhouse Do you know if it is possible to access preferences from stand alone java programs (jar files) that you can run from command line to process aadl file?

yoogx commented 3 years ago

The flag should be project specific

AaronGreenhouse commented 3 years ago

@asazonova I don't know for sure, but I think it would probably work. The core Workspace preference and project properties data structures are not UI-specific.

asazonova commented 3 years ago

@lwrage

for workspace preference, we use final IPreferenceStore store = OsateCorePlugin.getDefault().getPreferenceStore(); for project preference, we use final IScopeContext context = new ProjectScope(project); final Preferences prefs = context.getNode(PREFS_QUALIFIER);

This Preferences prefs object does not have a method to set a default value. However, unlike workspace preference, for projects we set the preference explicitly with prefs.putBoolean(annexExtensionId.toLowerCase(), value); - see implementation below: @Override public void putBoolean(String key, boolean value) { wrapped.putBoolean(key, value); }

this one does not have a check if oldValue == newValue, which is good for us, it will just set the preference to false without ignoring it

Conclusion,

asazonova commented 3 years ago

Add screenshots and explanation how to use this feature to Advanced section of help (org.osate.help)

lwrage commented 3 years ago