Fix CopyAdvisorUtil.copy2 to copy IsRelatedTo-statements left out before
This implementation works so that it copies any IsRelatedTo statements
where both the subject and object have been copied during the normal
(old) copy process. The statements are marked as pending during the copy
and post-processed after everything else has been copied.
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.
Tuukka Lehtonen [Thu, 19 Mar 2020 23:45:59 +0000 (01:45 +0200)]
Improved Copy Visible Data usability in time series chart editor
The action now first opens a preference dialog with only the CSV export
preferences shown which allows the user to know what settings are being
used to copy the data before actually copying, and also cancel the copy.
The preference page also shows which options are not used if resampling
is not enabled.
Tuukka Lehtonen [Wed, 4 Mar 2020 21:43:40 +0000 (23:43 +0200)]
Fixed platform ontology sync startup failure problems after installs
Installing a new plug-in that contains multiple ontologies that depend
transitively on each other caused startup failure due to database
requests not finding the newly installed ontology that the second
installed ontology depends on.
The solution is strategic query cache flushes before and after the
installation into immutable contexts.
Tuukka Lehtonen [Sat, 29 Feb 2020 07:53:06 +0000 (09:53 +0200)]
New version of hdf.hdf5 feature required due to upgraded slf4j dep
Maven has cached hdf.hdf5 feature build in many places with version
1.10.2 which has a strict dependency on org.slf4j.api 1.7.25. SLF4j was
just upgraded to 1.7.30 meaning this feature no longer resolves properly
because Maven will use the old cached artifact. We need to bump the
feature version with a qualifier suffix `.b0001` to get maven to get the
fetch the new version.
Tuukka Lehtonen [Thu, 27 Feb 2020 11:59:15 +0000 (13:59 +0200)]
Tons of dependency fixes and updates
* Removed unused JARs from org.simantics.scenegraph and re-exported
org.apache.batik from there instead of including three old batik JARs
internally to export the batik parser.
* Replaced all dependencies on org.apache.commons.collections with
org.apache.commons.collections4
* Removed version specifiers from all org.slf4j.api and
org.eclipse.collections.eclipse-collections* dependencies
to avoid the need to modify them down the road with new major releases
* Explicitly specified all Jetty dependencies to be on version 9.4.24
in an attempt to avoid OSGi (Felix) bundle wiring performance problems
experienced by Marko in recent developments.
Tuukka Lehtonen [Sun, 23 Feb 2020 01:04:56 +0000 (03:04 +0200)]
Stop using pack200 because it has been deprecated and removed
Deprecated in Java 11 https://openjdk.java.net/jeps/336 and removed
in Java 14 https://openjdk.java.net/jeps/367.
The main problem for us now is that the packed JARs don't get
signed when using maven-jarsigner-plugin, while the unpacked
ones do. Simplest solution is to let go of pack200 already.