Marko Luukkainen [Fri, 16 Oct 2020 13:22:10 +0000 (16:22 +0300)]
Allow OpenWithMenuContribution to filter out currently active editor.
Using o.s.ui.contribution.OpenWithMenuContribution:activeEditorId in
dynamic menuContrubution class reference activates active editor
filtering. Existing OpenWith menu contributions are not affected.
Several editor adapters now return null as editorId, thus they cannot be
filtered. This should dot be a problem, since the editors most likely do
not use OpenWith menu.
Tuukka Lehtonen [Fri, 21 Aug 2020 13:06:50 +0000 (16:06 +0300)]
Fixed route graph splitting and diagram mapping race condition problem
RouteGraphConnectionSplitter.doSplit now always splits the connection so
that part #1 is always the part that stays with the existing diagram
connection and part #2 contains the entities that are moved to the newly
created route graph connection resource. Part #1 is the part where the
"output terminal" attached to the connection lies. This simplifies and
clarifies the implementation of doSplit and does not require moving
diagram mapping statements around.
Also, more importantly RouteGraphConnectionSplitter and FlagUtil changes
ensure that diagram mapping is *not* executed in FlagUtil.join, which
was the main cause of the previous corruption. Diagram mapping is only
activated once for the affected diagram(s) after everything else is
done.
Tuukka Lehtonen [Fri, 21 Aug 2020 12:29:39 +0000 (15:29 +0300)]
Fix NPE from flagTransform
The bug affected loading of route graph connections about to be split in
half when attached to diagram flags at either or both ends.
The NPE caused the flag terminal position to receive identity transform
as value which is plain wrong. This in turn resulted in the splitting
position being completely wrong compared to what the user requested and
the result looking very strange.
This fixes the immediate problem but still doesn't work properly if the
flag is actually attached to a diagram template flag table. In this case
the terminal's position will be incorrectly calculated since
runtimeDiagram is null. This needs another issue.
Tuukka Lehtonen [Fri, 14 Aug 2020 08:37:58 +0000 (11:37 +0300)]
Listen to changes in page settings in DiagramSceneGraphProvider
This is needed for use cases where diagrams are transformed to SVG and
viewed through browsers.
These changes also fix PDF printing to force page border rendering off
when not fitting PDF pages to diagram content, but to diagram page size.
This avoids printing ugly black half-visible borders around diagrams
where page borders are enabled.
Tuukka Lehtonen [Wed, 17 Jun 2020 09:22:52 +0000 (12:22 +0300)]
Synchronization can now read children for multi-instantiated composites
org.simantics.structural2.Functions.structuralChildDomainChildren
getVariables implementation still relied on getPossibleType(ReadGraph),
which returns null for multi-instances. The previous similar flaw was
fixed in #259.
Tuukka Lehtonen [Thu, 4 Jun 2020 22:33:16 +0000 (01:33 +0300)]
Avoid useless reallocation of empty TreeMaps and map iterators
The problem was that when the database is doing work, MainProgram.run
runs in pretty much busy loop mode and previously it was always
allocating a new TreeMap on each round and also calling Map.entrySet()
to get construct iterators for empty TreeMaps which eventually
accumulates up to somewhat signinificant amount of memory allocated.
Possibly an even more efficient way would be to have the Map be a closed
hashing hashmap instead and then sorting the data for iteration
separately.
Tuukka Lehtonen [Wed, 3 Jun 2020 09:40:35 +0000 (12:40 +0300)]
Changed SCLTypeUtils to not log warnings for non-property relations
For example procedural UCs and their substructure requests would report
tons of these all the time, which is worthless.
Also added an SCL type for MOD.ChangeInformation to avoid having to see
warnings about the SCL type of MOD.ChangeInformation not being
available:
```
WARN [...] org.simantics.modeling.SCLTypeUtils: SCLTypeUtils.getType
cannot transform data type '{
createdBy : String,
createdAt : Long,
modifiedBy : String,
modifiedAt : Long
}' to type. Returns a as default.
```
Tuukka Lehtonen [Mon, 1 Jun 2020 05:47:33 +0000 (08:47 +0300)]
Added identity-providing constructor for IconButtonStyleBase
This is needed to support proper implementation of styles inheriting
IconButtonStyleBase. Otherwise query identities of the mentioned class
fall back to getClass which does not work in general.
Tuukka Lehtonen [Thu, 28 May 2020 19:15:22 +0000 (22:15 +0300)]
Added system property for controlling writing of MOD.changed tags
You can set -Dorg.simantics.modeling.writeChangedTags=false to disable
writing of MOD.changed tags. The property can be set dynamically at
runtime also.
Tuukka Lehtonen [Thu, 7 May 2020 20:29:12 +0000 (23:29 +0300)]
Replace scheduleAtFixedRate with scheduleWithFixedDelay
ScheduledExecutorService.scheduleAtFixedRate tends to run enormous
amounts of runnables that would have been scheduled during a machine is
in sleep, after the machines wakes up from sleep, retroactively.
This is not good and can be avoided by using scheduleWithFixedDelay
which is usually good enough regarding the delay between executions.
Fixed CSVFormatter mind floating point inaccuracy when resampling
These changes prevent the resampling export mode from dropping samples
that have timestamps closer than 1e-13 sec to the last exported sample
time stamp.
Fixed subscription item data file searching to use groupItemId as well
This fixes problems where subscription item data CSV export used the
wrong data files to read the data related to the subscription item
because it wasn't matching the data file based on both groupItemId
(subscription item GUID name) and variable ID, which can be overlapping
if a new subscription item is created for a variable that has had a
previous subscription.
This allows e.g. procedural user component substructure expressions to
use SCL functionality included by the user component's local SCL modules
instead of only having to rely on functionality included by the SCLMain
at the containing index root.
Tuukka Lehtonen [Mon, 30 Mar 2020 22:13:59 +0000 (01:13 +0300)]
Fixed InvertBasicExpressionVisitor bugs with subtractions and divisions
Minus expressions and divisions were both computed the wrong way around,
i.e. a-b as b-a and a/b as b/a.
Consolidated duplicate InvertBasicExpressionVisitor code into single
base class.
Also noticed that the basicexpression parser doesn't parse e.g. `a*5/4`
but parses `a*5 / 4` just fine. Didn't dive into these parser problems
for now. Hopefully we can retire this code entirely at some point in
favor of SCL expressions.
Tuukka Lehtonen [Tue, 17 Mar 2020 15:04:43 +0000 (17:04 +0200)]
Added more literal type resolution logic to claimLiteral
If the Class of the value doesn't tell which layer0-builtin type
resource to use, try to use the Datatype provided by the binding to
resolve the builtin type resource. If that fails also, resort to the the
old fallback behavior.