Giter Site home page Giter Site logo

visualdct's Introduction

VisualDCT (aka VDCT) Build Status

VisualDCT is the Visual Database Configuration Tool for EPICS Databases.

It was developed by Cosylab. This development was funded by SLS, APS, Diamond and SNS.

Downloads

Distribution archives of released versions (containing binaries, sources, javadoc, and the documentation web site) are available from the releases page.

Web Site

VisualDCT has a generated static web site that contains detailed information, including user manuals, release notes, reference and project documentation.

The current (development) version of the generated web site is available on-line, the complete website is included in the distribution archives (in the site folder).

Building from Sources

VisualDCT is a Maven project. Any recent Java IDE should be able to open and compile it. VisualDCT requires Java 7 and is known to compile using Java 8, 11 and 16.

Apart from the default lifecycle, two additional Maven goals are useful:

  • site Generate the website with user, reference and project documentation
  • assembly:single Generate the distribution archives as tar and zip

Continuous Integration

Continuous Integration and deployment is provided through GitHub Actions.

Bugs

Any bugs should be reported as issues in the GitHub project.

Contributing

Pull requests are always welcome.

For non-trivial changes and additions, please first contact the authors and/or use the EPICS Tech-Talk mail exploder to discuss and review your plans.

visualdct's People

Contributors

dependabot[bot] avatar ilist2 avatar jbobnar avatar katysaintin avatar msekoranja avatar ralphlange avatar sunil-sah avatar tfors-aps avatar zumbruch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visualdct's Issues

Reading visual data is broken

Reported by Christoph Schröder <christoph.schroeder AT helmholtz-berlin.de>:

Using flatdb we ran into:

schroeder@fern:~/workspace/darcs/ioc/MLS-Controls/BeamDumpApp/O.linux-x86_64$ java -cp /usr/share/visualdct/VisualDCT.jar com.cosylab.vdct.GenerateFlatDatabase -d ../O.Common/beamDump.dbd ../beamDump.vdb 22828-beamDump.db
File will be overwritten: 22828-beamDump.db

Global macro evaluation: disabled
Produce hierarhical names like CapFast: disabled
Unresolved macro warnings: enabled


Loading VDB files.

Error found in file '/home/schroeder/workspace/darcs/ioc/MLS-Controls/BeamDumpApp/O.linux-x86_64/../beamDump.vdb', line 69 near token '1': com.cosylab.vdct.db.DBGParseException: Invalid VisualDCT visual data...
The file(s) could not be loaded

AWT issues when running under Java 11

Environment:

Red Hat Enterprise Linux Workstation release 7.4 (Maipo)

openjdk 11.0.3 2019-04-16 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.3+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.3+7-LTS, mixed mode, sharing)

On the starting terminal we get:

Loading VisualDCT v2.8.1...

Directive to load DBD: '/opt/codac-6.2/epics/dbd/base.dbd'.
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Width (-10) and height (-32) cannot be <= 0
	at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
	at java.desktop/sun.awt.X11GraphicsConfig.createAcceleratedImage(X11GraphicsConfig.java:403)
	at java.desktop/sun.awt.X11.XComponentPeer.createImage(XComponentPeer.java:718)
	at java.desktop/java.awt.Component.createImage(Component.java:3662)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at java.desktop/java.awt.Component.createImage(Component.java:3659)
	at com.cosylab.vdct.graphics.DrawingSurface.redraw(DrawingSurface.java:3486)
	at com.cosylab.vdct.graphics.DrawingSurface.draw(DrawingSurface.java:474)
	at com.cosylab.vdct.graphics.PanelDecorator.paintComponent(PanelDecorator.java:150)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1074)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1083)
	at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)
	at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:907)
	at java.desktop/javax.swing.JComponent.paintToOffscreen(JComponent.java:5262)
	at java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:246)
	at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
	at java.desktop/javax.swing.JComponent.paint(JComponent.java:1060)
	at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
	at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:78)
	at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:115)
	at java.desktop/java.awt.Container.paint(Container.java:2002)
	at java.desktop/java.awt.Window.paint(Window.java:3940)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:876)
	at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
	at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1890)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)```

Inspector column headings

The Inspector dialog displays column headings in the first row of the table of field values.
The headings for the Name and Value columns are swapped.

Present in: 2.6.1274

Support for default macro values

Both macLib implementations in Base support the syntax $(macro=default-value) where default-value is used if the macro is not defined. It would be nice to be able to use this syntax in VisualDCT as well.

Port to Maven

Currently, VisualDCT is built using ant.
This should be ported to be a Maven project.

com.cosylab.vdct.VisualDCT not found

Downloaded version 2.8.3 from github, and observing error below. What am I missing?

kg1@lap133454:/epics/util/VDCT/VisualDCT-2.8.3$ ./visualdct.sh
./visualdct.sh: 9: 1: not found
Error: Could not find or load main class com.cosylab.vdct.VisualDCT
Caused by: java.lang.ClassNotFoundException: com.cosylab.vdct.VisualDCT

Kind regards,

Kaz

Inspector doesn't show macro values of template instances after file→open

I'm using VisualDCT's hierarchical (template) features, passing macros down into template instances. When I open the inspector on a template instance in a parent diagram that I have loaded from a file, the Value column is never populated with the macro values saved for that instance, the cells just appear empty. They can be set and they are displayed properly on the diagram though. It is necessary to save the parent diagram to a file and reload it for the values to disappear though, so this is probably related to the save/load operation rather than the inspector itself.

Don't know if these are related or not, but there are other problems with ports and macros when saving and reloading a file containing template instances (some of these may require multiple instances of the same template to trigger, not sure but that's what I'm doing):

  • Ports don't always reload with their graphic connectors in the same order as when they were saved, which causes the diagram to change if they are wired up (the wires do stay with the right connection though).
  • Macros lose their wired connections if the macro is wired to another macro being passed in from the super-parent diagram. The instance does load the macro's value correctly, but the wire disappears after reloading the diagram from the file.

Executing scripts from any directory

flatdb and runScript scripts can be executed only from the directory containing the scripts themselves.
I have modified the scripts to be executed from any directory (useful for flatdb command to be automatically executed from Makefiles to generate .db from .vdb files).
I also modified the src/assembly/dist.xml to remove the version information from packed jar files in order to allow the scripts to be executed without modification.
If you are interested I can open a pull request.

git status:

Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	renamed:    flatdb -> flatdb.sh
	renamed:    runScript -> visualdct.sh

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   flatdb.sh
	modified:   src/assembly/dist.xml
	modified:   visualdct.sh

git diff:

index 8a4bd92..05c53d1 100755
--- a/flatdb.sh
+++ b/flatdb.sh
@@ -1 +1,16 @@
-java -cp VisualDCT.jar com.cosylab.vdct.GenerateFlatDatabase $*
\ No newline at end of file
+#!/bin/sh
+
+# VisualDCT flatdb run script
+
+SCRIPT_LOCATION=$0
+if [ -x readlink ]; then
+  while [ -L "$SCRIPT_LOCATION" ]; do
+    SCRIPT_LOCATION=`readlink -e "$SCRIPT_LOCATION"`
+  done
+fi
+
+VDCT_HOME=`dirname "$SCRIPT_LOCATION"`
+
+CLASSPATH="$CLASSPATH:$VDCT_HOME/VisualDCT.jar"
+
+java -classpath "$CLASSPATH" com.cosylab.vdct.GenerateFlatDatabase "$@"
\ No newline at end of file
diff --git a/src/assembly/dist.xml b/src/assembly/dist.xml
index 28eaa8b..b3168aa 100644
--- a/src/assembly/dist.xml
+++ b/src/assembly/dist.xml
@@ -14,21 +14,31 @@
         <include>README*</include>
         <include>LICENSE*</include>
         <include>NOTICE*</include>
-        <include>flatdb</include>
-        <include>runScript</include>
+        <include>flatdb*</include>
+        <include>visualdct*</include>
         <include>pom.xml</include>
       </includes>
     </fileSet>
     <fileSet>
-      <directory>${project.build.directory}</directory>
-      <outputDirectory>.</outputDirectory>
-      <includes>
-        <include>*.jar</include>
-      </includes>
-    </fileSet>
-    <fileSet>
       <directory>${project.build.directory}/site</directory>
       <outputDirectory>site</outputDirectory>
     </fileSet>
   </fileSets>
+  <files>
+    <file>
+      <source>${project.build.directory}/${artifact.artifactId}-${artifact.version}.jar</source>
+      <outputDirectory>.</outputDirectory>
+      <destName>${artifact.artifactId}.jar</destName>
+    </file>
+    <file>
+      <source>${project.build.directory}/${artifact.artifactId}-${artifact.version}-javadoc.jar</source>
+      <outputDirectory>.</outputDirectory>
+      <destName>${artifact.artifactId}-javadoc.jar</destName>
+    </file>
+    <file>
+      <source>${project.build.directory}/${artifact.artifactId}-${artifact.version}-sources.jar</source>
+      <outputDirectory>.</outputDirectory>
+      <destName>${artifact.artifactId}-sources.jar</destName>
+    </file>
+  </files>
 </assembly>
diff --git a/visualdct.sh b/visualdct.sh
index bf440e4..06b285e 100755
--- a/visualdct.sh
+++ b/visualdct.sh
@@ -1 +1,16 @@
-java -cp VisualDCT.jar -DEPICS_DB_INCLUDE_PATH=$EPICS_DB_INCLUDE_PATH com.cosylab.vdct.VisualDCT $*
\ No newline at end of file
+#!/bin/sh
+
+# VisualDCT editor run script
+
+SCRIPT_LOCATION=$0
+if [ -x readlink ]; then
+  while [ -L "$SCRIPT_LOCATION" ]; do
+    SCRIPT_LOCATION=`readlink -e "$SCRIPT_LOCATION"`
+  done
+fi
+
+VDCT_HOME=`dirname "$SCRIPT_LOCATION"`
+
+CLASSPATH="$CLASSPATH:$VDCT_HOME/VisualDCT.jar"
+
+java -classpath "$CLASSPATH" -DEPICS_DB_INCLUDE_PATH="$EPICS_DB_INCLUDE_PATH" com.cosylab.vdct.VisualDCT "$@"
\ No newline at end of file

VDCT won't run against Base 3.16 or EPICS 7 (database 3.17)

It seems to start up normally, but then bails out complaining that it did not load any DBDs:

$ vdct
Loading VisualDCT v2.6.1280...


Directive to load DBD: '/opt/codac-6.0/epics/dbd/base.dbd'.
Directive to load DBD: '/opt/codac-6.0/epics/dbd/pxi6259.dbd'.
Directive to load DBD: '/opt/codac-6.0/epics/dbd/nisync.dbd'.
Directive to load DBD: '/opt/codac-6.0/epics/dbd/nisync-generalTime.dbd'.
No DBD loaded! Exiting...

The DBD files are fine, the same jar that works on RHEL 6 shows this behaviour on RHEL 7. Java versions are different, but not that different (1.8.0_101 vs. 1.8.0_141).

Management of a record with a field VAL with no quote value

Hello,

I'm using the VisualDCT library in our EPICS project. (IRFU , LDISC laboratory at CEA Saclay).
There is a problème when a EPICS records have a field VAL with an integer value.
Ex :
record(ao, "MY-PV-NAME"){
field(VAL, 0)
field(PINI, "YES")
field(DTYP, "S7plc")
field(DESC, "My description")
field(OUT, "@PLCName/0 T=FLOAT")
}

The first problem is that VDCTSend a DBParserException ""Invalid field value...". Because it only manage value within the quote ex : "0" (EPICS IOC can deal without the quotes.

The second problem is that is a integer value, the token send back a double value. So it will send 0.0 instead of 0.

Please find my fix proposition in attachement.

test.db.txt
DBResolver.java.txt
EnhancedStreamTokenizer.java.txt

Best regards,

Katy SAINTIN


Ingénieur chercheur en développement logiciel
Laboratoire de Développement et Intégration de Systèmes de Contrôle
DRF/IRFU/DIS/LDISC CEA de Saclay

stack trace when a file cannot be locked

This mostly concerns use of vdct in batch mode to flatten hierarchical vdb files. It seems when using parallel make (-j option) the already running instance takes a file lock leading to ugly stack traces like the one below. These are not helpful for users, instead a simple one line message would be better.

java.util.prefs.BackingStoreException: Couldn't get file lock.
at java.util.prefs.FileSystemPreferences.sync(FileSystemPreferences.java:715)
at com.cosylab.vdct.Settings.sync(Unknown Source)
at com.cosylab.vdct.Settings.setSnapToGrid(Unknown Source)
at com.cosylab.vdct.graphics.objects.Group.initializeLayout(Unknown Source)
at com.cosylab.vdct.graphics.DrawingSurface.applyVisualData(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.generateTemplate(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.extractTemplates(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.generateVDBDataInternal(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.generateTemplate(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.extractTemplates(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.generateVDBDataInternal(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.generateTemplate(Unknown Source)
at com.cosylab.vdct.vdb.VDBData.generateVDBData(Unknown Source)
at com.cosylab.vdct.graphics.DrawingSurface.open(Unknown Source)
at com.cosylab.vdct.graphics.DrawingSurface.open(Unknown Source)
at com.cosylab.vdct.graphics.DrawingSurface.open(Unknown Source)
at com.cosylab.vdct.GenerateFlatDatabase.flatDatabase(Unknown Source)
at com.cosylab.vdct.GenerateFlatDatabase.main(Unknown Source)

A related issue is that in flattening mode vdct outputs a lot of mostly irrelevant stuff even if no error happens. A command line switch (-q) or an optional argument for the method call would be very much appreciated.

VDCT doesn't handle escaped double-quotes, or escape back-slashes

I used vdct 2.6.1274 to set a DESC field to "Hello" with quote characters at each end. It correctly escaped the quotes on saving, giving me this:

  field(DESC, "\"Hello\"")

However when I read that .vdb file back into vdct the inspector only showed a single back-slash character in that field, and on saving the file again, the result was this:

  field(DESC, "\")

That isn't a properly escaped back-slash character either, although the IOC does read it in properly as long as it's at the end of a string.

I haven't tested these issues with the latest version of vdct, but properly handling back-slashes and escaped quotes in .db files is going to be essential in the future so this bug is pretty important.

RunScript doesn't work

runScript is trying to load VisualDCT.jar, but the distribution doesn't include this file. The file name is actually VisualDCT-.jar. RunScript should be adapted to match the jar file name.

Save UTF-8 db files.

Hi,

I have a db file with UTF-8 charset encoding (I need to use μm engineering unit).
While VisualDCT can open the file without problems, it is not able to save it in the same format.
I already added the option -Dfile.encoding=UTF-8 to the command line in runScript.
Is there a way to force UTF-8 file encoding?

Luca

Building Fails

When building

mvn clean install

The build fails due to Java 1.5 no longer being supported.

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] error: Source option 5 is no longer supported. Use 6 or later.
[ERROR] error: Target option 1.5 is no longer supported. Use 1.6 or later.

adding the following to the pom.xml file allowed the build to advance.

<properties>
  ....
  <maven.compiler.source>1.6</maven.compiler.source>
  <maven.compiler.target>1.6</maven.compiler.target>
</properties>

The build also fails due to Javadoc errors.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.1:jar (attach-javadocs) on project VisualDCT: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - javadoc: warning - You have not specified the version of HTML to use.
[ERROR] The default is currently HTML 4.01, but this will change to HTML5
[ERROR] in a future release. To suppress this warning, please specify the
[ERROR] version of HTML used in your documentation comments and to be
[ERROR] generated by this doclet, using the -html4 or -html5 options.
[ERROR] VisualDCT/src/main/java/com/cosylab/vdct/DBDDialog.java:60: error: unknown tag: author:
[ERROR] * @author:
[ERROR] ^
[ERROR] VisualDCT/src/main/java/com/cosylab/vdct/about/AboutDialogEngine.java:34: error: unknown tag: author:
[ERROR] * @author:
[ERROR] ^
[ERROR] VisualDCT/src/main/java/com/cosylab/vdct/about/AboutDialog.java:34: error: unknown tag: author:
[ERROR] * @author:
[ERROR] ^
[ERROR] VisualDCT/src/main/java/com/cosylab/vdct/db/DBConnectorData.java:34: warning: no description for @author
[ERROR] * @author
[ERROR] ^
.......

Simply skipping building the javadocs allowed the build to succeed.

mvn clean install -Dmaven.javadoc.skip=true

However, the runScript does not work... Still working on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.