Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
1ebf9ba382 | |||
929408d08c | |||
f57fb93525 | |||
788065e456 | |||
22b46e0525 | |||
b75018239a | |||
598bb8eec7 | |||
869265fc13 | |||
5ad813527a | |||
73f8d3d50a | |||
da1701195d | |||
9b6334509e | |||
ac4acc34a4 | |||
b6963f38d6 | |||
182a036ade | |||
97f2182290 | |||
1986a8c9c3 | |||
6905d96329 | |||
818f786b1d | |||
2948c1bd33 | |||
78faab404c | |||
64b10970a8 | |||
6ab8fd232e | |||
f337a94112 | |||
0135631a3e | |||
d0e1e8801f | |||
d1b3a91979 | |||
45c1396e0e | |||
b7301733f0 | |||
5df91dbaa8 | |||
68918689e7 | |||
c41dd646da | |||
a077389b83 | |||
25545dac51 | |||
4ee2e8bc68 |
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.2</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.2</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.2</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.2</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.2</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.2</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.2</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.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
|
@ -110,48 +110,23 @@ 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;
|
||||
}
|
||||
for(IWaveform iWaveform: new IWaveform[]{otherTx.getStream(), otherTx.getGenerator()}) {
|
||||
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
|
||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform);
|
||||
if(painter!=null) {
|
||||
int height = waveCanvas.styleProvider.getTrackHeight();
|
||||
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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
public void paintArea(Projection proj, Rectangle clientRect) {
|
||||
yCtrlOffset = waveCanvas.styleProvider.getTrackHeight()/2;
|
||||
|
@ -179,8 +179,11 @@ public class WaveformCanvas extends Canvas {
|
||||
}
|
||||
|
||||
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
|
||||
if(level<0) level = 0;
|
||||
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.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -12,5 +12,5 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=11
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -62,9 +62,4 @@ public interface IWaveformDb extends IHierNode {
|
||||
*/
|
||||
public boolean isLoaded();
|
||||
|
||||
/**
|
||||
* Clear.
|
||||
*/
|
||||
public void clear();
|
||||
|
||||
}
|
||||
|
@ -165,16 +165,6 @@ public class WaveformDb extends HierNode implements IWaveformDb, PropertyChangeL
|
||||
return ext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear.
|
||||
*/
|
||||
@Override
|
||||
public void clear() {
|
||||
waveforms.clear();
|
||||
childNodes.clear();
|
||||
loaded = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is loaded.
|
||||
*
|
||||
|
@ -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.2
|
||||
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.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -9,7 +9,7 @@ DesignBrowser_8=Insert before
|
||||
LoadingWaveformDb_0=Database loading...
|
||||
LoadStoreSettingsHandler_2=*.scview
|
||||
LoadStoreSettingsHandler_3=SCViewer.scview
|
||||
OpenHandler_0=*.vcd;*.vcd.gz;*.txdb;*.txdb.gz;*.txlog;*.fbrdb
|
||||
OpenHandler_0=*.vcd;*.vcd.gz;*.txlog;*.txlog.gz;*.txdb;*.fbrdb
|
||||
QuitHandler_0=Confirmation
|
||||
QuitHandler_1=Do you want to exit?
|
||||
RelationTypeToolControl_0=------------
|
||||
|
@ -3,6 +3,7 @@ package com.minres.scviewer.e4.application.parts;
|
||||
import java.io.File;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.PathMatcher;
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@ -229,6 +230,14 @@ public class FileBrowserDialog extends TrayDialog {
|
||||
colSize.getColumn().setText("Size");
|
||||
colSize.getColumn().addSelectionListener(getSelectionAdapter(colSize.getColumn(), 1));
|
||||
|
||||
TableViewerColumn colDate = new TableViewerColumn(tableViewer, SWT.RIGHT);
|
||||
colDate.setLabelProvider(new FileTableLabelProvider() {
|
||||
@Override public String getText(Object element) { return DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.MEDIUM).format(((File) element).lastModified()); }
|
||||
});
|
||||
colDate.getColumn().setWidth(200);
|
||||
colDate.getColumn().setText("Modification Date");
|
||||
colDate.getColumn().addSelectionListener(getSelectionAdapter(colDate.getColumn(), 2));
|
||||
|
||||
TableViewerColumn colEmpty = new TableViewerColumn(tableViewer, SWT.CENTER);
|
||||
colEmpty.setLabelProvider(new FileTableLabelProvider() {
|
||||
@Override public String getText(Object element) { return ""; }
|
||||
@ -264,7 +273,7 @@ public class FileBrowserDialog extends TrayDialog {
|
||||
tableViewer.setInput(selectedDir.listFiles());
|
||||
}
|
||||
});
|
||||
sashForm.setWeights(new int[]{3, 3});
|
||||
sashForm.setWeights(new int[]{2, 3});
|
||||
return area;
|
||||
}
|
||||
|
||||
@ -445,6 +454,9 @@ public class FileBrowserDialog extends TrayDialog {
|
||||
case 1:
|
||||
rc = Long.valueOf(p1.length()).compareTo(p2.length());
|
||||
break;
|
||||
case 2:
|
||||
rc = Long.valueOf(p1.lastModified()).compareTo(p2.lastModified());
|
||||
break;
|
||||
default:
|
||||
rc = 0;
|
||||
}
|
||||
|
@ -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);
|
||||
@ -612,7 +613,12 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
Map<String, String> state = new HashMap<>();
|
||||
saveWaveformViewerState(state);
|
||||
waveformPane.getStreamList().clear();
|
||||
database.clear();
|
||||
database = dbFactory.getDatabase();
|
||||
database.addPropertyChangeListener(evt -> {
|
||||
if (IHierNode.WAVEFORMS.equals(evt.getPropertyName())) { //$NON-NLS-1$
|
||||
myParent.getDisplay().syncExec(() -> waveformPane.setMaxTime(database.getMaxTime()));
|
||||
}
|
||||
});
|
||||
if (!filesToLoad.isEmpty())
|
||||
loadDatabase(state, 0L);
|
||||
}
|
||||
@ -1026,27 +1032,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.2</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.2</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.2</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.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.2</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.2" 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.2</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.2</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.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
Reference in New Issue
Block a user