TASTE bugtrack - Taste
View Issue Details
0000523Taste[All Projects] OpenGeodepublic2016-09-02 07:142023-05-14 16:50
cavada@fbk.eu 
maxime 
normalfeaturehave not tried
closedfixed 
0000523: Make possible to disable SDL elements
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.
No tags attached.
gif SDL-transition option.gif (10,447) 2016-09-02 09:02
https://taste.tuxfamily.org/mantis/file_download.php?file_id=231&type=bug
gif
Issue History
2016-09-02 07:14cavada@fbk.euNew Issue
2016-09-02 07:14cavada@fbk.euStatusnew => assigned
2016-09-02 07:14cavada@fbk.euAssigned To => maxime
2016-09-02 07:49maximeNote Added: 0002672
2016-09-02 08:05cavada@fbk.euNote Added: 0002674
2016-09-02 09:02maximeFile Added: SDL-transition option.gif
2016-09-02 09:14maximeNote Added: 0002675
2022-12-06 09:35maximeNote Added: 0003820
2022-12-06 09:35maximeStatusassigned => resolved
2022-12-06 09:35maximeResolutionopen => fixed
2023-05-14 16:50maximeStatusresolved => closed

Notes
(0002672)
maxime   
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   
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   
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   
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