Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000523Taste[All Projects] OpenGeodepublic2016-09-02 07:142023-05-14 16:50
Reportercavada@fbk.eu 
Assigned Tomaxime 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Summary0000523:

Make possible to disable SDL elements

Description

Sometimes it is useful to comment out parts in source code, i.e. do not compile them wile keeping them in the source for possible future use or other reasons.

It would be nice to have this possibility for SDL elements as well, with the possibility to select one or more elements before "disabling" them.

BTW this is needed also at system level (taste-IV), to disable functions and ports, while keeping them in the model.

TagsNo tags attached.
Attached Filesgif file icon SDL-transition option.gif [^] (10,447 bytes) 2016-09-02 09:02

- Relationships

-  Notes
(0002672)
maxime (administrator)
2016-09-02 07:49

How do you see it in practice?

SDL has the ALTERNATIVE construct, that is similar to DECISIONS - syntax wise, but used to drive the generated code (equivalent to #ifdef, to disable branches). Is that what you have in mind?

Single elements like TASKS and DECISIONs can be commented (by surrounding the content with quotes) - in which case no code is generated for them. That does not work for OUTPUTs.

(0002674)
cavada@fbk.eu (reporter)
2016-09-02 08:05

Not sure if ALTERNATIVE construct can work:
- can it be applied to any construct?
- can you provide an example?

Another approach would be to extend the parser and the generator and use some special markup comment that opengeode can recognize, to show the elements someout (e.g. grayed out), although they won't be effectively get compiled.

(0002675)
maxime (administrator)
2016-09-02 09:14

I've uploaded an image to show how alternatives look like in SDL - it's similar to DECISIONs, except that the unselected branches would not be generated in the code.

The good thing is that you can use the same condition at different places of your model and have a single place where you define the value of the constant, so that you can enable/disable branches everywhere at the same time.

Advantages:
- you define your alternative branches only once, and you have a single place where you enable/disable them
- it is standard SDL

Drawback: It pollutes a bit the graphical model and it takes a bit more time to do than just right-click->Disable

There are two other options:
- As you suggest, add an SDL extension to enable/disable elements
(this would be done via a CIF comment to remain compatible with textual SDL)

  • Use alternative as described above but with a tool option to hide the non-selected branches so that the model would look the same as now but would internally and in the .pr file use the right SDL syntax.

I will evaluate the impact of all these options, let me know if you have a strong preference.

(0003820)
maxime (administrator)
2022-12-06 09:35

Done, the alternative symbol is now supported in the editor and code generator.
There is a test case in opengeode/tests/testsuite/test-alternative


- Issue History
Date Modified Username Field Change
2016-09-02 07:14 cavada@fbk.eu New Issue
2016-09-02 07:14 cavada@fbk.eu Status

new => assigned

2016-09-02 07:14 cavada@fbk.eu Assigned To

=> maxime

2016-09-02 07:49 maxime Note Added: 0002672
2016-09-02 08:05 cavada@fbk.eu Note Added: 0002674
2016-09-02 09:02 maxime File Added: SDL-transition option.gif
2016-09-02 09:14 maxime Note Added: 0002675
2022-12-06 09:35 maxime Note Added: 0003820
2022-12-06 09:35 maxime Status

assigned => resolved

2022-12-06 09:35 maxime Resolution

open => fixed

2023-05-14 16:50 maxime Status

resolved => closed



Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker