Adapted application to data model changes

This commit is contained in:
Eyck Jentzsch 2018-11-05 18:23:17 +01:00
parent 93fd192782
commit bcf4e1a274
25 changed files with 318 additions and 144 deletions

View File

@ -10,6 +10,8 @@
*******************************************************************************/ *******************************************************************************/
package com.minres.scviewer.database.swt.internal; package com.minres.scviewer.database.swt.internal;
import java.text.DecimalFormat;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.GC;
@ -22,6 +24,8 @@ public class RulerPainter implements IPainter {
static final int rulerTickMinorC = 10; static final int rulerTickMinorC = 10;
static final int rulerTickMajorC = 100; static final int rulerTickMajorC = 100;
static final DecimalFormat df = new DecimalFormat("#.00####");
public RulerPainter(WaveformCanvas waveCanvas) { public RulerPainter(WaveformCanvas waveCanvas) {
this.waveCanvas=waveCanvas; this.waveCanvas=waveCanvas;
} }
@ -64,7 +68,7 @@ public class RulerPainter implements IPainter {
for (long tick = startMinorIncr; tick < end; tick += rulerTickMinor) { for (long tick = startMinorIncr; tick < end; tick += rulerTickMinor) {
int x0 = (int) (tick/scaleFactor); int x0 = (int) (tick/scaleFactor);
if ((tick % rulerTickMajor) == 0) { if ((tick % rulerTickMajor) == 0) {
gc.drawText(Double.toString(tick/scaleFactor*unitMultiplier)+unit, x0, area.y+textY); gc.drawText(df.format(tick/scaleFactor*unitMultiplier)+unit, x0, area.y+textY);
gc.drawLine(x0, area.y+majorTickY, x0,area.y+ bottom); gc.drawLine(x0, area.y+majorTickY, x0,area.y+ bottom);
} else { } else {
gc.drawLine(x0, area.y+minorTickY, x0, area.y+bottom); gc.drawLine(x0, area.y+minorTickY, x0, area.y+bottom);

View File

@ -23,27 +23,24 @@ import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.graphics.Rectangle;
import com.minres.scviewer.database.BitVector;
import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignal;
import com.minres.scviewer.database.ISignalChange;
import com.minres.scviewer.database.ISignalChangeBit;
import com.minres.scviewer.database.ISignalChangeBitVector;
import com.minres.scviewer.database.ISignalChangeReal;
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;
public class SignalPainter extends TrackPainter { public class SignalPainter extends TrackPainter {
private class SignalChange { private class SignalChange {
long time; long time;
ISignalChange value; Object value;
boolean fromMap; boolean fromMap;
public SignalChange(Entry<Long, ? extends ISignalChange> entry) { public SignalChange(Entry<Long, ?> entry) {
time = entry.getKey(); time = entry.getKey();
value = entry.getValue(); value = entry.getValue();
fromMap = true; fromMap = true;
} }
public void set(Entry<Long, ? extends ISignalChange> entry, Long actTime) { public void set(Entry<Long, ?> entry, Long actTime) {
if (entry != null) { if (entry != null) {
time = entry.getKey(); time = entry.getKey();
value = entry.getValue(); value = entry.getValue();
@ -84,7 +81,7 @@ public class SignalPainter extends TrackPainter {
} }
public void paintArea(GC gc, Rectangle area) { public void paintArea(GC gc, Rectangle area) {
ISignal<? extends ISignalChange> signal = trackEntry.getSignal(); ISignal<?> signal = trackEntry.getSignal();
if (trackEntry.selected) if (trackEntry.selected)
gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]); gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
else else
@ -93,8 +90,8 @@ public class SignalPainter extends TrackPainter {
gc.fillRectangle(area); gc.fillRectangle(area);
long beginTime = area.x * this.waveCanvas.getScaleFactor(); long beginTime = area.x * this.waveCanvas.getScaleFactor();
long endTime = (area.x + area.width) * this.waveCanvas.getScaleFactor(); long endTime = (area.x + area.width) * this.waveCanvas.getScaleFactor();
Entry<Long, ? extends ISignalChange> first = signal.getEvents().floorEntry(beginTime); Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
Entry<Long, ? extends ISignalChange> last = signal.getEvents().floorEntry(endTime); Entry<Long, ?> last = signal.getEvents().floorEntry(endTime);
if (first == null) { if (first == null) {
if (last == null) if (last == null)
return; return;
@ -105,7 +102,7 @@ public class SignalPainter extends TrackPainter {
gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]); gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
gc.setLineStyle(SWT.LINE_SOLID); gc.setLineStyle(SWT.LINE_SOLID);
gc.setLineWidth(1); gc.setLineWidth(1);
NavigableMap<Long, ? extends ISignalChange> entries = signal.getEvents().subMap(first.getKey(), false, last.getKey(), true); NavigableMap<Long, ?> 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;
@ -143,7 +140,7 @@ 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();
Entry<Long, ? extends ISignalChange> entry = entries.floorEntry(eTime); Entry<Long, ?> entry = entries.floorEntry(eTime);
if(entry!=null && entry.getKey()> right.time) if(entry!=null && entry.getKey()> right.time)
right.set(entry, endTime); right.set(entry, endTime);
xEnd = getXEnd(eTime); xEnd = getXEnd(eTime);
@ -151,17 +148,19 @@ public class SignalPainter extends TrackPainter {
} while (left.time < endTime); } while (left.time < endTime);
} }
private SignalStencil getStencil(GC gc, SignalChange left, NavigableMap<Long, ? extends ISignalChange> entries) { private SignalStencil getStencil(GC gc, SignalChange left, NavigableMap<Long, ?> entries) {
if(left.value instanceof ISignalChangeBit) Object val = left.value;
return new SingleBitStencil(); if(val instanceof BitVector) {
else if (left.value instanceof ISignalChangeBitVector) BitVector bv = (BitVector) val;
if(bv.getWidth()==1)
return new SingleBitStencil();
if(trackEntry.waveDisplay==TrackEntry.WaveDisplay.DEFAULT) if(trackEntry.waveDisplay==TrackEntry.WaveDisplay.DEFAULT)
return new MultiBitStencil(gc); return new MultiBitStencil(gc);
else else
return new MultiBitStencilAnalog(entries, left.value, return new MultiBitStencilAnalog(entries, left.value,
trackEntry.waveDisplay==TrackEntry.WaveDisplay.CONTINOUS, trackEntry.waveDisplay==TrackEntry.WaveDisplay.CONTINOUS,
trackEntry.valueDisplay==TrackEntry.ValueDisplay.SIGNED); trackEntry.valueDisplay==TrackEntry.ValueDisplay.SIGNED);
else if (left.value instanceof ISignalChangeReal) } else if (val instanceof Double)
return new RealStencil(entries, left.value, trackEntry.waveDisplay==TrackEntry.WaveDisplay.CONTINOUS); return new RealStencil(entries, left.value, trackEntry.waveDisplay==TrackEntry.WaveDisplay.CONTINOUS);
else else
return null; return null;
@ -169,7 +168,7 @@ public class SignalPainter extends TrackPainter {
private interface SignalStencil { private interface SignalStencil {
public void draw(GC gc, Rectangle area, ISignalChange left, ISignalChange right, int xBegin, int xEnd, boolean multiple); public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple);
} }
private class MultiBitStencil implements SignalStencil { private class MultiBitStencil implements SignalStencil {
@ -183,9 +182,10 @@ public class SignalPainter extends TrackPainter {
tmpAwtFont = new java.awt.Font(fd.getName(), fd.getStyle(), height); tmpAwtFont = new java.awt.Font(fd.getName(), fd.getStyle(), height);
} }
public void draw(GC gc, Rectangle area, ISignalChange left, ISignalChange right, int xBegin, int xEnd, boolean multiple) { @SuppressWarnings("unchecked")
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
Color colorBorder = waveCanvas.colors[WaveformColors.SIGNAL0.ordinal()]; Color colorBorder = waveCanvas.colors[WaveformColors.SIGNAL0.ordinal()];
ISignalChangeBitVector last = (ISignalChangeBitVector) left; BitVector last = (BitVector) left;
if (last.getValue().toString().contains("X")) { if (last.getValue().toString().contains("X")) {
colorBorder = waveCanvas.colors[WaveformColors.SIGNALX.ordinal()]; colorBorder = waveCanvas.colors[WaveformColors.SIGNALX.ordinal()];
} else if (last.getValue().toString().contains("Z")) { } else if (last.getValue().toString().contains("Z")) {
@ -208,13 +208,13 @@ public class SignalPainter extends TrackPainter {
String label = null; String label = null;
switch(trackEntry.valueDisplay) { switch(trackEntry.valueDisplay) {
case SIGNED: case SIGNED:
label=Long.toString(last.getValue().toSignedValue()); label=Long.toString(last.toSignedValue());
break; break;
case UNSIGNED: case UNSIGNED:
label=Long.toString(last.getValue().toUnsignedValue()); label=Long.toString(last.toUnsignedValue());
break; break;
default: default:
label="h'"+last.getValue().toHexString(); label="h'"+last.toHexString();
} }
Point bb = getBoxWidth(gc, label); Point bb = getBoxWidth(gc, label);
if (xBegin < area.x) { if (xBegin < area.x) {
@ -245,16 +245,15 @@ public class SignalPainter extends TrackPainter {
private long minVal; private long minVal;
private long range; private long range;
@SuppressWarnings("unchecked") public MultiBitStencilAnalog(NavigableMap<Long, ?> entries, Object left, boolean continous, boolean signed) {
public MultiBitStencilAnalog(NavigableMap<Long, ? extends ISignalChange> entries, ISignalChange left, boolean continous, boolean signed) {
this.continous=continous; this.continous=continous;
Collection<ISignalChangeBitVector> values = ((NavigableMap<Long, ISignalChangeBitVector>) entries).values(); Collection<?> values = ((NavigableMap<Long, ?>) entries).values();
minVal=((ISignalChangeBitVector) left).getValue().toUnsignedValue(); minVal=((BitVector) left).toUnsignedValue();
range=2; range=2;
if(!values.isEmpty()) { if(!values.isEmpty()) {
long maxVal=minVal; long maxVal=minVal;
for (ISignalChange e : entries.values()) { for (Object e : entries.values()) {
long v = ((ISignalChangeBitVector)e).getValue().toUnsignedValue(); long v = ((BitVector)e).toUnsignedValue();
maxVal=Math.max(maxVal, v); maxVal=Math.max(maxVal, v);
minVal=Math.min(minVal, v); minVal=Math.min(minVal, v);
} }
@ -268,9 +267,10 @@ public class SignalPainter extends TrackPainter {
} }
public void draw(GC gc, Rectangle area, ISignalChange left, ISignalChange right, int xBegin, int xEnd, boolean multiple) { @SuppressWarnings("unchecked")
long leftVal = ((ISignalChangeBitVector) left).getValue().toUnsignedValue(); public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
long rightVal= ((ISignalChangeBitVector) right).getValue().toUnsignedValue(); long leftVal = ((BitVector) left).toUnsignedValue();
long rightVal= ((BitVector) right).toUnsignedValue();
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]); gc.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT)); int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
int yOffsetRight = (int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT)); int yOffsetRight = (int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
@ -294,7 +294,8 @@ public class SignalPainter extends TrackPainter {
} }
private class SingleBitStencil implements SignalStencil { private class SingleBitStencil implements SignalStencil {
public void draw(GC gc, Rectangle area, ISignalChange left, ISignalChange right, int xBegin, int xEnd, boolean multiple) { @SuppressWarnings("unchecked")
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
if (multiple) { if (multiple) {
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNALU.ordinal()]); gc.setForeground(waveCanvas.colors[WaveformColors.SIGNALU.ordinal()]);
gc.drawLine(xBegin, yOffsetT, xBegin, yOffsetB); gc.drawLine(xBegin, yOffsetT, xBegin, yOffsetB);
@ -303,7 +304,7 @@ public class SignalPainter extends TrackPainter {
} else { } else {
Color color = waveCanvas.colors[WaveformColors.SIGNALX.ordinal()]; Color color = waveCanvas.colors[WaveformColors.SIGNALX.ordinal()];
int yOffset = yOffsetM; int yOffset = yOffsetM;
switch (((ISignalChangeBit) left).getValue()) { switch (((BitVector) left).getValue()[0]) {
case '1': case '1':
color = waveCanvas.colors[WaveformColors.SIGNAL1.ordinal()]; color = waveCanvas.colors[WaveformColors.SIGNAL1.ordinal()];
yOffset = yOffsetT; yOffset = yOffsetT;
@ -323,7 +324,7 @@ public class SignalPainter extends TrackPainter {
} else { } else {
gc.drawLine(xBegin, yOffset, xEnd, yOffset); gc.drawLine(xBegin, yOffset, xEnd, yOffset);
int yNext = yOffsetM; int yNext = yOffsetM;
switch (((ISignalChangeBit) right).getValue()) { switch (((BitVector) right).getValue()[0]) {
case '1': case '1':
yNext = yOffsetT; yNext = yOffsetT;
break; break;
@ -347,16 +348,15 @@ public class SignalPainter extends TrackPainter {
boolean continous=true; boolean continous=true;
@SuppressWarnings("unchecked") public RealStencil(NavigableMap<Long, ?> entries, Object left, boolean continous) {
public RealStencil(NavigableMap<Long, ? extends ISignalChange> entries, ISignalChange left, boolean continous) {
this.continous=continous; this.continous=continous;
Collection<ISignalChangeReal> values = ((NavigableMap<Long, ISignalChangeReal>) entries).values(); Collection<?> values = ((NavigableMap<Long, ?>) entries).values();
minVal=((ISignalChangeReal) left).getValue(); minVal=(Double) left;
range=2.0; range=2.0;
if(!values.isEmpty()) { if(!values.isEmpty()) {
double maxVal=minVal; double maxVal=minVal;
for (ISignalChange e : entries.values()) { for (Object e : entries.values()) {
double v = ((ISignalChangeReal)e).getValue(); double v = ((Double)e);
if(Double.isNaN(maxVal)) if(Double.isNaN(maxVal))
maxVal=v; maxVal=v;
else if(!Double.isNaN(v)) else if(!Double.isNaN(v))
@ -375,9 +375,10 @@ public class SignalPainter extends TrackPainter {
} }
} }
public void draw(GC gc, Rectangle area, ISignalChange left, ISignalChange right, int xBegin, int xEnd, boolean multiple) { @SuppressWarnings("unchecked")
double leftVal = ((ISignalChangeReal) left).getValue(); public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
double rightVal= ((ISignalChangeReal) right).getValue(); double leftVal = (Double) left;
double rightVal= (Double) right;
if(Double.isNaN(leftVal)) { if(Double.isNaN(leftVal)) {
Color color = waveCanvas.colors[WaveformColors.SIGNAL_NAN.ordinal()]; Color color = waveCanvas.colors[WaveformColors.SIGNAL_NAN.ordinal()];
int width = xEnd - xBegin; int width = xEnd - xBegin;

View File

@ -80,7 +80,7 @@ public class WaveformCanvas extends Canvas {
private List<CursorPainter> cursorPainters; private List<CursorPainter> cursorPainters;
HashMap<IWaveform<?>, IWaveformPainter> wave2painterMap; HashMap<IWaveform, IWaveformPainter> wave2painterMap;
/** /**
* Constructor for ScrollableCanvas. * Constructor for ScrollableCanvas.
* *
@ -438,7 +438,7 @@ public class WaveformCanvas extends Canvas {
return result; return result;
} }
public List<Object> getEntriesAtPosition(IWaveform<? extends IWaveformEvent> iWaveform, int i) { public List<Object> getEntriesAtPosition(IWaveform iWaveform, int i) {
LinkedList<Object> result=new LinkedList<>(); LinkedList<Object> result=new LinkedList<>();
int x = i - origin.x; int x = i - origin.x;
for(IPainter p: wave2painterMap.values()){ for(IPainter p: wave2painterMap.values()){
@ -481,7 +481,7 @@ public class WaveformCanvas extends Canvas {
} }
} }
public void reveal(IWaveform<? extends IWaveformEvent> waveform) { public void reveal(IWaveform waveform) {
for (IWaveformPainter painter : wave2painterMap.values()) { for (IWaveformPainter painter : wave2painterMap.values()) {
TrackEntry te = painter.getTrackEntry(); TrackEntry te = painter.getTrackEntry();
if(te.waveform == waveform) { if(te.waveform == waveform) {

View File

@ -13,6 +13,8 @@ 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.text.DecimalFormat;
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;
@ -70,11 +72,8 @@ import org.eclipse.swt.widgets.Widget;
import org.eclipse.wb.swt.SWTResourceManager; import org.eclipse.wb.swt.SWTResourceManager;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.minres.scviewer.database.BitVector;
import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignal;
import com.minres.scviewer.database.ISignalChange;
import com.minres.scviewer.database.ISignalChangeBitVector;
import com.minres.scviewer.database.ISignalChangeReal;
import com.minres.scviewer.database.ISignalChangeBit;
import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.ITx;
import com.minres.scviewer.database.ITxEvent; import com.minres.scviewer.database.ITxEvent;
import com.minres.scviewer.database.ITxRelation; import com.minres.scviewer.database.ITxRelation;
@ -95,6 +94,8 @@ public class WaveformViewer implements IWaveformViewer {
private PropertyChangeSupport pcs; private PropertyChangeSupport pcs;
static final DecimalFormat df = new DecimalFormat("#.00####");
private ITx currentTxSelection; private ITx currentTxSelection;
private TrackEntry currentWaveformSelection; private TrackEntry currentWaveformSelection;
@ -449,23 +450,27 @@ public class WaveformViewer implements IWaveformViewer {
final Long time = getCursorTime(); final Long time = getCursorTime();
for(TrackEntry entry:streams){ for(TrackEntry entry:streams){
if(entry.isSignal()){ if(entry.isSignal()){
ISignalChange event = ((ISignal<?>)entry.waveform).getWaveformEventsBeforeTime(time); ISignal<?> signal = (ISignal<?>) entry.waveform;
if(event instanceof ISignalChangeBit){ Object value = signal.getWaveformValueBeforeTime(time);
entry.currentValue="b'"+((ISignalChangeBit)event).getValue(); if(value instanceof BitVector){
} else if(event instanceof ISignalChangeBitVector){ BitVector bv = (BitVector) value;
// TODO: same code resides in SignalPainter, fix it if(bv.getWidth()==1)
switch(entry.valueDisplay) { entry.currentValue="b'"+bv;
case SIGNED: else {
entry.currentValue=Long.toString(((ISignalChangeBitVector)event).getValue().toSignedValue()); // TODO: same code resides in SignalPainter, fix it
break; switch(entry.valueDisplay) {
case UNSIGNED: case SIGNED:
entry.currentValue=Long.toString(((ISignalChangeBitVector)event).getValue().toUnsignedValue()); entry.currentValue=Long.toString(bv.toSignedValue());
break; break;
default: case UNSIGNED:
entry.currentValue="h'"+((ISignalChangeBitVector)event).getValue().toHexString(); entry.currentValue=Long.toString(bv.toUnsignedValue());
break;
default:
entry.currentValue="h'"+bv.toHexString();
}
} }
} else if(event instanceof ISignalChangeReal){ } else if(value instanceof Double){
double val = ((ISignalChangeReal)event).getValue(); Double val = (Double) value;
if(val>0.001) if(val>0.001)
entry.currentValue=String.format("%1$,.3f", val); entry.currentValue=String.format("%1$,.3f", val);
else else
@ -486,15 +491,13 @@ public class WaveformViewer implements IWaveformViewer {
} }
firstTx=stream.getEvents().lowerEntry(firstTx.getKey()); firstTx=stream.getEvents().lowerEntry(firstTx.getKey());
}while(firstTx!=null && !isArrayFull(resultsList)); }while(firstTx!=null && !isArrayFull(resultsList));
String value=null; entry.currentValue="";
boolean separator=false;
for(ITx o:resultsList){ for(ITx o:resultsList){
if(value==null) if(separator) entry.currentValue+="|";
value=new String(); if(o!=null) entry.currentValue+=((ITx)o).getGenerator().getName();
else separator=true;
value+="|";
if(o!=null) value+=((ITx)o).getGenerator().getName();
} }
entry.currentValue=value;
} }
} }
} }
@ -813,13 +816,13 @@ public class WaveformViewer implements IWaveformViewer {
Rectangle subArea = new Rectangle(rect.x, 0, rect.width, waveformCanvas.getTrackHeight()); Rectangle subArea = new Rectangle(rect.x, 0, rect.width, waveformCanvas.getTrackHeight());
if (lastKey == firstKey) { if (lastKey == firstKey) {
TrackEntry trackEntry=trackVerticalOffset.get(firstKey); TrackEntry trackEntry=trackVerticalOffset.get(firstKey);
IWaveform<? extends IWaveformEvent> w = trackEntry.waveform; IWaveform w = trackEntry.waveform;
if (w instanceof ITxStream<?>) if (w instanceof ITxStream<?>)
subArea.height *= ((ITxStream<?>) w).getMaxConcurrency(); subArea.height *= ((ITxStream<?>) w).getMaxConcurrency();
drawTextFormat(gc, subArea, firstKey, w.getFullName(), trackEntry.selected); drawTextFormat(gc, subArea, firstKey, w.getFullName(), trackEntry.selected);
} else { } else {
for (Entry<Integer, TrackEntry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true).entrySet()) { for (Entry<Integer, TrackEntry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true).entrySet()) {
IWaveform<? extends IWaveformEvent> w = entry.getValue().waveform; IWaveform w = entry.getValue().waveform;
subArea.height = waveformCanvas.getTrackHeight(); subArea.height = waveformCanvas.getTrackHeight();
if (w instanceof ITxStream<?>) if (w instanceof ITxStream<?>)
subArea.height *= ((ITxStream<?>) w).getMaxConcurrency(); subArea.height *= ((ITxStream<?>) w).getMaxConcurrency();
@ -840,14 +843,14 @@ public class WaveformViewer implements IWaveformViewer {
Rectangle subArea = new Rectangle(rect.x, 0, rect.width, waveformCanvas.getTrackHeight()); Rectangle subArea = new Rectangle(rect.x, 0, rect.width, waveformCanvas.getTrackHeight());
if (lastKey == firstKey) { if (lastKey == firstKey) {
TrackEntry trackEntry=trackVerticalOffset.get(firstKey); TrackEntry trackEntry=trackVerticalOffset.get(firstKey);
IWaveform<? extends IWaveformEvent> w = trackEntry.waveform; IWaveform w = trackEntry.waveform;
if (w instanceof ITxStream<?>) if (w instanceof ITxStream<?>)
subArea.height *= ((ITxStream<?>) w).getMaxConcurrency(); subArea.height *= ((ITxStream<?>) w).getMaxConcurrency();
drawValue(gc, subArea, firstKey, trackEntry.currentValue, trackEntry.selected); drawValue(gc, subArea, firstKey, trackEntry.currentValue, trackEntry.selected);
} else { } else {
for (Entry<Integer, TrackEntry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true) for (Entry<Integer, TrackEntry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true)
.entrySet()) { .entrySet()) {
IWaveform<? extends IWaveformEvent> w = entry.getValue().waveform; IWaveform w = entry.getValue().waveform;
subArea.height = waveformCanvas.getTrackHeight(); subArea.height = waveformCanvas.getTrackHeight();
if (w instanceof ITxStream<?>) if (w instanceof ITxStream<?>)
subArea.height *= ((ITxStream<?>) w).getMaxConcurrency(); subArea.height *= ((ITxStream<?>) w).getMaxConcurrency();
@ -1038,7 +1041,7 @@ public class WaveformViewer implements IWaveformViewer {
}); });
} }
public TrackEntry getEntryForStream(IWaveform<?> source) { public TrackEntry getEntryForStream(IWaveform source) {
for(TrackEntry trackEntry:streams) for(TrackEntry trackEntry:streams)
if(trackEntry.waveform.equals(source)) return trackEntry; if(trackEntry.waveform.equals(source)) return trackEntry;
return null; return null;
@ -1178,7 +1181,8 @@ public class WaveformViewer implements IWaveformViewer {
public String getScaledTime(long time) { public String getScaledTime(long time) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
Double dTime=new Double(time); Double dTime=new Double(time);
return sb.append(dTime/waveformCanvas.getScaleFactorPow10()).append(waveformCanvas.getUnitStr()).toString(); Double scaledTime = dTime/waveformCanvas.getScaleFactorPow10();
return sb.append(df.format(scaledTime)).append(waveformCanvas.getUnitStr()).toString();
} }
/* (non-Javadoc) /* (non-Javadoc)

View File

@ -59,7 +59,7 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi
public List<TrackEntry> getStreamList(); public List<TrackEntry> getStreamList();
public TrackEntry getEntryForStream(IWaveform<?> source); public TrackEntry getEntryForStream(IWaveform source);
public void moveSelectedTrack(int i); public void moveSelectedTrack(int i);

View File

@ -11,7 +11,6 @@
package com.minres.scviewer.database.ui; package com.minres.scviewer.database.ui;
import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignal;
import com.minres.scviewer.database.ISignalChange;
import com.minres.scviewer.database.ITxEvent; import com.minres.scviewer.database.ITxEvent;
import com.minres.scviewer.database.ITxStream; import com.minres.scviewer.database.ITxStream;
import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.IWaveform;
@ -28,7 +27,7 @@ public class TrackEntry {
DEFAULT, STEP_WISE, CONTINOUS DEFAULT, STEP_WISE, CONTINOUS
} }
final public IWaveform<? extends IWaveformEvent> waveform; final public IWaveform waveform;
public int vOffset; public int vOffset;
@ -42,7 +41,7 @@ public class TrackEntry {
public WaveDisplay waveDisplay = WaveDisplay.DEFAULT; public WaveDisplay waveDisplay = WaveDisplay.DEFAULT;
public TrackEntry(IWaveform<? extends IWaveformEvent> waveform) { public TrackEntry(IWaveform waveform) {
this.waveform = waveform; this.waveform = waveform;
vOffset=0; vOffset=0;
height=0; height=0;
@ -61,7 +60,7 @@ public class TrackEntry {
return waveform instanceof ISignal<?>; return waveform instanceof ISignal<?>;
} }
public ISignal<? extends ISignalChange> getSignal(){ public ISignal<?> getSignal(){
return (ISignal<?>) waveform; return (ISignal<?>) waveform;
} }

View File

@ -0,0 +1,155 @@
package com.minres.scviewer.e4.application;
public class AppModelId {
public static final String ADDON_ORG_ECLIPSE_E4_CORE_COMMANDS_SERVICE = "org.eclipse.e4.core.commands.service";
public static final String ADDON_ORG_ECLIPSE_E4_UI_BINDINGS_SERVICE = "org.eclipse.e4.ui.bindings.service";
public static final String ADDON_ORG_ECLIPSE_E4_UI_CONTEXTS_SERVICE = "org.eclipse.e4.ui.contexts.service";
public static final String ADDON_ORG_ECLIPSE_E4_UI_WORKBENCH_BINDINGS_MODEL = "org.eclipse.e4.ui.workbench.bindings.model";
public static final String ADDON_ORG_ECLIPSE_E4_UI_WORKBENCH_COMMANDS_MODEL = "org.eclipse.e4.ui.workbench.commands.model";
public static final String ADDON_ORG_ECLIPSE_E4_UI_WORKBENCH_CONTEXTS_MODEL = "org.eclipse.e4.ui.workbench.contexts.model";
public static final String ADDON_ORG_ECLIPSE_E4_UI_WORKBENCH_HANDLER_MODEL = "org.eclipse.e4.ui.workbench.handler.model";
public static final String ADDON_ORG_ECLIPSE_E4_UI_WORKBENC__H_ADDONS_DNDADDON_DNDADDON = "org.eclipse.e4.ui.workbench.addons.dndaddon.DnDAddon";
public static final String APPLICATION_ORG_ECLIPSE_E4_IDE_APPLICATION = "org.eclipse.e4.ide.application";
public static final String BINDINGCONTEXT_ORG_ECLIPSE_UI_CONTEXTS_DIALOG = "org.eclipse.ui.contexts.dialog";
public static final String BINDINGCONTEXT_ORG_ECLIPSE_UI_CONTEXTS_DIALOGANDWINDOW = "org.eclipse.ui.contexts.dialogAndWindow";
public static final String BINDINGCONTEXT_ORG_ECLIPSE_UI_CONTEXTS_WINDOW = "org.eclipse.ui.contexts.window";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMANDPARAMETER_CHANGEVALUEDISPLAY = "com.minres.scviewer.e4.application.commandparameter.changevaluedisplay";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMANDPARAMETER_CHANGEWAVEDISPLAY = "com.minres.scviewer.e4.application.commandparameter.changewavedisplay";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMANDPARAMETER_LOADSTORE = "com.minres.scviewer.e4.application.commandparameter.loadStore";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMANDPARAMETER_RELATIONNAME = "com.minres.scviewer.e4.application.commandparameter.relationName";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_ADDWAVEFORM_ALL = "com.minres.scviewer.e4.application.command.addwaveform.all";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_ADDWAVEFORM_WHERE = "com.minres.scviewer.e4.application.command.addwaveform.where";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_MOVEWAVEFORMUPCOMMAND_PARAMETER_DIR = "com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_NAVIGATEEVENTCOMMAND_PARAMETER_DIR = "com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_NAVIGATETRANSCOMMAND_PARAMETER_DIR = "com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_THEME_PARAMETER_ID = "com.minres.scviewer.e4.application.command.theme.parameter.id";
public static final String COMMANDPARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_ZOOMCOMMAND_PARAMETER_LEVEL = "com.minres.scviewer.e4.application.command.zoomcommand.parameter.level";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_ADDWAVEFORM = "com.minres.scviewer.e4.application.command.addwaveform";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_CHANGEVALUEDISPLAY = "com.minres.scviewer.e4.application.command.changevaluedisplay";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_CHANGEWAVEDISPLAY = "com.minres.scviewer.e4.application.command.changewavedisplay";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_DELETEWAVEFORMCOMMAND = "com.minres.scviewer.e4.application.command.deletewaveformCommand";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_LOADSTORESETTINGS = "com.minres.scviewer.e4.application.command.loadStoreSettings";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_MOVEWAVEFORMUPCOMMAND = "com.minres.scviewer.e4.application.command.movewaveformupCommand";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_NAVIGATEEVENTCOMMAND = "com.minres.scviewer.e4.application.command.navigateEventCommand";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_NAVIGATETRANSCOMMAND = "com.minres.scviewer.e4.application.command.navigateTransCommand";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_SELECTALLCOMMAND = "com.minres.scviewer.e4.application.command.selectallCommand";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_SETRELATIONTYPE = "com.minres.scviewer.e4.application.command.setrelationtype";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_SET_THEM = "com.minres.scviewer.e4.application.command.set_them";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_COMMAND_ZOOMCOMMAND = "com.minres.scviewer.e4.application.command.zoomcommand";
public static final String COMMAND_COM_MINRES_SCVIEWER_E4_APPLICATION_OPEN = "com.minres.scviewer.e4.application.open";
public static final String COMMAND_ORG_ECLIPSE_UI_FILE_EXIT = "org.eclipse.ui.file.exit";
public static final String COMMAND_ORG_ECLIPSE_UI_FILE_SAVE = "org.eclipse.ui.file.save";
public static final String COMMAND_ORG_ECLIPSE_UI_HELP_ABOUTACTION = "org.eclipse.ui.help.aboutAction";
public static final String COMMAND_ORG_ECLIPSE_UI_WINDOW_PREFERENCES = "org.eclipse.ui.window.preferences";
public static final String DIRECTTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_DIRECTTOOLITEM_NEXTPREVINSTREAM = "com.minres.scviewer.e4.application.directtoolitem.nextprevinstream";
public static final String DYNAMICMENUCONTRIBUTION_COM_MINRES_SCVIEWER_E4_APPLICATION_DYNAMICMENUCONTRIBUTION_0 = "com.minres.scviewer.e4.application.dynamicmenucontribution.0";
public static final String DYNAMICMENUCONTRIBUTION_COM_MINRES_SCVIEWER_E4_APPLICATION_DYNAMICMENUCONTRIBUTION_2 = "com.minres.scviewer.e4.application.dynamicmenucontribution.2";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_APPEND = "com.minres.scviewer.e4.application.handledmenuitem.append";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_APPENDALL = "com.minres.scviewer.e4.application.handledmenuitem.appendall";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_DELETE = "com.minres.scviewer.e4.application.handledmenuitem.delete";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_INSERTALL = "com.minres.scviewer.e4.application.handledmenuitem.insertall";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_INSERTBEFORE = "com.minres.scviewer.e4.application.handledmenuitem.insertbefore";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_MOVEDOWN = "com.minres.scviewer.e4.application.handledmenuitem.movedown";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_MOVEUP = "com.minres.scviewer.e4.application.handledmenuitem.moveup";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_NEXTCHANGE = "com.minres.scviewer.e4.application.handledmenuitem.nextchange";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_NEXTEVENT = "com.minres.scviewer.e4.application.handledmenuitem.nextevent";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_NEXTTX = "com.minres.scviewer.e4.application.handledmenuitem.nexttx";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_PREVIOUSCHANGE = "com.minres.scviewer.e4.application.handledmenuitem.previouschange";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_PREVIOUSEVENT = "com.minres.scviewer.e4.application.handledmenuitem.previousevent";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_PREVTX = "com.minres.scviewer.e4.application.handledmenuitem.prevtx";
public static final String HANDLEDMENUITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDMENUITEM_REMOVE = "com.minres.scviewer.e4.application.handledmenuitem.remove";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_LOADSETTINGS = "com.minres.scviewer.e4.application.handledtoolitem.loadsettings";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_MOVESTREAMDOWN = "com.minres.scviewer.e4.application.handledtoolitem.movestreamdown";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_MOVESTREAMUP = "com.minres.scviewer.e4.application.handledtoolitem.movestreamup";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_NEXTEVENT = "com.minres.scviewer.e4.application.handledtoolitem.nextevent";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_NEXTTRANSACTION = "com.minres.scviewer.e4.application.handledtoolitem.nexttransaction";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_PREVIOUSEVENT = "com.minres.scviewer.e4.application.handledtoolitem.previousevent";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_PREVIOUSTRANSACTION = "com.minres.scviewer.e4.application.handledtoolitem.previoustransaction";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_REMOVESTREAM = "com.minres.scviewer.e4.application.handledtoolitem.removestream";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_ZOOMFIT = "com.minres.scviewer.e4.application.handledtoolitem.zoomfit";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_ZOOMIN = "com.minres.scviewer.e4.application.handledtoolitem.zoomin";
public static final String HANDLEDTOOLITEM_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLEDTOOLITEM_ZOOMOUT = "com.minres.scviewer.e4.application.handledtoolitem.zoomout";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_ABOUTCOMMAND = "com.minres.scviewer.e4.application.handler.aboutCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_ADDWAVEFORMCOMMAND = "com.minres.scviewer.e4.application.handler.addWaveformCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_CHANGEVALUEDISPLAY = "com.minres.scviewer.e4.application.handler.changeValueDisplay";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_CHANGEWAVEDISPLAY = "com.minres.scviewer.e4.application.handler.changeWaveDisplay";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_DELETEWAVEFORMCOMMAND = "com.minres.scviewer.e4.application.handler.deletewaveformCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_LOADSTORESETTINGS = "com.minres.scviewer.e4.application.handler.loadStoreSettings";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_MOVEWAVEFORMUPCOMMAND = "com.minres.scviewer.e4.application.handler.movewaveformupCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_NAVIGATEEVENTCOMMAND = "com.minres.scviewer.e4.application.handler.navigateEventCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_NAVIGATETRANSCOMMAND = "com.minres.scviewer.e4.application.handler.navigateTransCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_OPENCOMMAND = "com.minres.scviewer.e4.application.handler.openCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_PREFERENCES = "com.minres.scviewer.e4.application.handler.preferences";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_QUITCOMMAND = "com.minres.scviewer.e4.application.handler.quitCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_SAVECOMMAND = "com.minres.scviewer.e4.application.handler.saveCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_SELECTALLCOMMAND = "com.minres.scviewer.e4.application.handler.selectallCommand";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_SETRELEATIONTYPE = "com.minres.scviewer.e4.application.handler.setreleationtype";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_SET_THEM = "com.minres.scviewer.e4.application.handler.set_them";
public static final String HANDLER_COM_MINRES_SCVIEWER_E4_APPLICATION_HANDLER_ZOOMCOMMAND = "com.minres.scviewer.e4.application.handler.zoomCommand";
public static final String MENUSEPARATOR_COM_MINRES_SCVIEWER_E4_APPLICATION_MENUSEPARATOR_0 = "com.minres.scviewer.e4.application.menuseparator.0";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_2 = "com.minres.scviewer.e4.application.menu.2";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_CURSOR = "com.minres.scviewer.e4.application.menu.cursor";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_FILE = "com.minres.scviewer.e4.application.menu.file";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_HELP = "com.minres.scviewer.e4.application.menu.help";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_NAVIGATE = "com.minres.scviewer.e4.application.menu.navigate";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_TRANSACTION = "com.minres.scviewer.e4.application.menu.transaction";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_VIEW = "com.minres.scviewer.e4.application.menu.view";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_WAVEFORM = "com.minres.scviewer.e4.application.menu.waveform";
public static final String MENU_COM_MINRES_SCVIEWER_E4_APPLICATION_MENU_WINDOW = "com.minres.scviewer.e4.application.menu.window";
public static final String MENU_MENU_ORG_ECLIPSE_UI_MAIN_MENU = "menu:org.eclipse.ui.main.menu";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_0 = "com.minres.scviewer.e4.application.parameter.0";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_1 = "com.minres.scviewer.e4.application.parameter.1";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_2 = "com.minres.scviewer.e4.application.parameter.2";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_3 = "com.minres.scviewer.e4.application.parameter.3";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_4 = "com.minres.scviewer.e4.application.parameter.4";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_5 = "com.minres.scviewer.e4.application.parameter.5";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_6 = "com.minres.scviewer.e4.application.parameter.6";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_7 = "com.minres.scviewer.e4.application.parameter.7";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_8 = "com.minres.scviewer.e4.application.parameter.8";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_9 = "com.minres.scviewer.e4.application.parameter.9";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_10 = "com.minres.scviewer.e4.application.parameter.10";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_11 = "com.minres.scviewer.e4.application.parameter.11";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_12 = "com.minres.scviewer.e4.application.parameter.12";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_13 = "com.minres.scviewer.e4.application.parameter.13";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_14 = "com.minres.scviewer.e4.application.parameter.14";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_15 = "com.minres.scviewer.e4.application.parameter.15";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_16 = "com.minres.scviewer.e4.application.parameter.16";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_17 = "com.minres.scviewer.e4.application.parameter.17";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_18 = "com.minres.scviewer.e4.application.parameter.18";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_19 = "com.minres.scviewer.e4.application.parameter.19";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_20 = "com.minres.scviewer.e4.application.parameter.20";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_21 = "com.minres.scviewer.e4.application.parameter.21";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_22 = "com.minres.scviewer.e4.application.parameter.22";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_23 = "com.minres.scviewer.e4.application.parameter.23";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_24 = "com.minres.scviewer.e4.application.parameter.24";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_25 = "com.minres.scviewer.e4.application.parameter.25";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_26 = "com.minres.scviewer.e4.application.parameter.26";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_27 = "com.minres.scviewer.e4.application.parameter.27";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_28 = "com.minres.scviewer.e4.application.parameter.28";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_29 = "com.minres.scviewer.e4.application.parameter.29";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_30 = "com.minres.scviewer.e4.application.parameter.30";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_31 = "com.minres.scviewer.e4.application.parameter.31";
public static final String PARAMETER_COM_MINRES_SCVIEWER_E4_APPLICATION_PARAMETER_32 = "com.minres.scviewer.e4.application.parameter.32";
public static final String PARTDESCRIPTOR_COM_MINRES_SCVIEWER_E4_APPLICATION_PARTDESCRIPTOR_WAVEFORMVIEWER = "com.minres.scviewer.e4.application.partdescriptor.waveformviewer";
public static final String PARTSTACK_ORG_ECLIPSE_EDITORSS = "org.eclipse.editorss";
public static final String PART_COM_MINRES_SCVIEWER_E4_APPLICATION_PARTS_DESIGNBROWSER = "com.minres.scviewer.e4.application.parts.DesignBrowser";
public static final String PART_COM_MINRES_SCVIEWER_E4_APPLICATION_PARTS_WAVEFORMDETAILS = "com.minres.scviewer.e4.application.parts.WaveformDetails";
public static final String PART_COM_MINRES_SCVIEWER_E4_APPLICATION_PART_0 = "com.minres.scviewer.e4.application.part.0";
public static final String POPUPMENU_COM_MINRES_SCVIEWER_E4_APPLICATION_PARTS_DESIGNBROWSER_POPUPMENU = "com.minres.scviewer.e4.application.parts.DesignBrowser.popupmenu";
public static final String POPUPMENU_COM_MINRES_SCVIEWER_E4_APPLICATION_POPUPMENU_NAMECONTEXT = "com.minres.scviewer.e4.application.popupmenu.namecontext";
public static final String POPUPMENU_COM_MINRES_SCVIEWER_E4_APPLICATION_POPUPMENU_WAVECONTEXT = "com.minres.scviewer.e4.application.popupmenu.wavecontext";
public static final String TOOLBARSEPARATOR_COM_MINRES_SCVIEWER_E4_APPLICATION_TOOLBARSEPARATOR_1 = "com.minres.scviewer.e4.application.toolbarseparator.1";
public static final String TOOLBARSEPARATOR_COM_MINRES_SCVIEWER_E4_APPLICATION_TOOLBARSEPARATOR_2 = "com.minres.scviewer.e4.application.toolbarseparator.2";
public static final String TOOLBARSEPARATOR_COM_MINRES_SCVIEWER_E4_APPLICATION_TOOLBARSEPARATOR_3 = "com.minres.scviewer.e4.application.toolbarseparator.3";
public static final String TOOLBARSEPARATOR_COM_MINRES_SCVIEWER_E4_APPLICATION_TOOLBARSEPARATOR_4 = "com.minres.scviewer.e4.application.toolbarseparator.4";
public static final String TOOLBAR_COM_MINRES_SCVIEWER_E4_APPLICATION_TOOLBAR_0 = "com.minres.scviewer.e4.application.toolbar.0";
public static final String TOOLBAR_COM_MINRES_SCVIEWER_E4_APPLICATION_TOOLBAR_1 = "com.minres.scviewer.e4.application.toolbar.1";
public static final String TOOLBAR_TOOLBAR_ORG_ECLIPSE_UI_MAIN_TOOLBAR = "toolbar:org.eclipse.ui.main.toolbar";
public static final String TOOLCONTROL_COM_MINRES_SCVIEWER_E4_APPLICATION_TOOLCONTROL_0 = "com.minres.scviewer.e4.application.toolcontrol.0";
public static final String TOOLCONTROL_ORG_ECLIPSE_UI_HEAPSTATUS = "org.eclipse.ui.HeapStatus";
public static final String TOOLCONTROL_ORG_ECLIPSE_UI_PROGRESSBAR = "org.eclipse.ui.ProgressBar";
public static final String TOOLCONTROL_ORG_ECLIPSE_UI_STATUSLINE = "org.eclipse.ui.StatusLine";
public static final String TRIMBAR_ORG_ECLIPSE_UI_MAIN_TOOLBAR = "org.eclipse.ui.main.toolbar";
public static final String TRIMBAR_ORG_ECLIPSE_UI_TRIM_STATUS = "org.eclipse.ui.trim.status";
public static final String WINDOW_COM_MINRES_SCVIEWER_E4_APPLICATION_DIALOG_ABOUTSCVIEWER = "com.minres.scviewer.e4.application.dialog.aboutscviewer";
}

View File

@ -47,6 +47,7 @@ public class Messages extends NLS {
public static String WaveformViewer_19; public static String WaveformViewer_19;
public static String WaveformViewer_20; public static String WaveformViewer_20;
public static String WaveformViewer_21; public static String WaveformViewer_21;
public static String WaveformViewer_22;
public static String WaveformViewer_37; public static String WaveformViewer_37;
public static String WaveformViewer_38; public static String WaveformViewer_38;
public static String WaveformViewer_39; public static String WaveformViewer_39;

View File

@ -22,10 +22,8 @@ import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import com.minres.scviewer.database.BitVector;
import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignal;
import com.minres.scviewer.database.ISignalChange;
import com.minres.scviewer.database.ISignalChangeBitVector;
import com.minres.scviewer.database.ISignalChangeReal;
import com.minres.scviewer.database.ui.TrackEntry; import com.minres.scviewer.database.ui.TrackEntry;
import com.minres.scviewer.e4.application.parts.WaveformViewer; import com.minres.scviewer.e4.application.parts.WaveformViewer;
@ -45,8 +43,8 @@ public class WaveformPopupMenuContribution {
if(!sel.isEmpty() && sel instanceof IStructuredSelection) { if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
Object selected = ((IStructuredSelection)sel).getFirstElement(); Object selected = ((IStructuredSelection)sel).getFirstElement();
if(selected instanceof ISignal<?>) { if(selected instanceof ISignal<?>) {
ISignalChange s = (ISignalChange) ((ISignal<?>) selected).getEvents().firstEntry().getValue(); Object x = ((ISignal<?>) selected).getEvents().firstEntry().getValue();
if((s instanceof ISignalChangeReal) || (s instanceof ISignalChangeBitVector)) { if((x instanceof Double) || (x instanceof BitVector)) {
return true; return true;
} }
} }
@ -67,13 +65,13 @@ public class WaveformPopupMenuContribution {
Object second=null; Object second=null;
if(it.hasNext()) second=it.next(); if(it.hasNext()) second=it.next();
if(first instanceof ISignal<?>) { if(first instanceof ISignal<?>) {
ISignalChange s = (ISignalChange) ((ISignal<?>) first).getEvents().firstEntry().getValue(); Object o = ((ISignal<?>) first).getEvents().firstEntry().getValue();
//com.minres.scviewer.e4.application.menu.mulitvaluesettings //com.minres.scviewer.e4.application.menu.mulitvaluesettings
if((s instanceof ISignalChangeReal) || (s instanceof ISignalChangeBitVector)) { if((o instanceof Double) || (o instanceof BitVector)) {
TrackEntry entry=nullEntry; TrackEntry entry=nullEntry;
if(second instanceof TrackEntry) if(second instanceof TrackEntry)
entry=(TrackEntry)second; entry=(TrackEntry)second;
if(s instanceof ISignalChangeBitVector) { if(o instanceof BitVector) {
addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, entry.valueDisplay); addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, entry.valueDisplay);
addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, entry.valueDisplay); addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, entry.valueDisplay);
addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, entry.valueDisplay); addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, entry.valueDisplay);

View File

@ -56,7 +56,7 @@ public class AddWaveformHandler {
if(designBrowser==null) designBrowser = getListPart( partService); if(designBrowser==null) designBrowser = getListPart( partService);
if(designBrowser!=null && selection.size()>0){ if(designBrowser!=null && selection.size()>0){
List<?> sel=selection.toList(); List<?> sel=selection.toList();
designBrowser.getActiveWaveformViewerPart().addStreamsToList(sel.toArray(new IWaveform<?>[]{}), designBrowser.getActiveWaveformViewerPart().addStreamsToList(sel.toArray(new IWaveform[]{}),
"before".equalsIgnoreCase(where)); //$NON-NLS-1$ "before".equalsIgnoreCase(where)); //$NON-NLS-1$
} }
} }

View File

@ -25,15 +25,15 @@ public class DeleteWaveformHandler {
@CanExecute @CanExecute
public Boolean canExecute(ESelectionService selectionService){ public Boolean canExecute(ESelectionService selectionService){
Object o = selectionService.getSelection(); Object o = selectionService.getSelection();
return o instanceof IStructuredSelection && ((IStructuredSelection)o).getFirstElement() instanceof IWaveform<?>; return o instanceof IStructuredSelection && ((IStructuredSelection)o).getFirstElement() instanceof IWaveform;
} }
@Execute @Execute
public void execute(ESelectionService selectionService, MPart activePart) { public void execute(ESelectionService selectionService, MPart activePart) {
Object o = activePart.getObject(); Object o = activePart.getObject();
Object sel = selectionService.getSelection(); Object sel = selectionService.getSelection();
if(o instanceof WaveformViewer && ((IStructuredSelection)sel).getFirstElement() instanceof IWaveform<?>){ if(o instanceof WaveformViewer && ((IStructuredSelection)sel).getFirstElement() instanceof IWaveform){
((WaveformViewer)o).removeStreamFromList((IWaveform<?>) ((IStructuredSelection)sel).getFirstElement()); ((WaveformViewer)o).removeStreamFromList((IWaveform) ((IStructuredSelection)sel).getFirstElement());
} }
} }
} }

View File

@ -33,7 +33,7 @@ public class MoveWaveformHandler {
Object sel = selectionService.getSelection(); Object sel = selectionService.getSelection();
if( sel instanceof IStructuredSelection) { if( sel instanceof IStructuredSelection) {
Object o= ((IStructuredSelection)sel).getFirstElement(); Object o= ((IStructuredSelection)sel).getFirstElement();
return o instanceof IWaveform<?> || o instanceof ITx; return o instanceof IWaveform || o instanceof ITx;
} }
return false; return false;
} }

View File

@ -34,7 +34,7 @@ public class NavigateEvent {
Object sel = selectionService.getSelection(); Object sel = selectionService.getSelection();
if( sel instanceof IStructuredSelection) { if( sel instanceof IStructuredSelection) {
Object o= ((IStructuredSelection)sel).getFirstElement(); Object o= ((IStructuredSelection)sel).getFirstElement();
return o instanceof IWaveform<?> || o instanceof ITx; return o instanceof IWaveform || o instanceof ITx;
} }
return false; return false;
} }

View File

@ -32,6 +32,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.ProgressBar;
import org.osgi.service.prefs.PreferencesService; import org.osgi.service.prefs.PreferencesService;
import com.minres.scviewer.e4.application.AppModelId;
import com.minres.scviewer.e4.application.Messages; import com.minres.scviewer.e4.application.Messages;
/** /**
@ -80,11 +81,11 @@ public class StatusBarControl {
*/ */
@PostConstruct @PostConstruct
void createWidget(Composite parent, MToolControl toolControl) { void createWidget(Composite parent, MToolControl toolControl) {
if (toolControl.getElementId().equals("org.eclipse.ui.StatusLine")) { //$NON-NLS-1$ if (toolControl.getElementId().equals(AppModelId.TOOLCONTROL_ORG_ECLIPSE_UI_STATUSLINE)) { //$NON-NLS-1$
createStatusLine(parent, toolControl); createStatusLine(parent, toolControl);
} else if (toolControl.getElementId().equals("org.eclipse.ui.HeapStatus")) { //$NON-NLS-1$ } else if (toolControl.getElementId().equals(AppModelId.TOOLCONTROL_ORG_ECLIPSE_UI_HEAPSTATUS)) { //$NON-NLS-1$
createHeapStatus(parent, toolControl); createHeapStatus(parent, toolControl);
} else if (toolControl.getElementId().equals("org.eclipse.ui.ProgressBar")) { //$NON-NLS-1$ } else if (toolControl.getElementId().equals(AppModelId.TOOLCONTROL_ORG_ECLIPSE_UI_PROGRESSBAR)) { //$NON-NLS-1$
createProgressBar(parent, toolControl); createProgressBar(parent, toolControl);
} }
} }

View File

@ -90,6 +90,7 @@ public class WaveStatusBarControl extends StatusBarControl {
label=new CLabel(box, SWT.SHADOW_NONE); label=new CLabel(box, SWT.SHADOW_NONE);
label.setText(labelString); label.setText(labelString);
text=new CLabel(box, SWT.SHADOW_IN); text=new CLabel(box, SWT.SHADOW_IN);
text.setAlignment(SWT.RIGHT);
GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false); GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
layoutData.minimumWidth=width; layoutData.minimumWidth=width;
text.setLayoutData(layoutData); text.setLayoutData(layoutData);
@ -126,10 +127,10 @@ public class WaveStatusBarControl extends StatusBarControl {
@Inject @Inject
public WaveStatusBarControl(UISynchronize sync) { public WaveStatusBarControl(UISynchronize sync) {
super(sync); super(sync);
cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5, 80); cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5, 150);
markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6, 80); markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6, 150);
markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7, 80); markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7, 150);
zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8, 80); zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8, 60);
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution); manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution);
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution); manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution);
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution); manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution);

View File

@ -8,7 +8,7 @@ DesignBrowser_8=Insert before
LoadingWaveformDb_0=Database loading... LoadingWaveformDb_0=Database loading...
LoadStoreSettingsHandler_2=*.scview LoadStoreSettingsHandler_2=*.scview
LoadStoreSettingsHandler_3=SCViewer.scview LoadStoreSettingsHandler_3=SCViewer.scview
OpenHandler_0=*.vcd;*.txdb;*.txlog OpenHandler_0=*.vcd;*.txdb;*.txlog;CURRENT
QuitHandler_0=Confirmation QuitHandler_0=Confirmation
QuitHandler_1=Do you want to exit? QuitHandler_1=Do you want to exit?
RelationTypeToolControl_0=------------ RelationTypeToolControl_0=------------
@ -41,6 +41,7 @@ WaveformViewer_18=Would you like to reload the database?
WaveformViewer_19=vcd WaveformViewer_19=vcd
WaveformViewer_20=txdb WaveformViewer_20=txdb
WaveformViewer_21=txlog WaveformViewer_21=txlog
WaveformViewer_22=txldb
WaveformViewer_37=Database open WaveformViewer_37=Database open
WaveformViewer_38=Would you like to open the adjacent database WaveformViewer_38=Would you like to open the adjacent database
WaveformViewer_39=\ as well? WaveformViewer_39=\ as well?

View File

@ -388,7 +388,7 @@ public class DesignBrowser {
Object object= ((IStructuredSelection)selection).getFirstElement(); Object object= ((IStructuredSelection)selection).getFirstElement();
if(object instanceof IHierNode&& ((IHierNode)object).getChildNodes().size()!=0) if(object instanceof IHierNode&& ((IHierNode)object).getChildNodes().size()!=0)
txTableViewer.setInput(object); txTableViewer.setInput(object);
otherSelectionCount = (object instanceof IWaveform<?> || object instanceof ITx)?1:0; otherSelectionCount = (object instanceof IWaveform || object instanceof ITx)?1:0;
} }
} }
updateButtons(); updateButtons();
@ -437,7 +437,7 @@ public class DesignBrowser {
if (searchString == null || searchString.length() == 0) { if (searchString == null || searchString.length() == 0) {
return true; return true;
} }
IWaveform<?> p = (IWaveform<?>) element; IWaveform p = (IWaveform) element;
if (p.getName().matches(searchString)) { if (p.getName().matches(searchString)) {
return true; return true;
} }

View File

@ -58,13 +58,13 @@ public class LoadingWaveformDb implements IWaveformDb {
} }
@Override @Override
public IWaveform<? extends IWaveformEvent> getStreamByName(String name) { public IWaveform getStreamByName(String name) {
return null; return null;
} }
@Override @Override
public List<IWaveform<?>> getAllWaves() { public List<IWaveform> getAllWaves() {
return new ArrayList<IWaveform<?>>(); return new ArrayList<IWaveform>();
} }
@Override @Override

View File

@ -499,6 +499,9 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
if (partInput instanceof File) { if (partInput instanceof File) {
filesToLoad = new ArrayList<File>(); filesToLoad = new ArrayList<File>();
File file = (File) partInput; File file = (File) partInput;
if(file.isFile() && "CURRENT".equals(file.getName())){
file=file.getParentFile();
}
if (file.exists()) { if (file.exists()) {
filesToLoad.add(file); filesToLoad.add(file);
try { try {
@ -508,8 +511,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_20))); filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_20)));
} else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21)))) { } else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21)))) {
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21))); filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21)));
} else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_22)))) {
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_22)));
} }
} else if (Messages.WaveformViewer_20.equals(ext.toLowerCase()) || Messages.WaveformViewer_21.equals(ext.toLowerCase())) { } else if (Messages.WaveformViewer_20.equals(ext.toLowerCase()) ||
Messages.WaveformViewer_21.equals(ext.toLowerCase()) ||
Messages.WaveformViewer_22.equals(ext.toLowerCase())
) {
if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19)))) { if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19)))) {
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19))); filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19)));
} }
@ -621,7 +629,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
Integer waves = state.containsKey(SHOWN_WAVEFORM+"S") ? Integer.parseInt(state.get(SHOWN_WAVEFORM + "S")):0; //$NON-NLS-1$ //$NON-NLS-2$ Integer waves = state.containsKey(SHOWN_WAVEFORM+"S") ? Integer.parseInt(state.get(SHOWN_WAVEFORM + "S")):0; //$NON-NLS-1$ //$NON-NLS-2$
List<TrackEntry> res = new LinkedList<>(); List<TrackEntry> res = new LinkedList<>();
for (int i = 0; i < waves; i++) { for (int i = 0; i < waves; i++) {
IWaveform<? extends IWaveformEvent> waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i)); IWaveform waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i));
if (waveform != null) { if (waveform != null) {
TrackEntry t = new TrackEntry(waveform); TrackEntry t = new TrackEntry(waveform);
res.add(t); res.add(t);
@ -685,8 +693,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
Object sel = o == null ? selectionService.getSelection() : o; Object sel = o == null ? selectionService.getSelection() : o;
if (sel instanceof IStructuredSelection) if (sel instanceof IStructuredSelection)
for (Object el : ((IStructuredSelection) sel).toArray()) { for (Object el : ((IStructuredSelection) sel).toArray()) {
if (el instanceof IWaveform<?>) if (el instanceof IWaveform)
addStreamToList((IWaveform<?>) el, false); addStreamToList((IWaveform) el, false);
} }
} }
@ -761,8 +769,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
* @param obj the obj * @param obj the obj
* @param insert the insert * @param insert the insert
*/ */
public void addStreamToList(IWaveform<? extends IWaveformEvent> obj, boolean insert) { public void addStreamToList(IWaveform obj, boolean insert) {
addStreamsToList(new IWaveform<?>[] { obj }, insert); addStreamsToList(new IWaveform[] { obj }, insert);
} }
/** /**
@ -771,16 +779,16 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
* @param iWaveforms the i waveforms * @param iWaveforms the i waveforms
* @param insert the insert * @param insert the insert
*/ */
public void addStreamsToList(IWaveform<? extends IWaveformEvent>[] iWaveforms, boolean insert) { public void addStreamsToList(IWaveform[] iWaveforms, boolean insert) {
List<TrackEntry> streams = new LinkedList<>(); List<TrackEntry> streams = new LinkedList<>();
for (IWaveform<? extends IWaveformEvent> stream : iWaveforms) for (IWaveform stream : iWaveforms)
streams.add(new TrackEntry(stream)); streams.add(new TrackEntry(stream));
IStructuredSelection selection = (IStructuredSelection) waveformPane.getSelection(); IStructuredSelection selection = (IStructuredSelection) waveformPane.getSelection();
if (selection.size() == 0) { if (selection.size() == 0) {
waveformPane.getStreamList().addAll(streams); waveformPane.getStreamList().addAll(streams);
} else { } else {
Object first = selection.getFirstElement(); Object first = selection.getFirstElement();
IWaveform<?> stream = (first instanceof ITx) ? ((ITx) first).getStream() : (IWaveform<?>) first; IWaveform stream = (first instanceof ITx) ? ((ITx) first).getStream() : (IWaveform) first;
TrackEntry trackEntry = waveformPane.getEntryForStream(stream); TrackEntry trackEntry = waveformPane.getEntryForStream(stream);
int index = waveformPane.getStreamList().indexOf(trackEntry); int index = waveformPane.getStreamList().indexOf(trackEntry);
if (!insert) if (!insert)
@ -795,7 +803,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
* *
* @param stream the stream * @param stream the stream
*/ */
public void removeStreamFromList(IWaveform<? extends IWaveformEvent> stream) { public void removeStreamFromList(IWaveform stream) {
TrackEntry trackEntry = waveformPane.getEntryForStream(stream); TrackEntry trackEntry = waveformPane.getEntryForStream(stream);
List<TrackEntry> streams = waveformPane.getStreamList(); List<TrackEntry> streams = waveformPane.getStreamList();
ISelection sel = waveformPane.getSelection(); ISelection sel = waveformPane.getSelection();
@ -822,8 +830,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
* *
* @param iWaveforms the i waveforms * @param iWaveforms the i waveforms
*/ */
public void removeStreamsFromList(IWaveform<? extends IWaveformEvent>[] iWaveforms) { public void removeStreamsFromList(IWaveform[] iWaveforms) {
for (IWaveform<? extends IWaveformEvent> stream : iWaveforms) for (IWaveform stream : iWaveforms)
removeStreamFromList(stream); removeStreamFromList(stream);
} }

View File

@ -73,7 +73,7 @@ public class TxDbContentProvider implements ITreeContentProvider {
@Override @Override
public boolean apply(IHierNode arg0) { public boolean apply(IHierNode arg0) {
if(showNodes){ if(showNodes){
return arg0 instanceof IWaveform<?>; return arg0 instanceof IWaveform;
} else{ } else{
return arg0.getChildNodes().size()!=0; return arg0.getChildNodes().size()!=0;
} }

View File

@ -18,9 +18,9 @@ import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import org.eclipse.wb.swt.ResourceManager; import org.eclipse.wb.swt.ResourceManager;
import com.minres.scviewer.database.BitVector;
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.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,10 +101,10 @@ 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 ISignalChangeBitVector) if(o instanceof BitVector && ((BitVector)o).getWidth()==1)
return wave;
else
return signal; return signal;
else
return wave;
}else if(element instanceof IHierNode){ }else if(element instanceof IHierNode){
return folder; return folder;
} else } else

View File

@ -47,6 +47,7 @@
<plugin id="com.google.guava"/> <plugin id="com.google.guava"/>
<plugin id="com.ibm.icu"/> <plugin id="com.ibm.icu"/>
<plugin id="com.minres.scviewer.database"/> <plugin id="com.minres.scviewer.database"/>
<plugin id="com.minres.scviewer.database.leveldb"/>
<plugin id="com.minres.scviewer.database.sqlite"/> <plugin id="com.minres.scviewer.database.sqlite"/>
<plugin id="com.minres.scviewer.database.text"/> <plugin id="com.minres.scviewer.database.text"/>
<plugin id="com.minres.scviewer.database.ui"/> <plugin id="com.minres.scviewer.database.ui"/>

View File

@ -242,7 +242,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames().size()>0){ ((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames().size()>0){
LinkedList<TrackEntry> entries= new LinkedList<>(); LinkedList<TrackEntry> entries= new LinkedList<>();
for(String streamName:((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames()){ for(String streamName:((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames()){
IWaveform<? extends IWaveformEvent> stream = database.getStreamByName(streamName); IWaveform stream = database.getStreamByName(streamName);
if(stream!=null) if(stream!=null)
entries.add(new TrackEntry(stream)); entries.add(new TrackEntry(stream));
} }
@ -333,7 +333,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
return database; return database;
} }
public void addStreamToList(IWaveform<? extends IWaveformEvent> obj){ public void addStreamToList(IWaveform obj){
if(getEditorInput() instanceof TxEditorInput && !((TxEditorInput) getEditorInput()).getStreamNames().contains(obj.getFullName())){ if(getEditorInput() instanceof TxEditorInput && !((TxEditorInput) getEditorInput()).getStreamNames().contains(obj.getFullName())){
((TxEditorInput) getEditorInput()).getStreamNames().add(obj.getFullName()); ((TxEditorInput) getEditorInput()).getStreamNames().add(obj.getFullName());
txDisplay.getStreamList().add(new TrackEntry(obj)); txDisplay.getStreamList().add(new TrackEntry(obj));
@ -342,12 +342,12 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
} }
public void addStreamsToList(IWaveform<? extends IWaveformEvent>[] iWaveforms){ public void addStreamsToList(IWaveform[] iWaveforms){
for(IWaveform<? extends IWaveformEvent> stream:iWaveforms) for(IWaveform stream:iWaveforms)
addStreamToList(stream); addStreamToList(stream);
} }
public void removeStreamFromList(IWaveform<? extends IWaveformEvent> waveform){ public void removeStreamFromList(IWaveform waveform){
if(getEditorInput() instanceof TxEditorInput && ((TxEditorInput) getEditorInput()).getStreamNames().contains(waveform.getFullName())){ if(getEditorInput() instanceof TxEditorInput && ((TxEditorInput) getEditorInput()).getStreamNames().contains(waveform.getFullName())){
((TxEditorInput) getEditorInput()).getStreamNames().remove(waveform.getFullName()); ((TxEditorInput) getEditorInput()).getStreamNames().remove(waveform.getFullName());
} }
@ -361,8 +361,8 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
txDisplay.getStreamList().remove(entry); txDisplay.getStreamList().remove(entry);
} }
public void removeStreamsFromList(IWaveform<? extends IWaveformEvent>[] iWaveforms){ public void removeStreamsFromList(IWaveform[] iWaveforms){
for(IWaveform<? extends IWaveformEvent> stream:iWaveforms) for(IWaveform stream:iWaveforms)
removeStreamFromList(stream); removeStreamFromList(stream);
} }

View File

@ -31,8 +31,8 @@ public class RemoveHandler extends AbstractHandler {
if(editor instanceof TxEditorPart){ if(editor instanceof TxEditorPart){
TxEditorPart editorPart = (TxEditorPart) editor; TxEditorPart editorPart = (TxEditorPart) editor;
ISelection selection =editorPart.getSelection(); ISelection selection =editorPart.getSelection();
if(selection instanceof StructuredSelection && ((StructuredSelection)selection).getFirstElement() instanceof IWaveform<?>){ if(selection instanceof StructuredSelection && ((StructuredSelection)selection).getFirstElement() instanceof IWaveform){
editorPart.removeStreamFromList((IWaveform<? extends IWaveformEvent>) ((StructuredSelection)selection).getFirstElement()); editorPart.removeStreamFromList((IWaveform) ((StructuredSelection)selection).getFirstElement());
editorPart.setSelection(new StructuredSelection()); editorPart.setSelection(new StructuredSelection());
} }
} }

View File

@ -183,16 +183,16 @@ public class TxOutlinePage extends ContentOutlinePage implements ISelectionList
for(Object obj :selection.toArray()){ for(Object obj :selection.toArray()){
if(obj instanceof IWaveform){ if(obj instanceof IWaveform){
if(remove) if(remove)
editor.removeStreamFromList((IWaveform<? extends IWaveformEvent>) obj); editor.removeStreamFromList((IWaveform) obj);
else else
editor.addStreamToList((IWaveform<? extends IWaveformEvent>) obj); editor.addStreamToList((IWaveform) obj);
} else if(obj instanceof IHierNode){ } else if(obj instanceof IHierNode){
LinkedList<IHierNode> queue = new LinkedList<IHierNode>(); LinkedList<IHierNode> queue = new LinkedList<IHierNode>();
LinkedList<IWaveform<? extends IWaveformEvent>> streams = new LinkedList<IWaveform<? extends IWaveformEvent>>(); LinkedList<IWaveform> streams = new LinkedList<IWaveform>();
queue.add((IHierNode)obj); queue.add((IHierNode)obj);
while(queue.size()>0){ while(queue.size()>0){
IHierNode n = queue.poll(); IHierNode n = queue.poll();
if(n instanceof IWaveform) streams.add((IWaveform<? extends IWaveformEvent>) n); if(n instanceof IWaveform) streams.add((IWaveform) n);
queue.addAll(n.getChildNodes()); queue.addAll(n.getChildNodes());
} }
if(remove) if(remove)