develop

Conflicts:
	com.minres.scviewer.database.test/inputs/simple_system.vcd
	com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java
	com.minres.scviewer.database.text/.settings/org.eclipse.jdt.groovy.core.prefs
	com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/SignalPainter.java
	com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformCanvas.java
	com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/swt/internal/WaveformViewer.java
	com.minres.scviewer.database.ui/src/com/minres/scviewer/database/ui/WaveformColors.java
	com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java
	com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDFileParser.java
	com.minres.scviewer.e4.application/plugin.xml
	com.minres.scviewer.e4.product/scviewer.product
	com.minres.scviewer.target/neon.target
	com.minres.scviewer.target/photon.target
	com.minres.scviewer.ui/.settings/org.eclipse.jdt.groovy.core.prefs
This commit is contained in:
Eyck Jentzsch 2018-10-11 15:22:10 +02:00
commit 0634b9cfd5
19 changed files with 179 additions and 56 deletions

View File

@ -31,7 +31,7 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.minres.scviewer.database.test"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.minres.scviewer.database.test"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/>
<stringAttribute key="pde.version" value="3.3"/> <stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="com.minres.scviewer.e4.product"/> <stringAttribute key="product" value="com.minres.scviewer.e4.product"/>
<booleanAttribute key="run_in_ui_thread" value="true"/> <booleanAttribute key="run_in_ui_thread" value="true"/>

View File

@ -1622,7 +1622,7 @@ b1110100011010100101001010 aabdd
0aabdv 0aabdv
0aabdw 0aabdw
0aabdx 0aabdx
r0.0 bbbbb r1.0 bbbbb
$end $end
#10000 #10000
@ -1643,7 +1643,6 @@ $end
#1287121272 #1287121272
b1000000000100000000000000000100 aabcr b1000000000100000000000000000100 aabcr
r1.0 bbbbb
#1288121272 #1288121272
b111111110100111110 aaabi b111111110100111110 aaabi
@ -1659,43 +1658,33 @@ b11000000000100000000000000000100 aabcr
b111111110100111110 aabcw b111111110100111110 aabcw
b101010 aabdb b101010 aabdb
b111111110100111110 aabdc b111111110100111110 aabdc
r2.0 bbbbb
#1303801016 #1303801016
b1000 aaacx b1000 aaacx
r3.0 bbbbb
#1311382718 #1311382718
b100000000 aabcu b100000000 aabcu
r2.0 bbbbb
#1312689908 #1312689908
b1000000010111110001 aabct b1000000010111110001 aabct
r1.0 bbbbb
#1315304288 #1315304288
b10000000000000000000010111110001 aabct b10000000000000000000010111110001 aabct
r0.0 bbbbb
#1317395792 #1317395792
b101011 aabdb b101011 aabdb
r-1.0 bbbbb
#1345892534 #1345892534
b101100 aabdb b101100 aabdb
r-2.0 bbbbb
#1375173590 #1375173590
b101101 aabdb b101101 aabdb
r-3.0 bbbbb
#1404454646 #1404454646
b101110 aabdb b101110 aabdb
r-2.0 bbbbb
#1437918710 #1437918710
b101111 aabdb b101111 aabdb
r-1.0 bbbbb
#1443670346 #1443670346
b11111111010100 aaabi b11111111010100 aaabi
@ -1710,7 +1699,6 @@ b11111111010100 aabac
b10000000000000010000010111110001 aabct b10000000000000010000010111110001 aabct
b11111111010100 aabcw b11111111010100 aabcw
b11111111010100 aabdc b11111111010100 aabdc
r0.0 bbbbb
#1444438324 #1444438324
1aaaar 1aaaar

View File

@ -13,8 +13,6 @@ package com.minres.scviewer.database.text;
import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetDecoder;
import java.util.Collection; import java.util.Collection;
import java.util.zip.GZIPInputStream import java.util.zip.GZIPInputStream
import org.apache.jdbm.DB
import org.apache.jdbm.DBMaker
import groovy.io.FileType import groovy.io.FileType
import com.minres.scviewer.database.AssociationType import com.minres.scviewer.database.AssociationType
@ -32,8 +30,6 @@ public class TextDbLoader implements IWaveformDbLoader{
IWaveformDb db; IWaveformDb db;
DB backingDb;
def streams = [] def streams = []
def relationTypes=[:] def relationTypes=[:]
@ -65,20 +61,6 @@ public class TextDbLoader implements IWaveformDbLoader{
this.streams=[] this.streams=[]
def gzipped = isGzipped(file) def gzipped = isGzipped(file)
if(isTxfile(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))){ if(isTxfile(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))){
if(true) {
def parentDir=file.absoluteFile.parent
def filename=file.name
new File(parentDir).eachFileRecurse (FileType.FILES) { f -> if(f.name=~/^\.${filename}/) f.delete() }
this.backingDb = DBMaker.openFile(parentDir+File.separator+"."+filename+"_bdb")
.deleteFilesAfterClose()
.useRandomAccessFile()
.setMRUCacheSize(4096)
//.disableTransactions()
.disableLocking()
.make();
} else {
this.backingDb = DBMaker.openMemory().disableLocking().make()
}
parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file)) parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))
calculateConcurrencyIndicees() calculateConcurrencyIndicees()
return true return true
@ -140,7 +122,7 @@ public class TextDbLoader implements IWaveformDbLoader{
case "end_attribute": case "end_attribute":
if ((matcher = line =~ /^scv_tr_stream\s+\(ID (\d+),\s+name\s+"([^"]+)",\s+kind\s+"([^"]+)"\)$/)) { if ((matcher = line =~ /^scv_tr_stream\s+\(ID (\d+),\s+name\s+"([^"]+)",\s+kind\s+"([^"]+)"\)$/)) {
def id = Integer.parseInt(matcher[0][1]) def id = Integer.parseInt(matcher[0][1])
def stream = new TxStream(db, id, matcher[0][2], matcher[0][3], backingDb) def stream = new TxStream(db, id, matcher[0][2], matcher[0][3])
streams<<stream streams<<stream
streamsById[id]=stream streamsById[id]=stream
} else if ((matcher = line =~ /^scv_tr_generator\s+\(ID\s+(\d+),\s+name\s+"([^"]+)",\s+scv_tr_stream\s+(\d+),$/)) { } else if ((matcher = line =~ /^scv_tr_generator\s+\(ID\s+(\d+),\s+name\s+"([^"]+)",\s+scv_tr_stream\s+(\d+),$/)) {
@ -204,9 +186,6 @@ public class TextDbLoader implements IWaveformDbLoader{
} }
lineCnt++ lineCnt++
if((lineCnt%1000) == 0) {
backingDb.commit()
}
} }
} }

View File

@ -43,15 +43,14 @@ class TxStream extends HierNode implements ITxStream {
private TreeMap<Long, List<ITxEvent>> events private TreeMap<Long, List<ITxEvent>> events
TxStream(IWaveformDb db, int id, String name, String kind, DB backingStore){ TxStream(IWaveformDb db, int id, String name, String kind){
super(name) super(name)
this.id=id this.id=id
this.database=db this.database=db
this.fullName=name this.fullName=name
this.kind=kind this.kind=kind
this.maxConcurrency=0 this.maxConcurrency=0
//events = new TreeMap<Long, List<ITxEvent>>() events = new TreeMap<Long, List<ITxEvent>>()
events=backingStore.createTreeMap("stream-"+name)
} }
List<ITxGenerator> getGenerators(){ List<ITxGenerator> getGenerators(){

View File

@ -10,9 +10,8 @@
*******************************************************************************/ *******************************************************************************/
package com.minres.scviewer.database.swt.internal; package com.minres.scviewer.database.swt.internal;
import java.util.Map.Entry;
import java.util.Collection; import java.util.Collection;
import java.util.Map; import java.util.Map.Entry;
import java.util.NavigableMap; import java.util.NavigableMap;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -26,9 +25,9 @@ import org.eclipse.swt.graphics.Rectangle;
import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignal;
import com.minres.scviewer.database.ISignalChange; import com.minres.scviewer.database.ISignalChange;
import com.minres.scviewer.database.ISignalChangeBit;
import com.minres.scviewer.database.ISignalChangeBitVector; import com.minres.scviewer.database.ISignalChangeBitVector;
import com.minres.scviewer.database.ISignalChangeReal; import com.minres.scviewer.database.ISignalChangeReal;
import com.minres.scviewer.database.ISignalChangeBit;
import com.minres.scviewer.database.ui.TrackEntry; import com.minres.scviewer.database.ui.TrackEntry;
import com.minres.scviewer.database.ui.WaveformColors; import com.minres.scviewer.database.ui.WaveformColors;
@ -110,7 +109,6 @@ public class SignalPainter extends TrackPainter {
NavigableMap<Long, ? extends ISignalChange> entries = signal.getEvents().subMap(first.getKey(), false, last.getKey(), true); NavigableMap<Long, ? extends ISignalChange> entries = signal.getEvents().subMap(first.getKey(), false, last.getKey(), true);
SignalChange left = new SignalChange(first); SignalChange left = new SignalChange(first);
SignalChange right = new SignalChange(entries.size() > 0 ? entries.firstEntry() : first); SignalChange right = new SignalChange(entries.size() > 0 ? entries.firstEntry() : first);
maxX = area.x + area.width; maxX = area.x + area.width;
yOffsetT = this.waveCanvas.getTrackHeight() / 5 + area.y; yOffsetT = this.waveCanvas.getTrackHeight() / 5 + area.y;
yOffsetM = this.waveCanvas.getTrackHeight() / 2 + area.y; yOffsetM = this.waveCanvas.getTrackHeight() / 2 + area.y;
@ -124,7 +122,6 @@ public class SignalPainter extends TrackPainter {
// b) left to close to right // b) left to close to right
if (left.time == right.time) { if (left.time == right.time) {
right.time = endTime; right.time = endTime;
} else { } else {
multiple = true; multiple = true;
long eTime = (xBegin + 1) * this.waveCanvas.getScaleFactor(); long eTime = (xBegin + 1) * this.waveCanvas.getScaleFactor();
@ -147,7 +144,9 @@ public class SignalPainter extends TrackPainter {
if (xEnd == xBegin) { if (xEnd == xBegin) {
multiple = true; multiple = true;
long eTime = (xBegin + 1) * this.waveCanvas.getScaleFactor(); long eTime = (xBegin + 1) * this.waveCanvas.getScaleFactor();
right.set(entries.floorEntry(eTime), endTime); Entry<Long, ? extends ISignalChange> entry = entries.floorEntry(eTime);
if(entry!=null && entry.getKey()> right.time)
right.set(entry, endTime);
xEnd = getXEnd(eTime); xEnd = getXEnd(eTime);
} }
} while (left.time < endTime); } while (left.time < endTime);
@ -269,9 +268,86 @@ public class SignalPainter extends TrackPainter {
} }
} }
} }
} }
/*
private class RealStencil implements SignalStencil {
double min;
double max;
double diff;
public RealStencil(ISignalChange value, NavigableMap<Long, ? extends ISignalChange> entries) {
min=((ISignalChangeReal) value).getValue();
max=min;
for (ISignalChange e : entries.values()) {
double v = ((ISignalChangeReal)e).getValue();
max= Double.isNaN(max)? v : Math.max(max, v);
min= Double.isNaN(min)? v : Math.min(min, v);
}
int nans = (Double.isNaN(max)?2:0) + (Double.isNaN(max)?1:0);
switch(nans) {
case 0:
break;
case 1:
max=min;
break;
case 2:
min=max;
case 3:
max=min=0;
}
diff=max-min;
if(diff==0.0) {
if(max>0)
min=0.0;
else if(min<0.0)
max=0.0;
else {
max=1.0;
min=0.0;
}
diff=max-min;
}
}
public void draw(GC gc, Rectangle area, ISignalChange left, ISignalChange right, int xBegin, int xEnd, boolean multiple) {
double value = ((ISignalChangeReal)left).getValue();
if(Double.isNaN(value)) {
Color color = waveCanvas.colors[WaveformColors.SIGNAL_NAN.ordinal()];
int width = xEnd - xBegin;
if (width > 1) {
int[] points = {
xBegin, yOffsetT,
xEnd, yOffsetT,
xEnd, yOffsetB,
xBegin, yOffsetB
};
gc.setForeground(color);
gc.drawPolygon(points);
gc.setBackground(color);
gc.fillPolygon(points);
} else {
gc.setForeground(color);
gc.drawLine(xEnd, yOffsetT, xEnd, yOffsetB);
}
} else {
Color color = waveCanvas.colors[WaveformColors.SIGNAL_ANALOG.ordinal()];
int height=yOffsetT-yOffsetB;
double offset=value-min;
int yOffset=diff>0?(int)(height*(offset/diff)) + yOffsetB:yOffsetM;
gc.setForeground(color);
if (xEnd > maxX) {
gc.drawLine(xBegin, yOffset, maxX, yOffset);
} else {
gc.drawLine(xBegin, yOffset, xEnd, yOffset);
double nextOffset = ((ISignalChangeReal)right).getValue()-min;
int yNext = diff>0?(int)(height*(nextOffset/diff)) + yOffsetB:height/2;
if (yOffset != yNext)
gc.drawLine(xEnd, yOffset, xEnd, yNext);
}
}
}
}
*/
private class RealStencil implements SignalStencil { private class RealStencil implements SignalStencil {
double minVal, range; double minVal, range;

View File

@ -110,6 +110,17 @@ public class StreamPainter extends TrackPainter{
gc.fillRectangle(bb); gc.fillRectangle(bb);
gc.drawRectangle(bb); gc.drawRectangle(bb);
} else { } else {
// adjusting drawing width to circumvent issues in canvas algos
if(bb.x < area.x) {
bb.width = bb.width-(area.x-bb.x)+5;
bb.x=area.x-5;
}
int bb_x2 = bb.x+bb.width;
int area_x2 = area.x+area.width;
if(bb_x2>area_x2){
bb_x2=area_x2+5;
bb.width= bb_x2-bb.x;
}
gc.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5); gc.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
gc.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5); gc.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
} }

View File

@ -56,7 +56,7 @@ public class WaveformCanvas extends Canvas {
private int level = 12; private int level = 12;
public final static String[] unitString={"fs", "ps", "ns", "µs", "ms"};//, "s"}; public final static String[] unitString={"fs", "ps", "ns", "us", "ms"};//, "s"};
public final static int[] unitMultiplier={1, 3, 10, 30, 100, 300}; public final static int[] unitMultiplier={1, 3, 10, 30, 100, 300};
@ -142,6 +142,7 @@ public class WaveformCanvas extends Canvas {
colors[WaveformColors.SIGNALU.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW); colors[WaveformColors.SIGNALU.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW);
colors[WaveformColors.SIGNAL_TEXT.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_WHITE); colors[WaveformColors.SIGNAL_TEXT.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_WHITE);
colors[WaveformColors.SIGNAL_REAL.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW); colors[WaveformColors.SIGNAL_REAL.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW);
colors[WaveformColors.SIGNAL_NAN.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED);
colors[WaveformColors.CURSOR.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED); colors[WaveformColors.CURSOR.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED);
colors[WaveformColors.CURSOR_DRAG.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GRAY); colors[WaveformColors.CURSOR_DRAG.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GRAY);
colors[WaveformColors.CURSOR_TEXT.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_WHITE); colors[WaveformColors.CURSOR_TEXT.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_WHITE);

View File

@ -13,7 +13,6 @@ package com.minres.scviewer.database.swt.internal;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;

View File

@ -14,7 +14,7 @@ public enum WaveformColors {
LINE, LINE_HIGHLITE, LINE, LINE_HIGHLITE,
TRACK_BG_EVEN, TRACK_BG_ODD, TRACK_BG_HIGHLITE, TRACK_BG_EVEN, TRACK_BG_ODD, TRACK_BG_HIGHLITE,
TX_BG, TX_BG_HIGHLITE, TX_BORDER, TX_BG, TX_BG_HIGHLITE, TX_BORDER,
SIGNAL0, SIGNAL1, SIGNALZ, SIGNALX, SIGNALU, SIGNAL_TEXT, SIGNAL_REAL, SIGNAL0, SIGNAL1, SIGNALZ, SIGNALX, SIGNALU, SIGNAL_TEXT, SIGNAL_REAL, SIGNAL_NAN,
CURSOR, CURSOR_DRAG, CURSOR_TEXT, CURSOR, CURSOR_DRAG, CURSOR_TEXT,
MARKER, MARKER_TEXT, REL_ARROW, REL_ARROW_HIGHLITE MARKER, MARKER_TEXT, REL_ARROW, REL_ARROW_HIGHLITE
} }

View File

@ -52,7 +52,7 @@ public interface IVCDDatabaseBuilder {
* *
* @param netId the int value * @param netId the int value
* @param currentTime the current time in ps * @param currentTime the current time in ps
* @param decodedValues the decoded values * @param decodedValues the decoded bit values
*/ */
public void appendTransition(int netId, long currentTime, char decodedValue); public void appendTransition(int netId, long currentTime, char decodedValue);

View File

@ -184,7 +184,7 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder {
@Override @Override
public void appendTransition(int signalId, long currentTime, char decodedValues) { public void appendTransition(int signalId, long currentTime, char decodedValues) {
VCDSignal<? extends IWaveformEvent> signal = (VCDSignal<? extends IWaveformEvent>) signals.get(signalId); VCDSignal<? extends IWaveformEvent> signal = (VCDSignal<? extends IWaveformEvent>) signals.get(signalId);
Long time = currentTime* TIME_RES; Long time = currentTime*TIME_RES;
if(signal.getWidth()==1){ if(signal.getWidth()==1){
((VCDSignal<ISignalChangeBit>)signal).values.put(time, new VCDSignalChangeBit(time, decodedValues)); ((VCDSignal<ISignalChangeBit>)signal).values.put(time, new VCDSignalChangeBit(time, decodedValues));
} }

View File

@ -149,6 +149,7 @@ class VCDFileParser {
if (tokenizer.sval.charAt(0) == '#') { // If the line begins with a #, this is a timestamp. if (tokenizer.sval.charAt(0) == '#') { // If the line begins with a #, this is a timestamp.
currentTime = Long.parseLong(tokenizer.sval.substring(1)) * picoSecondsPerIncrement; currentTime = Long.parseLong(tokenizer.sval.substring(1)) * picoSecondsPerIncrement;
} else { } else {
boolean isReal=false;
if(tokenizer.sval.equals("$comment")){ if(tokenizer.sval.equals("$comment")){
do { do {
if (!nextToken()) return false; if (!nextToken()) return false;

View File

@ -17,6 +17,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -55,8 +56,11 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.ITx;
@ -79,6 +83,7 @@ import com.minres.scviewer.e4.application.internal.util.IFileChangeListener;
import com.minres.scviewer.e4.application.internal.util.IModificationChecker; import com.minres.scviewer.e4.application.internal.util.IModificationChecker;
import com.minres.scviewer.e4.application.preferences.DefaultValuesInitializer; import com.minres.scviewer.e4.application.preferences.DefaultValuesInitializer;
import com.minres.scviewer.e4.application.preferences.PreferenceConstants; import com.minres.scviewer.e4.application.preferences.PreferenceConstants;
//import com.minres.scviewer.database.swt.internal.WaveformCanvas;
/** /**
* The Class WaveformViewerPart. * The Class WaveformViewerPart.
@ -727,6 +732,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
* @param level the new zoom level * @param level the new zoom level
*/ */
public void setZoomLevel(Integer level) { public void setZoomLevel(Integer level) {
//System.out.println("setZoomLevel() - ZoomLevel: " + level);
if (level < 0) if (level < 0)
level = 0; level = 0;
if (level > zoomLevel.length - 1) if (level > zoomLevel.length - 1)
@ -735,11 +741,43 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
updateAll(); updateAll();
} }
//FIXME: need to use unitString and unitMultiplier from class WaveformCanvas which is located in >com.minres.scviewer.database.swt.internal.
//Trying to import com.minres.scviewer.database.swt.internal.WaveformCanvas results in the error:
//'Access restriction: The type 'WaveformCanvas' is not API (restriction on required project 'com.minres.scviewer.database.ui.swt')'.
public final static String[] unitString={"fs", "ps", "ns", "µs", "ms"};//, "s"};
public final static int[] unitMultiplier={1, 3, 10, 30, 100, 300};
/** /**
* Sets the zoom fit. * Sets the zoom fit.
*/ */
public void setZoomFit() { public void setZoomFit() {
waveformPane.setZoomLevel(6);
//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;
//System.out.println("ZoomLevel[] Array (Length " + zoomLevel.length + "): " + Arrays.toString(zoomLevel));
//System.out.println("ClientArea myParent: " + myParent.getClientArea());
//System.out.println("MaxTime: " + maxTime);
//System.out.println("clientAreaWidth: " + clientAreaWidth);
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<unitMultiplier.length*unitString.length; level++){
long scaleFactor = (long) Math.pow(10, level/2);
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(unitMultiplier.length*unitString.length-1);
updateAll(); updateAll();
} }

View File

@ -41,11 +41,13 @@ public class DefaultValuesInitializer extends AbstractPreferenceInitializer {
colors[WaveformColors.TX_BG.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GREEN); colors[WaveformColors.TX_BG.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GREEN);
colors[WaveformColors.TX_BG_HIGHLITE.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN); colors[WaveformColors.TX_BG_HIGHLITE.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN);
colors[WaveformColors.TX_BORDER.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED); colors[WaveformColors.TX_BORDER.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED);
colors[WaveformColors.SIGNAL0.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN); colors[WaveformColors.SIGNAL0.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GREEN);
colors[WaveformColors.SIGNAL1.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN); colors[WaveformColors.SIGNAL1.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GREEN);
colors[WaveformColors.SIGNALZ.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW); colors[WaveformColors.SIGNALZ.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW);
colors[WaveformColors.SIGNALX.ordinal()] = SWTResourceManager.getColor(255, 51, 51); colors[WaveformColors.SIGNALX.ordinal()] = SWTResourceManager.getColor(255, 51, 51);
colors[WaveformColors.SIGNALU.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_DARK_YELLOW); colors[WaveformColors.SIGNALU.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_DARK_YELLOW);
colors[WaveformColors.SIGNAL_REAL.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_YELLOW);
colors[WaveformColors.SIGNAL_NAN.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED);
colors[WaveformColors.SIGNAL_TEXT.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_WHITE); colors[WaveformColors.SIGNAL_TEXT.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_WHITE);
colors[WaveformColors.CURSOR.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED); colors[WaveformColors.CURSOR.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_RED);
colors[WaveformColors.CURSOR_DRAG.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GRAY); colors[WaveformColors.CURSOR_DRAG.ordinal()] = SWTResourceManager.getColor(SWT.COLOR_GRAY);

View File

@ -20,7 +20,7 @@ import org.eclipse.wb.swt.ResourceManager;
import com.minres.scviewer.database.IHierNode; import com.minres.scviewer.database.IHierNode;
import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignal;
import com.minres.scviewer.database.ISignalChangeMulti; import com.minres.scviewer.database.ISignalChangeBitVector;
import com.minres.scviewer.database.ITxStream; import com.minres.scviewer.database.ITxStream;
import com.minres.scviewer.database.IWaveformDb; import com.minres.scviewer.database.IWaveformDb;
import com.minres.scviewer.e4.application.parts.LoadingWaveformDb; import com.minres.scviewer.e4.application.parts.LoadingWaveformDb;
@ -101,7 +101,7 @@ public class TxDbLabelProvider implements ILabelProvider {
return stream; return stream;
}else if(element instanceof ISignal<?>){ }else if(element instanceof ISignal<?>){
Object o = ((ISignal<?>)element).getEvents().firstEntry().getValue(); Object o = ((ISignal<?>)element).getEvents().firstEntry().getValue();
if(o instanceof ISignalChangeMulti) if(o instanceof ISignalChangeBitVector)
return wave; return wave;
else else
return signal; return signal;

View File

@ -33,6 +33,7 @@
</win> </win>
</launcher> </launcher>
<vm> <vm>
</vm> </vm>
@ -72,8 +73,10 @@
<plugin id="org.eclipse.core.expressions"/> <plugin id="org.eclipse.core.expressions"/>
<plugin id="org.eclipse.core.filesystem"/> <plugin id="org.eclipse.core.filesystem"/>
<plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/> <plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.win32.x86_64" fragment="true"/>
<plugin id="org.eclipse.core.jobs"/> <plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.resources"/> <plugin id="org.eclipse.core.resources"/>
<plugin id="org.eclipse.core.resources.win32.x86_64" fragment="true"/>
<plugin id="org.eclipse.core.runtime"/> <plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.e4.core.commands"/> <plugin id="org.eclipse.e4.core.commands"/>
<plugin id="org.eclipse.e4.core.contexts"/> <plugin id="org.eclipse.e4.core.contexts"/>
@ -118,6 +121,7 @@
<plugin id="org.eclipse.pde.ds.lib"/> <plugin id="org.eclipse.pde.ds.lib"/>
<plugin id="org.eclipse.swt"/> <plugin id="org.eclipse.swt"/>
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/> <plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
<plugin id="org.w3c.css.sac"/> <plugin id="org.w3c.css.sac"/>
<plugin id="org.w3c.dom.events"/> <plugin id="org.w3c.dom.events"/>
<plugin id="org.w3c.dom.smil"/> <plugin id="org.w3c.dom.smil"/>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="Neon Platform" sequenceNumber="138">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.300.v20161122-1740"/>
<unit id="org.eclipse.platform.sdk" version="4.6.2.M20161124-1400"/>
<unit id="org.eclipse.rcp.sdk.id" version="4.6.2.M20161124-1400"/>
<unit id="org.eclipse.rcptt.core.feature.group" version="2.1.0.201604261352"/>
<repository location="http://download.eclipse.org/releases/neon"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.codehaus.groovy24.feature.feature.group" version="2.9.3.xx-201806261157-e46"/>
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.6"/>
</location>
</locations>
<environment>
<arch>x86_64</arch>
<nl>de_DE</nl>
</environment>
<launcherArgs>
<vmArgs>-Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=256 -Xms40m -Xmx2G </vmArgs>
</launcherArgs>
</target>

View File

@ -6,6 +6,8 @@
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/> <unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.rcp.sdk.id" version="0.0.0"/> <unit id="org.eclipse.rcp.sdk.id" version="0.0.0"/>
<unit id="org.eclipse.rcptt.core.feature.group" version="0.0.0"/> <unit id="org.eclipse.rcptt.core.feature.group" version="0.0.0"/>
<unit id="org.eclipse.e4.rcp.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/releases/photon"/> <repository location="http://download.eclipse.org/releases/photon"/>
</location> </location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">

View File

@ -1,2 +1,3 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
groovy.compiler.level=26 groovy.compiler.level=26
groovy.script.filters=**/*.dsld,y,**/*.gradle,n