Merge branch 'release/2.13.1'

This commit is contained in:
Eyck Jentzsch 2021-03-25 21:09:49 +00:00
commit 788065e456
29 changed files with 57 additions and 84 deletions

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>3.0.0-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>4.0.0-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>

View File

@ -110,48 +110,23 @@ public class ArrowPainter implements IPainter {
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) { protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) {
for (ITxRelation iTxRelation : relations) { for (ITxRelation iTxRelation : relations) {
ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource(); ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource();
Rectangle bb = createLinkEntry(otherTx, otherTx.getStream()); for(IWaveform iWaveform: new IWaveform[]{otherTx.getStream(), otherTx.getGenerator()}) {
if(bb!=null){ if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
res.add(new LinkEntry(bb, iTxRelation.getRelationType())); IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform);
return; if(painter!=null) {
} else { int height = waveCanvas.styleProvider.getTrackHeight();
for(IHierNode gen:otherTx.getStream().getChildNodes()) { Rectangle bb = new Rectangle(
if(gen instanceof IWaveform) { (int) (otherTx.getBeginTime() / scaleFactor),
bb = createLinkEntry(otherTx, (IWaveform) gen); waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx),
if(bb!=null){ (int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
res.add(new LinkEntry(bb, iTxRelation.getRelationType())); height);
return; res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
}
} }
} }
} }
} }
} }
private Rectangle createLinkEntry(ITx otherTx, IWaveform iWaveform) {
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
IWaveformPainter painter = waveCanvas.wave2painterMap.get(otherTx.getStream());
if(painter==null) {
for(IHierNode gen:otherTx.getStream().getChildNodes()) {
if(gen instanceof IWaveform) {
painter = waveCanvas.wave2painterMap.get(gen);
if(painter!=null)
break;
}
}
}
if(painter!=null) {
int height = waveCanvas.styleProvider.getTrackHeight();
return new Rectangle(
(int) (otherTx.getBeginTime() / scaleFactor),
waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx),
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
height);
}
}
return null;
}
@Override @Override
public void paintArea(Projection proj, Rectangle clientRect) { public void paintArea(Projection proj, Rectangle clientRect) {
yCtrlOffset = waveCanvas.styleProvider.getTrackHeight()/2; yCtrlOffset = waveCanvas.styleProvider.getTrackHeight()/2;

View File

@ -179,8 +179,11 @@ public class WaveformCanvas extends Canvas {
} }
public void setZoomLevel(int level, long centerTime) { public void setZoomLevel(int level, long centerTime) {
if(level<0) {
level = findFitZoomLevel();
if(level<0) level = 0;
}
//FIXME: keep center if zoom-out and cursor is not in view //FIXME: keep center if zoom-out and cursor is not in view
if(level<0) level = 0;
long xc=centerTime/this.scaleFactor; // cursor total x-offset long xc=centerTime/this.scaleFactor; // cursor total x-offset
if(level<Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length){ if(level<Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length){
this.scaleFactor = (long) Math.pow(10, level>>1); this.scaleFactor = (long) Math.pow(10, level>>1);
@ -208,6 +211,24 @@ public class WaveformCanvas extends Canvas {
} }
} }
private int findFitZoomLevel() {
//get area actually capable of displaying data, i.e. area of the receiver which is capable of displaying data
Rectangle clientArea = getClientArea();
long clientAreaWidth = clientArea.width;
//try to find existing zoomlevel where scaleFactor*clientAreaWidth >= maxTime, if one is found set it as new zoomlevel
int magnitude_factor=1;
for(int magnitude=0; magnitude<Constants.UNIT_STRING.length; magnitude++) {
for (int multiplier=0; multiplier<Constants.UNIT_MULTIPLIER.length; multiplier++){
int tempLevel = magnitude*Constants.UNIT_MULTIPLIER.length+multiplier;
long scaleFactor = Constants.UNIT_MULTIPLIER[multiplier]*magnitude_factor;
if(scaleFactor*clientAreaWidth >= maxTime)
return tempLevel;
}
magnitude_factor*=1000;
}
return -1;
}
public long getScaleFactor() { public long getScaleFactor() {
return scaleFactor; return scaleFactor;
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
Bundle-Version: 2.13.0 Bundle-Version: 2.13.1
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Require-Bundle: javax.inject;bundle-version="1.0.0", Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.11.1", org.eclipse.core.runtime;bundle-version="3.11.1",

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -570,6 +570,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
(result.isMultiStatus() && result.getChildren().length > 0 && result.getChildren()[0].getCode() != Status.OK_STATUS.getCode() ) ){ (result.isMultiStatus() && result.getChildren().length > 0 && result.getChildren()[0].getCode() != Status.OK_STATUS.getCode() ) ){
// kill editor and pop up warning for user // kill editor and pop up warning for user
sync.asyncExec(() -> { sync.asyncExec(() -> {
if(myParent.isDisposed()) return;
final Display display = myParent.getDisplay(); final Display display = myParent.getDisplay();
MessageDialog.openWarning(display.getActiveShell(), "Error loading database", "Database cannot be loaded. Aborting..."); MessageDialog.openWarning(display.getActiveShell(), "Error loading database", "Database cannot be loaded. Aborting...");
ePartService.hidePart(myPart, true); ePartService.hidePart(myPart, true);
@ -1026,27 +1027,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
* Sets the zoom fit. * Sets the zoom fit.
*/ */
public void setZoomFit() { public void setZoomFit() {
//actual max time of signal waveformPane.setZoomLevel(-1);
long maxTime = waveformPane.getMaxTime();
//get area actually capable of displaying data, i.e. area of the receiver which is capable of displaying data
Rectangle clientArea = myParent.getClientArea();
long clientAreaWidth = clientArea.width;
boolean foundZoom=false;
//try to find existing zoomlevel where scaleFactor*clientAreaWidth >= maxTime, if one is found set it as new zoomlevel
for (int level=0; level<Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length; level++){
long scaleFactor = (long) Math.pow(10, level/2d);
if(level%2==1) scaleFactor*=3;
if(scaleFactor*clientAreaWidth >= maxTime) {
setZoomLevel(level);
foundZoom=true;
break;
}
}
//if no zoom level is found, set biggest one available
if(!foundZoom) setZoomLevel(Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length-1);
updateAll(); updateAll();
} }

View File

@ -52,9 +52,7 @@ public class TxDbContentProvider implements ITreeContentProvider {
*/ */
@Override @Override
public Object[] getElements(Object inputElement) { public Object[] getElements(Object inputElement) {
if(tableEntries && inputElement instanceof IWaveformDb){ if(inputElement instanceof IHierNode){
return new Object[]{};
}else if(inputElement instanceof IHierNode){
// make a copy as the laoder might continue to add waveforms // make a copy as the laoder might continue to add waveforms
ArrayList<IHierNode> nodes = new ArrayList<>(((IHierNode)inputElement).getChildNodes()); ArrayList<IHierNode> nodes = new ArrayList<>(((IHierNode)inputElement).getChildNodes());
return nodes.stream().filter(n -> return nodes.stream().filter(n ->

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>releng/com.minres.scviewer.target</module> <module>releng/com.minres.scviewer.target</module>
@ -67,7 +67,7 @@
<artifact> <artifact>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.target</artifactId> <artifactId>com.minres.scviewer.target</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
</artifact> </artifact>
</target> </target>
<environments> <environments>

View File

@ -6,11 +6,11 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<artifactId>com.minres.scviewer.e4.product</artifactId> <artifactId>com.minres.scviewer.e4.product</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<packaging>eclipse-repository</packaging> <packaging>eclipse-repository</packaging>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<build> <build>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?> <?pde version="3.5"?>
<product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.13.0" useFeatures="true" includeLaunchers="true"> <product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.13.1" useFeatures="true" includeLaunchers="true">
<configIni use="default"> <configIni use="default">
</configIni> </configIni>

View File

@ -12,7 +12,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<build> <build>

View File

@ -1 +0,0 @@
2018/11/03-15:38:59.715484 139851522529088Delete type=3 #1

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-test-plugin</packaging> <packaging>eclipse-test-plugin</packaging>