Better fix for ClusterTable maps going out of sync
ClusterSmall.toBig was not copying importance over to the constructed
ClusterBig causing importanceMap to go out of sync on the first call to
ClusterSmall.toBig.
Fixed ClusterTable cluster hash/importance map book-keeping problem
The main problem was that importance values should have been started
from 1 and 0 is considered an invalid importance value. This prevents
ClusterTable.replaceCluster from making mistakes in importanceMap.
Hannu Niemistö [Tue, 10 Apr 2018 12:24:20 +0000 (15:24 +0300)]
Fixes the dpi value in SVGSalamander to 96
If SVG file defining symbol graphics does not contain unit information,
it is converted from points to pixels using a dpi-value. The value is 96
in most cases but in some machines differs from this default. This makes
the symbol graphics scaled compared to originally drawn graphics which
is undesirable.
Fixing problems in the database unit testing environment with Acorn
* Removed static map from org.simantics.acorn.FileIO.
Moved the map into a session service as org.simantics.acorn.FileCache
* Changed org.simantics.db.testing.common.Tests utilities to use Acorn
instead of ProCore (AcornTestHandler). Did not introduce abstraction
for this for now.
Finalizing improve startup time for fresh or rollback'd session
Finally fixed the long-sought InputStream reading bug from
TransferableGraphFileReader.InputChannel.read(ByteBuffer).
The ByteFileReader implementation expected the provided
ReadableByteChannel to always provide a full buffer of data unless EOF
was encountered and the InputChannel.read implementation was not taking
care of that.
Also added simpler utilities for reading TG's from files/InputStreams
directly using static TransferableGraphFileReader.read(File/InputStream)
methods.
PlatformUtil.readTG can now finally use TransferableGraphFileReader for
maximal performance.
Hannu Niemistö [Thu, 5 Apr 2018 10:28:31 +0000 (13:28 +0300)]
Show imports of nonexistent modules as errors
Previously there was a separate error category IMPORT_ERROR for all
import errors that was sorted with WARNINGS. Now IMPORT_ERROR category
is also used for import failures whose reason is compilation problem in
the upstream module (although this is fatal for compilation, the problem
is not located in the current module).
Support diagram profile activity store/restore in model export/import
Diagram profile selections are stored in the "profiles" workspace
persistent virtual graph. They cannot be done in the persistent database
because we do not want the profile selections to be part of the database
version/undo history. This just doesn't fit the current way of using
diagram profiles.
The code introduced in this commit needs to be put to use in
product-specific custom export/import logic and copy/paste handlers to
take advantage of it.
Tuukka Lehtonen [Mon, 26 Mar 2018 15:36:02 +0000 (18:36 +0300)]
Improved network-drive-resilience in index directory creation
In a product, the removed Files.exists(p) && !Files.isDirectory(p) code
threw an exception because the examined path was not guaranteed to be in
a coherent state at the time of examination but Files.createDirectories
would still take care of throwing any exceptions if there were any
problems in creating the directory.
The worst thing was that this exception was hidden and not even logged.
Luckily a problem case forced the find.
Tuukka Lehtonen [Mon, 26 Mar 2018 08:29:34 +0000 (11:29 +0300)]
Only claim new identifier if instance L0.TypeWithIdentifier
Fixed long-standing bug from CopyComponentAdvisor which added
identifiers for non-STR.Component instances which has started causing
problems in team server products in version comparisons.
Tuukka Lehtonen [Fri, 23 Mar 2018 14:06:36 +0000 (16:06 +0200)]
Improved usability of shared library export wizard
Now allows selection of the exported shared library from the combo box
and does not allow the user to export any model-browser-selected
resource but only shared ontologies.
"show" is able to type cast a ByteArray without the additional
specification in Prelude.scl. Show is unable to be used on ByteArrays if
Prelude.scl contains an implementation for it, as "show" cannot
determine which implementation to use: the general, or the ByteArray
specific. Thus, ByteArray has been removed from Prelude.
getTuples returns a list of tuples that can be of any format: they do
not necessarily have to all be the same. As a result, [a] specification
doesn't correctly reflect the data that can be fetched with getTuples,
but [Dynamic] does.
Antti Villberg [Fri, 16 Mar 2018 14:55:52 +0000 (16:55 +0200)]
Fixed various bugs in TG readers
Added primary install-location based relative path resolution to
database baselining logic. Secondary relative baseline resolution logic
still uses working directory.
Tuukka Lehtonen [Tue, 13 Mar 2018 09:08:40 +0000 (11:08 +0200)]
Added graph.tg hash caching to FixExportedOntology
Moved generic database baselining code to DatabaseBaselines from
SimanticsPlatform and added new utility functions to DataContainers and
cleaned up existing methods therein using resource-try statements.
Also note org.simantics.graph.refactoring.TransferableGraphHasher that
can be used for adding hash values to graph.tg files.
Tuukka Lehtonen [Mon, 12 Mar 2018 20:15:14 +0000 (22:15 +0200)]
Fixed platform startup ontology update hash checking to work
There was a typo in the Extensions class constant that identified cached
hash value in the DataContainer metadata map compared to the maven graph
builder plug-in.
Tuukka Lehtonen [Fri, 9 Mar 2018 21:41:15 +0000 (23:41 +0200)]
Platform startup performance improvements
1. DB baselining can now be enabled with ontology update checking due to
caching of TG hash values in the DataContainer.metadata
map field with key "cached.hashCode". This diminishes the time taken
by ontology merge need checking to very little time compared to the
old system where all graph.tg files were loaded completely into heap
memory to simply check whether they need to be merged or not.
2. BaselineCreator application can be used to construct a baseline with
a built product in any OS supported by Simantics.
To get the benefit from these changes, you'll also need to use the
version 0.0.9 of the graph-builder-maven-plugin.
Tuukka Lehtonen [Fri, 9 Mar 2018 11:20:47 +0000 (13:20 +0200)]
Include cached hash code in TransferableGraph1 extensions map
The cached hashcode is calculated before inserting the cached hash value
in the TransferableGraph1.extensions TreeMap. Reading and inspection
must be done with this in mind.
This cached value is used to optimize platform startup by removing the
need to calculate the TransferableGraph1 structure hashcode at runtime
which can be quite expensive because the standard databoard Bindings are
slow compared to optimal methods. Of course an optimized binding could
be used to speed the calculation up dramatically but it still can't beat
caching the final (immutable) hashCode value.
Tuukka Lehtonen [Thu, 1 Mar 2018 23:08:48 +0000 (01:08 +0200)]
Added HDF5 Java interface library version 1.10.0-patch1 to the platform
If you need the library in your product, include the hdf.hdf5 feature to
include the hdf.hdf5lib plug-in.
For now only the win32.x86_64 build of the interface library is included
in the plug-in but also linux and mac compilations of the DLL should be
included in the future.
Antti Villberg [Tue, 27 Feb 2018 09:00:13 +0000 (11:00 +0200)]
Simulator toolkit enhancements
The basic simulator node manager and its supporting structures have been
moved to org.simantics.simulator[.toolkit] and stripped of any
dependency the Simantics database interfaces.
org.simantics.simulator.toolkit.db now contains the parts that bind the
simulator toolkit interfaces to the Simantics DB.
Tuukka Lehtonen [Wed, 28 Feb 2018 11:08:16 +0000 (13:08 +0200)]
Added more createRun utility functions to ExperimentRuns
The new functions directly take WriteGraph as input to allow clients to
create an experiment run within one write transaction and still work on
it afterwards.
Tuukka Lehtonen [Wed, 21 Feb 2018 10:58:32 +0000 (12:58 +0200)]
SimanticsPlatform.startUp ensures updateness of installed feature groups
Previously the installed feature group update code was only executed
when the workspace was first initialized. This does work when new
features are installed into Simantics programs running on existing
workspaces.
Tuukka Lehtonen [Tue, 20 Feb 2018 22:26:16 +0000 (00:26 +0200)]
Fixed InvertBasicExpressionVisitor.invert to keep inverted value type
Previously the code would convert all Number-values to Double instead of
passing the inverted value to Variable.setValue in the same type the
original non-inverted value was in.