escet merge requestshttps://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests2024-02-06T18:59:28Zhttps://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/797#269 CIF BDD and data-based synthesis: Use collectEvents/collectAutomata from...2024-02-06T18:59:28ZDennis Hendriks#269 CIF BDD and data-based synthesis: Use collectEvents/collectAutomata from CifCollectUtils.* Best to review per commit.
* Additional change in `CifCollectUtils`: one implementation for `getComplexComponentsStream`.
Addresses #269* Best to review per commit.
* Additional change in `CifCollectUtils`: one implementation for `getComplexComponentsStream`.
Addresses #269v3.0https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/775Draft: #746 Simplistic poc for completing keywords.2024-02-07T09:33:10ZAlbert HofkampDraft: #746 Simplistic poc for completing keywords.Relates to #746
Provides a pop-up with completions for a keyword when hitting ctl-space in the CIF editor. It does not bother about minor issues like a proper CIF syntax, so merging seems like a bad idea.
It's fun though, maybe we sho...Relates to #746
Provides a pop-up with completions for a keyword when hitting ctl-space in the CIF editor. It does not bother about minor issues like a proper CIF syntax, so merging seems like a bad idea.
It's fun though, maybe we should discuss how to do this more properly.
![Screenshot_from_2024-01-26_16-25-36](/uploads/d611fa3fb5f230adc00c6fcd08d2aa9e/Screenshot_from_2024-01-26_16-25-36.png)https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/722#715 CIF code generator: Add HTML and JavaScript target language for export.2023-12-20T07:06:12ZRik Lubking#715 CIF code generator: Add HTML and JavaScript target language for export.#715 - Add export target Language HTML and JavaScript.
- Moves css into html template.
- Moved JavaScript out of html template.
- Added JavaScript/HTML export options as target languages.
- Added write method/logic for merging JavaScrip...#715 - Add export target Language HTML and JavaScript.
- Moves css into html template.
- Moved JavaScript out of html template.
- Added JavaScript/HTML export options as target languages.
- Added write method/logic for merging JavaScript into HTML export.
Addresses #715v2.0https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/716#272 CIF code generator: add SVG boilerplate code to JavaScript code generator2023-12-20T23:20:38ZRik Lubking#272 CIF code generator: add SVG boilerplate code to JavaScript code generator- Added boilerplate code for SVG implementation, remaining implementation to be added in the next merge.
Addresses #272- Added boilerplate code for SVG implementation, remaining implementation to be added in the next merge.
Addresses #272v2.0Dennis HendriksRik LubkingDennis Hendrikshttps://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/709#698 Fix CIF explorer state annotation argument value type creation2023-12-09T20:05:01ZDennis Hendriks#698 Fix CIF explorer state annotation argument value type creationCloses #698Closes #698v2.0https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/683#679 PLCgen: Add formal invoke options2023-11-13T09:36:37ZAlbert Hofkamp#679 PLCgen: Add formal invoke optionsAdds the formal invoke options.
- `FormalInvokeArg*` was actually about `FormalInvokeParam*` (the number of parameters of the function rather than the number of supplied arguments).
- `ModelTextGenerator` is now an instance taking the v...Adds the formal invoke options.
- `FormalInvokeArg*` was actually about `FormalInvokeParam*` (the number of parameters of the function rather than the number of supplied arguments).
- `ModelTextGenerator` is now an instance taking the values of the invoke option settings.
- Comparing against `cif2plc` was messy as generated output is hugely different. In the end if grabbed function-like text of the form `NAME(......`, that is an all-uppercase name and a parenthesis, and then some text behind it to get the tell-tale `:=` and then sorted on function use. See the attached output file for all combinations of the new option values. Also added the python script just in case.
text[output.txt](/uploads/97b7c300b09bfe2dd370ff4eabcc10eb/output.txt)
[find_funcs.py](/uploads/1f3e4ee30b56a2a296c766d0c1e62fc3/find_funcs.py)
- It seems complicated to get the result I'd like. Possibly the notion of "std" differs between both programs, and/or the collection of allowed forms of expressions. Also how to decide between infix / non-formal prefix / formal prefix is likely different.
- My current guess is that we need more precise options to better express the desired result. I'd like to do that not now though.
Addresses #679v2.0Albert HofkampAlbert Hofkamphttps://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/680#272 JavaScript code generation step 1: add export menu option2023-10-30T08:49:18ZRik Lubking#272 JavaScript code generation step 1: add export menu option- Added JavaScript export option to export menu.
- Added empty search/replace template (to be filled in later).
- Created empty stub methods for most implementations (to be filled in
later).
* Export feature works without problems/error...- Added JavaScript export option to export menu.
- Added empty search/replace template (to be filled in later).
- Created empty stub methods for most implementations (to be filled in
later).
* Export feature works without problems/errors, but currently only
generates an empty .html file.
For discussion, see: https://gitlab.eclipse.org/riklubking/escet/-/issues/27
Addresses #272v2.0https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/675#676 PLCgen: Postpone remaining options to after the first release2023-10-31T15:57:42ZAlbert Hofkamp#676 PLCgen: Postpone remaining options to after the first releaseDropped PlcMaxIterOption PlcFormalFuncInvokeArgOption
and PlcFormalFuncInvokeFuncOption for now.
Addresses #676Dropped PlcMaxIterOption PlcFormalFuncInvokeArgOption
and PlcFormalFuncInvokeFuncOption for now.
Addresses #676v2.0Albert HofkampAlbert Hofkamphttps://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/662#443 Add zooming to SVG viewer/visualizer2023-11-25T10:15:47ZPatrick van Berkel#443 Add zooming to SVG viewer/visualizerThis merge request implements:
1. Zooming of the SVG document by Ctrl+- and Ctrl+=.
2. ~~Panning of the SVG document by dragging the document using the mouse.~~
3. ~~Resizing of the canvas by resizing the parent window.~~
I added de de...This merge request implements:
1. Zooming of the SVG document by Ctrl+- and Ctrl+=.
2. ~~Panning of the SVG document by dragging the document using the mouse.~~
3. ~~Resizing of the canvas by resizing the parent window.~~
I added de demo video to show wat it looks like ~~(see [demo.mp4](/uploads/9c0148707ad5ade461430a93d4f86c0b/demo.mp4))~~, [demo-zoom.mp4](/uploads/32de4fd5e9b7abae5afed1108ecf4d6b/demo-zoom.mp4).
I am however having one issue. Because images are painted in memory and then passed via a queue there exists a short moment during resize in which the preprinted image does not match de size of the resized canvas. To handle this situation this implementation does not paint the image during resizing. The resulting behavior can be seen in the video ~~[issue.mp4](/uploads/3ce5d479fb67d363648918ba97c5f4ab/issue.mp4)~~, [missing-frames](/uploads/c0774a37ba666fb7582d48eef2f19830/missing-frames.mp4).
This behavior is also enabled in the Chi Visualizer als wel as the SVG viewer.
Closes #443v2.0https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/600#596 PLCgen: differentiate between reading and writing CIF variables.2023-06-05T09:48:59ZAlbert Hofkamp#596 PLCgen: differentiate between reading and writing CIF variables.A few shortcuts for simplifying PLC statement construction, and a bigger extension to the expression generator. The latter is explained in more detail below (same as in the commit message).
Reading a value should return a `PlcExpression...A few shortcuts for simplifying PLC statement construction, and a bigger extension to the expression generator. The latter is explained in more detail below (same as in the commit message).
Reading a value should return a `PlcExpression`, while writing a value should be a `PlcVarExpression`.
While the difference is small, adding a type parameter for the "value" field in the `ExprGenResult` class causes havoc throughout the expression code, due to type erasure and my desire not to have to write `ExprGenResult<PlcExpression>` everywhere so I can have a handful of `ExprGenResult<PlcVarExpression>`.
In the end I created two specializations of the `ExprGenResulr` class:
- `ExprValueResult` for results that read the expression value, and
- `ExprAddressableResult` for results that modify the expression value.
- `ExprGenResult` is now a base-class without "value" field, with two derived classes `ExprValueResult` and `ExprAddressableResult`.
The `ExpressionGenerator` external interface now has `ExprValueResult convertValue(Expression)` instead of the old `convertExpr` method and `ExprAddressableResult convertAdressable(Expression)` for the modifiable variant.
- The `ExpressionGenerator.convertAdressable(Expression)` variabnt doesn't handle the `f().field` case, but that is fine as it is not addressable in CIF either.
- `CifDataProvider` methods now has "Value" prefixes (for the existing methods) if the data is meant for reading, and additional "Addressable" variants for modifying discrete and continuous variables.
For simplicity I assumed derivative are writable, this may have to change at some point.
`DefaultVariableStorage` returns the same PLC variables for CIF variables but that is all still testing code currently.
- `ExprGeneratorTest` existing `runTest` is now `runValueTest`, and an additional `runAdddressableTest` has been added for testing writing to discrete and continuous variables.
Addresses #596v0.10Albert HofkampAlbert Hofkamphttps://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/595Draft: #520 Add algorithm by Fei et al. (2014) to compute edge dependency sets2023-05-29T14:40:45ZDennis HendriksDraft: #520 Add algorithm by Fei et al. (2014) to compute edge dependency sets* This merge quest is based on a somewhat outdated version of !587, and includes the changes of that older version of !587 as well. The relevant commits are f6612fc387e8fabd2b49fab6e7cf1319b22d3f78 and later. If we want to keep this merg...* This merge quest is based on a somewhat outdated version of !587, and includes the changes of that older version of !587 as well. The relevant commits are f6612fc387e8fabd2b49fab6e7cf1319b22d3f78 and later. If we want to keep this merge request and merge it, I'll recreate it based on the latest version, and then I'll also clean up the history. However, I propose not to ever merge it, see below.
* Getting a working solution:
* I tried to implement the algorithm from Fei et al. (2014) that I summarized [here](https://gitlab.eclipse.org/eclipse/escet/escet/-/issues/520#note_1114569).
* I found that it has [a bug](https://gitlab.eclipse.org/eclipse/escet/escet/-/issues/520#note_1140352) that I fixed, at the cost of significantly larger dependency sets, which will reduce the performance of the workset algorithm. But, correctness is more important than performance.
* The `FeiEdgeDependencySetCreator` now includes various additions compared to the orginal algorithm of Fei et al. (2014), to fix the bug, but also to account for various features of the CIF language that we support in data-based synthesis, but that were not in the EFAs as defined by Fei et al.
* This modified algorithm works for our entire regression test set, where I temporarily enabled the workset algorithm for all tests. Thus, I'm not aware of any issues in this implementation.
* But it has become complex:
* The `FeiEdgeDependencySetCreator` has 576 lines.
* Several parts of the algorithm now have long sections with comments that explain why certain modifications of the algorithm are needed. It is not exactly simple anymore.
* The order in which various concepts are considered needs to be exactly right, or things go wrong. I made mistakes several times while working on it. I can't be sure there are more issues in it.
* Getting the dependencies right, such that they work for our regression tests required quite some trial and error. I can't be sure it works for all models, only that it works for the ones in the current regression test set.
* Fundamentally, what I don't like about the algorithm is that it tries to compute when things can follow. However, as the bug showed, this is both difficult to determine statically. It requires that sufficient dependencies are found and unioned together. But how do we now that we didn't miss some dependency that only in some rare situations is needed. Guaranteeing that we don't have an under-approximation seems practically impossible.
* It seems the whole algorithm is now useless:
* The unit tests were adapted in a separate commit after the fix, to show how much the depencies increase. In fact, all unit tests now have the full/maximal dependency set.
* Similarly, for all integration tests, the dependency sets are full/maximal dependency sets.
* Thus, we could just as well use `AllEdgesEdgeDependencySetCreator`, which gives the same dependency sets, which much simpler code.
* I created a merge request for two reasons:
* I think it is good to keep this attempt archived. However, in the current state I don't propose to merge it.
* @ahofkamp is working on something similar, for the PLC code generator, in #595. It may be useful to be aware of all this, to take it into account there as well.
* I've come up with an alternative, see #602.
Addresses #520v0.10https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/562#418 PLCgen: add default initial values to the converted state variable decla...2023-04-30T07:46:58ZAlbert Hofkamp#418 PLCgen: add default initial values to the converted state variable declarations.Short patch, can be read by individual commit, which looks like the better approach for reviewing.
Addresses #418Short patch, can be read by individual commit, which looks like the better approach for reviewing.
Addresses #418v0.10Albert HofkampAlbert Hofkamphttps://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/555#567 Unable to run CIF simulation in stand-alone mode using ./bin/cifsim2023-04-23T19:11:49ZPatrick van Berkel#567 Unable to run CIF simulation in stand-alone mode using ./bin/cifsimThis pull request implements a possible solution to the braking dependency to the Eclipse Workbench environment and workspace location for stand-alone application which implement dark mode.
### Support Dark mode
To be able to run the s...This pull request implements a possible solution to the braking dependency to the Eclipse Workbench environment and workspace location for stand-alone application which implement dark mode.
### Support Dark mode
To be able to run the stand-alone application it need to be able to do this without relying on the Eclipse theming facility. This however causes some issues because the OS mode (Dark or Light) also affects the color display by SWT. This means the stand-alone application still needs to change its colors based on the OS mode. For MacOS and Linux this can be solved as SWT supports the `org.eclipse.swt.widgets.Display#isSystemDarkTheme()` method. On Windows, however, this does not work as I would expect. SWT will only show Light theme even when it detects Windows is set to Dark Mode.
In more detailed words. See [SWT OS.setTheme()](https://github.com/eclipse-platform/eclipse.platform.swt/blob/master/bundles/org.eclipse.swt/Eclipse%20SWT%20PI/win32/org/eclipse/swt/internal/win32/OS.java#L2235):
``` c
// eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
/*
* On Windows, there is no OS API for dark theme yet, and this method only
* configures various tweaks. Some of these tweaks have drawbacks. The tweaks
* are configured with defaults that fit Eclipse. Non-Eclipse applications are
* expected to configure individual tweaks instead of calling this method.
* Please see <code>Display#setData()</code> and documentation for string keys
* used there.
*/
```
One solution could be to introduce platform specific code in `EclipseThemeUtils` class.
``` java
import org.eclipse.swt.widgets.Display;
public static boolean isDarkThemeInUse() {
if (PlatformUI.getWorkbench()) {
// Running inside Eclipse UI.
IThemeEngine themeEngine = PlatformUI.getWorkbench().getService(IThemeEngine.class);
ITheme theme = themeEngine.getActiveTheme();
return theme != null && theme.getId().equals(ThemeEngine.E4_DARK_THEME_ID);
} else if (System.getProperty("os.name").contains("Windows")) {
// Running stand-alone on windows
return false;
} else {
// Running stand-alone on MacOS or Linux
return Display.isSystemDarkTheme();
}
}
```
An other solution which does not require platform specific code is to dynamically detect the mode based on the background color of the parent widget and determine if is dark or light.
This makes the code more independent from both the system mode and the Eclipse theme itself. The cost is a additional argument in all the color selection code in ESCET applications which need to able to run in stand-alone mode.
This second option in implemented in this Pull Request.
### Support running without a workspace
As described in the issue the addition of support for the Dark theme also introduced a dependency to the workspace location when running in stand-alone mode. The scripts which execute the stand-alone applications do, however not specify a workspace location.
One way to solve this is to add the -data argument to the scripts. A possible location could be the most recent workspace location used by the eclipse application, which is stored in "`{eclipse dir}./configuration/.settings/org.eclipse.ui.ide.prefs`". This file is not present after initial initialization, which means selecting a default location.
An others solution is to prevent remove the runtime dependency on this workspace location. In the current implementation the stand-alone application needs to know the workspace location to determine the theme related preference stored by Eclipse. This preference is used to detect runtime changes to the Eclipse theme. In the current implementation the stand-alone applications do not rely on the theme selected by Eclipse as it does not use it's `ThemeEngine` to apply a theme to SWT.
As such changes to this Eclipse preferences are not of interest when an ESCET application is running in stand-alone mode. This runtime dependency can be removed by disabling the subscription to the changes of this preference when workspace is not defined.
``` java
private void register() {
if (EclipseThemeUtils.isPlatformIntstanceSet()) { // preferences not available.
EclipseThemeUtils.getEclipseThemePreferences().addPreferenceChangeListener(this);
}
}
```
This second option in implemented in this Pull Request.
### Startup error for all `eventbased` stand-alone application.
While testing I found that all `cif.eventbased` applications fail when running in stand-alone mode.
```
> bin/cifsynthanalys -h
!ENTRY org.eclipse.osgi 4 0 2023-04-14 08:53:16.917
!MESSAGE Application error
!STACK 1
OSGi bundle "org.eclipse.escet.cif.eventbased.apps" not found.
```
I found-out that this is caused an invalid plugin name in the stand-alone startup scripts. These scripts currently seem to name the package (`org.eclipse.escet.cif.eventbased.apps`) instead of the plugin (`org.eclipse.escet.cif.eventbased`).
This Pull Request changed this for the following `./bin/*` scripts.
```
cifabstr, cifctrlchk, cifdfamin, ciflngeqv, cifncchk, cifnfadfa, cifobschk, cifprod, cifproj, cifsupsynth, cifsynthanalys, ciftrim, ciftrimchk
```
### Eclipse cifsynthanaly closing immediately.
Currently the Synthesis Analysis Application end immediately after the creation of the UI causing the application and UI to close.
As the UI thread `ControlEditor` does not expose the Thread is use its method called `isAvailable()` to monitor the GUI.
``` java
while (editor.isAvailable()) {
ThreadUtils.sleep(500);
}
```
# Code demonstrating issues with Dynamic retheming in SWT:
[TestDynamicChangesToSWTSettings.java](/uploads/41b756a9ff87e4e77d3241b23244ae52/TestDynamicChangesToSWTSettings.java)v0.10https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/541#480 develop to master for v0.9-RC12023-03-28T06:11:48ZDennis Hendriks#480 develop to master for v0.9-RC1Addresses #480Addresses #480v0.9https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/512#534 Fail build on files not formatted according to the ESCET formatter profile2024-01-17T10:17:01ZDennis Hendriks#534 Fail build on files not formatted according to the ESCET formatter profile- Best to review per commit.
Closes #534- Best to review per commit.
Closes #534https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/472Draft: #378 CIF data-based synthesis variable ordering and reordering in one go.2023-03-12T11:23:27ZDennis HendriksDraft: #378 CIF data-based synthesis variable ordering and reordering in one go.* The main idea is that the initial variable order and subsequent algorithms applied to it, are now one configuration, and they are applied in one go. This is a step in #378, towards also adding a new option that can create more complex ...* The main idea is that the initial variable order and subsequent algorithms applied to it, are now one configuration, and they are applied in one go. This is a step in #378, towards also adding a new option that can create more complex such configurations, but that can be applied in the same way.
* Probably easiest to review per commit, but there is some shuffling involved that in hindsight I could have maybe done in more separate commits.
* The variable ordering helper is now always created from the model order. This may change the variable order. For the test models, I checked each change manually, and found it to be different but equivalent. I'm running the benchmark models now, to see if/how it affects them. I'll post a separate comment about it. But the merge request can be reviewed already.
* Some other smaller changes, see commit messages of separate commits.
Addresses #378v0.9https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/471Testing EF issue 2178. Do not merge.2023-01-09T18:47:49ZPawel Stankiewiczpawel.stankiewicz@huawei.comTesting EF issue 2178. Do not merge.Signed-off-by: Paweł Stankiewicz <pawel.stankiewicz@huawei.com>Signed-off-by: Paweł Stankiewicz <pawel.stankiewicz@huawei.com>https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/464Draft: #454 New output for CIF checks2023-02-21T19:00:44ZDennis HendriksDraft: #454 New output for CIF checks* This merge request is not ready by any means. It serves to allow discussion on this attempt at new output.
* I had to move all CIF checks to a new plugin to prevent a cyclic dependency.
* The design for checks is much simpler, as there...* This merge request is not ready by any means. It serves to allow discussion on this attempt at new output.
* I had to move all CIF checks to a new plugin to prevent a cyclic dependency.
* The design for checks is much simpler, as there are no message classes anymore. Just (formatted) strings.
* I got rid of reporting on ancestors or named objects, requiring `PositionObject` objects with a position. It turns out not all expressions and types have a position, even after re-parsing. I haven't looked into why that is yet. Let's see what we want as output first.
* No more reporting on `null` specifications. Just supply the `Specification` object instead. Typically, this is used in `preprocessSpecification` or `postprocessSpecification`, which have that already anyway. Can use `CifScopeUtils.getSpecification` otherwise.
* For the new output, I opted to first categorize by message, and then sort per line, and then for all violations on the same line report them with the text of the line and markers.
Addresses #454v0.9https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/462Draft: #488 Search engine indexes old versions2023-01-05T11:42:52ZFerdie ReijnenDraft: #488 Search engine indexes old versionsAddresses #488.Addresses #488.https://gitlab.eclipse.org/eclipse/escet/escet/-/merge_requests/454Draft: #360 Integrate license check into the build2023-08-19T10:03:56ZDennis HendriksDraft: #360 Integrate license check into the build- Also check third party dependencies licenses during build.
- Kept the separate check, for nightly checks.
- Draft status for now, as the build produces [a lot of warnings](https://gitlab.eclipse.org/eclipse/escet/escet/-/issues/360#not...- Also check third party dependencies licenses during build.
- Kept the separate check, for nightly checks.
- Draft status for now, as the build produces [a lot of warnings](https://gitlab.eclipse.org/eclipse/escet/escet/-/issues/360#note_1058843) due to a Dash license check tool [issue](https://github.com/eclipse/dash-licenses/issues/199).
Closes #360