Tuukka Lehtonen [Fri, 16 Jun 2017 09:34:43 +0000 (12:34 +0300)]
Fixed diagram profile monitor DnD regression.
CTRL+dragging diagram profile monitor values from diagram to Model
Browser chart/subscription nodes now works again. The code now processes
also dragged data that contains an RVI in String format.
Tuukka Lehtonen [Mon, 29 May 2017 09:58:32 +0000 (12:58 +0300)]
Added Simantics/Diagram function positionToVector.
This function complements the existing positionToDoubleArray and is
required to support for instance diagram template scenegraph node
transform property definition with SCL formulas.
Also fixes:
* Potential NPE in ExperimentUtil.scheduleShutdownActiveExperiment
* MANIFEST.MF warnings from org.simantics.document.server
Kalle Kondelin [Thu, 18 May 2017 12:06:44 +0000 (15:06 +0300)]
Moved LinkSVGImage implementation to new location.
Activated linkImage scl function because it is used by existing scl scripts.
Had to move implementation because compiler error/warning:
A cycle was detected in the build path of project...
Jussi Koskela [Tue, 9 May 2017 13:12:17 +0000 (16:12 +0300)]
Improved logic in new head state creation.
Earlier any IOException during the reading of head state was interpreted
as empty DB. This might cause unwanted DB reset. It's better to identify
need for empty head state based on main state head directory.
Switched AcornDatabase.start logic back to using RandomAccessFile for
touching the db/lock file. Using RandomAccessFile instead of
FileSystemProvider.newFileChannel in Windows better prevents any other
process from removing the lock file. The newFileChannel version did not
prevent the user from initially running 'del lock' to remove the file -
although the file will be recreated quickly by the system.
Also AcornDatabase.start now re-throws ProCoreException if
opening/locking the lock-file fails with IOException to prevent the
system from attempting to start up without a proper database to work
with. Previously the system just logged the start-up problem and
continued.
Tuukka Lehtonen [Fri, 5 May 2017 13:59:12 +0000 (16:59 +0300)]
Fixed bad bug related to AcornBackupProvider
AcornBackupProvider was invoking GraphClientImpl2.makeSnapshot with true
parameter which caused the invocation to write the main.state file when
backups were made which was totally unintentional. The main.state file
is now only written only when the database session is shut down, i.e.
not at all in ClusterManager.makeSnapshot.
Also includes robustness fixes for Acorn database directory locking by
using the Java NIO API for atomic existence testing and creation of the
lock file.
Tuukka Lehtonen [Thu, 4 May 2017 21:52:29 +0000 (00:52 +0300)]
Fixed bad logical bug from Acorn's MainState.load rollback
The major bug was the logical not in MainState.load rollback which
caused the database revisioning to be started from 0 when the database
was *not* empty. It should have been the other way around.
Also cleaned up the database head.state validation code by not using
exceptions for flow control in validating head.state files.
MainState will no longer destroy the entire database if the user removes
directories but forgets to remove the main.state file. The information
stored in main.state is now regarded as cached information only and if
it seems invalid or cannot be read, the same normal rollback logic will
be performed every time.
Another enhancement is that rollback will now automatically store the
revisions deleted by the rollback procedure in timestamped
<workspace>/db/recovery/yyyy-M-d_HH-mm-ss/ folders for later inspection
and debugging. Previously the code just deleted all the extra revisions.
Manually removing the recovery-folder is always a safe operation to
perform.
Also fixed a bug in databoard Files class readFile methods that take
a File as argument. Previously all the functions constructed a
BinaryFile using the default mode which is "rw". This unintentionally
made the readFile methods create an empty file if the file did not
exist. All such methods have been changed to use mode "r".
Tuukka Lehtonen [Thu, 11 May 2017 11:19:32 +0000 (14:19 +0300)]
Added mechanism to diagram IFlagType to prevent graph modifications
When diagram flags are loaded, some implementations trigger graph
modifications because the flag type may know the flag to have wrong
direction information based on analysis of the model. Printing diagrams
to PDF or SVG should not modify the database in any way, just trust what
is in there.
Tuukka Lehtonen [Fri, 5 May 2017 14:25:08 +0000 (17:25 +0300)]
Changed external reference flag texts to obey current name/label mode
Text shown in external reference type diagram flags now obeys the
currently selected Name/Label model that can be controlled using code in
class org.simantics.NameLabelUtil.
Previously the text shown in normal diagram external reference flags was
always preferring to show the Label property of diagrams and related
modules and if labels were not defined, the Name property would be used
instead.
Tuukka Lehtonen [Fri, 5 May 2017 10:41:01 +0000 (13:41 +0300)]
Fixed BrowseContext test code to work headlessly
Previous code invoked JFaceResources.getDefaultFontDescriptor which
eventually invoked Display.getCurrent which would assert out in a
headless test environment.
Less memory use for TG import when NamespaceMigrationStep is involved
MigrationStateImpl.getProperty for root resource(s) keys now first
exports CURRENT_TG back to disk if the TG has already been loaded and
then imports it back using StreamingTransferableGraphImportProcess. This
avoids the need to keep the whole TransferableGraph1 in memory while
doing the import and also allows for the use of the leaner Streaming
import process.
Added alternatives taking RequestProcessor to WorkbenchSelectionUtils.
Fixed several places which were found to use a method from
WorkbenchSelectionUtils that could potentially try to initiate a new
read transaction through org.simantics.db.Session to pass the current
ReadGraph over to WorkbenchSelectionUtils instead. This fixes the very
same problem from OpenWithMenuContribution that was introduced in 6d3ad788 change I45cfa3940df8e1f4abe016b215843dc083227b2b.
Also, ComponentTypeViewerData.editValue now prevents committing new
entered value if the value does not pass input validation.
Tuukka Lehtonen [Fri, 31 Mar 2017 13:14:02 +0000 (16:14 +0300)]
Replaced use of deprecated BinaryFunction et al with BiFunction et al
Also added missing logic to GraphExplorerComposite.SelectionElement to
discover Resource from Variable when WorkbenchSelectionElement is asked
for AnyResource. This is part of the fix for #7116.
Fixed breakage from ContextualHelp F1 keystroke handler which was
introduced in the original SVN commit r32734 (#6446).
Tuukka Lehtonen [Fri, 31 Mar 2017 09:05:47 +0000 (12:05 +0300)]
Reversioned org.jdom2 from 2.0.6 to 2.0.6.b0001
This ensures that people loading the target platform will
receive the correct version of the plug-in. Currently developers
still have old cached versions of the old bundle with version
2.0.6 that the system unwantedly keeps loading while P2 should
be loading the correct file on the web. The only way to prevent
this is to bump the version qualifier stamp to force downloads.
Tuukka Lehtonen [Tue, 28 Mar 2017 15:02:18 +0000 (18:02 +0300)]
Added base diagram profile style for showing terminal names on diagrams
Previously there has been an implementation for showing terminal names
in the symbol editor (SymbolTerminalNameStyle). This implementation is
for showing symbol instance terminal names on modelling diagrams
containing symbol instances. The names are positioned outside the
current symbol's bounding box.
ConnectionPointNameStyle also employs the new TextNode automatic text
flipping feature added in #7112.
Jussi Koskela [Mon, 20 Mar 2017 13:04:31 +0000 (15:04 +0200)]
Not possible to open declaration of SCL module from relative path (F3)
Resolve absolute path of SCL module when user presses F3 on
import/include that uses relative path. Refactored absolute path
resolving to static utility function.
Jussi Koskela [Fri, 10 Mar 2017 07:38:28 +0000 (09:38 +0200)]
Hardening of DB index integrity
Mark index dirty as early as possible on write operations (and sync to
disk). Clean index dirtiness indicator as last step when deleting the
index. Cache dirty statuses to write dirty files only once.
Tuukka Lehtonen [Mon, 20 Mar 2017 06:56:08 +0000 (08:56 +0200)]
Removed useless class org.simantics.utils.thread.Executors2.
Also removed the optional org.eclipse.swt dependency introduced to
org.simantics.utils.thread by Executors2. org.simantics.utils.thread.swt
already contains SWTThread which is where this dependency should be
kept.
Tuukka Lehtonen [Fri, 10 Mar 2017 16:27:03 +0000 (18:27 +0200)]
Fonts are now embedded in diagram, wiki, etc PDF exports.
A lot of general cleanup/refactoring for the old "Diagrams to PDF"
export wizard backend implementation. Consolidated some page numbering
code into org.simantics.export.core.pdf.PageNumbering.
Also consolidated iText FontMapper initialization into
org.simantics.export.core.pdf.FontMapping. It turned out that the key to
getting iText to embed fonts for text rendered into PDFs was that the
FontMapper used needs to have all system fonts registered into it.
Also fixed PDF export page number positioning in the more generic PDF
export wizard.
Tuukka Lehtonen [Tue, 7 Feb 2017 14:11:00 +0000 (16:11 +0200)]
Remove all dependencies on javax.vecmath.
Apache Commons Math3 library can be used to replace the functionality.
The only downside is that Math3 is over 10 times larger than the old
vecmath library (180kB vs. >2MB).
Also removed javax.vecmath entirely from platform external dependencies.
Hannu Niemistö [Mon, 20 Feb 2017 09:17:31 +0000 (11:17 +0200)]
(refs #7042) Added a new compiler optimization (eta-reduce)
Adds new optimization to SCL compiler that transforms the following code
\someParameters = f someOtherParameters someParameters'
to
f someOtherParameters
with the following restrictions:
* someParameters and someParameters' are lists of equal variables
or the type is ()
* someOtherParameters does not refer to variables in someParameters
or the lambda expression itself or something depending on it
recursively