Merge branch 'release/2.13.1'
This commit is contained in:
commit
788065e456
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
|
|
|
@ -110,46 +110,21 @@ public class ArrowPainter implements IPainter {
|
|||
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) {
|
||||
for (ITxRelation iTxRelation : relations) {
|
||||
ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource();
|
||||
Rectangle bb = createLinkEntry(otherTx, otherTx.getStream());
|
||||
if(bb!=null){
|
||||
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
||||
return;
|
||||
} else {
|
||||
for(IHierNode gen:otherTx.getStream().getChildNodes()) {
|
||||
if(gen instanceof IWaveform) {
|
||||
bb = createLinkEntry(otherTx, (IWaveform) gen);
|
||||
if(bb!=null){
|
||||
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Rectangle createLinkEntry(ITx otherTx, IWaveform iWaveform) {
|
||||
for(IWaveform iWaveform: new IWaveform[]{otherTx.getStream(), otherTx.getGenerator()}) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform);
|
||||
if(painter!=null) {
|
||||
int height = waveCanvas.styleProvider.getTrackHeight();
|
||||
return new Rectangle(
|
||||
Rectangle bb = new Rectangle(
|
||||
(int) (otherTx.getBeginTime() / scaleFactor),
|
||||
waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx),
|
||||
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
|
||||
height);
|
||||
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -179,8 +179,11 @@ public class WaveformCanvas extends Canvas {
|
|||
}
|
||||
|
||||
public void setZoomLevel(int level, long centerTime) {
|
||||
//FIXME: keep center if zoom-out and cursor is not in view
|
||||
if(level<0) {
|
||||
level = findFitZoomLevel();
|
||||
if(level<0) level = 0;
|
||||
}
|
||||
//FIXME: keep center if zoom-out and cursor is not in view
|
||||
long xc=centerTime/this.scaleFactor; // cursor total x-offset
|
||||
if(level<Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length){
|
||||
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() {
|
||||
return scaleFactor;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
||||
Bundle-Version: 2.13.0
|
||||
Bundle-Version: 2.13.1
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
|
|
@ -570,6 +570,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
(result.isMultiStatus() && result.getChildren().length > 0 && result.getChildren()[0].getCode() != Status.OK_STATUS.getCode() ) ){
|
||||
// kill editor and pop up warning for user
|
||||
sync.asyncExec(() -> {
|
||||
if(myParent.isDisposed()) return;
|
||||
final Display display = myParent.getDisplay();
|
||||
MessageDialog.openWarning(display.getActiveShell(), "Error loading database", "Database cannot be loaded. Aborting...");
|
||||
ePartService.hidePart(myPart, true);
|
||||
|
@ -1026,27 +1027,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
* Sets the zoom fit.
|
||||
*/
|
||||
public void setZoomFit() {
|
||||
//actual max time of signal
|
||||
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);
|
||||
|
||||
waveformPane.setZoomLevel(-1);
|
||||
updateAll();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,9 +52,7 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
|||
*/
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
if(tableEntries && inputElement instanceof IWaveformDb){
|
||||
return new Object[]{};
|
||||
}else if(inputElement instanceof IHierNode){
|
||||
if(inputElement instanceof IHierNode){
|
||||
// make a copy as the laoder might continue to add waveforms
|
||||
ArrayList<IHierNode> nodes = new ArrayList<>(((IHierNode)inputElement).getChildNodes());
|
||||
return nodes.stream().filter(n ->
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>releng/com.minres.scviewer.target</module>
|
||||
|
@ -67,7 +67,7 @@
|
|||
<artifact>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.target</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
</artifact>
|
||||
</target>
|
||||
<environments>
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<packaging>eclipse-repository</packaging>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<build>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?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>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<build>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
MANIFEST-000045
|
|
@ -1 +0,0 @@
|
|||
2018/11/03-15:38:59.715484 139851522529088Delete type=3 #1
|
Binary file not shown.
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.1</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
|
Loading…
Reference in New Issue