Adapted application to data model changes
This commit is contained in:
parent
93fd192782
commit
bcf4e1a274
@ -10,6 +10,8 @@
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
@ -22,6 +24,8 @@ public class RulerPainter implements IPainter {
|
||||
static final int rulerTickMinorC = 10;
|
||||
static final int rulerTickMajorC = 100;
|
||||
|
||||
static final DecimalFormat df = new DecimalFormat("#.00####");
|
||||
|
||||
public RulerPainter(WaveformCanvas waveCanvas) {
|
||||
this.waveCanvas=waveCanvas;
|
||||
}
|
||||
@ -64,7 +68,7 @@ public class RulerPainter implements IPainter {
|
||||
for (long tick = startMinorIncr; tick < end; tick += rulerTickMinor) {
|
||||
int x0 = (int) (tick/scaleFactor);
|
||||
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);
|
||||
} else {
|
||||
gc.drawLine(x0, area.y+minorTickY, x0, area.y+bottom);
|
||||
|
@ -23,27 +23,24 @@ import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.minres.scviewer.database.BitVector;
|
||||
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.WaveformColors;
|
||||
|
||||
public class SignalPainter extends TrackPainter {
|
||||
private class SignalChange {
|
||||
long time;
|
||||
ISignalChange value;
|
||||
Object value;
|
||||
boolean fromMap;
|
||||
|
||||
public SignalChange(Entry<Long, ? extends ISignalChange> entry) {
|
||||
public SignalChange(Entry<Long, ?> entry) {
|
||||
time = entry.getKey();
|
||||
value = entry.getValue();
|
||||
fromMap = true;
|
||||
}
|
||||
|
||||
public void set(Entry<Long, ? extends ISignalChange> entry, Long actTime) {
|
||||
public void set(Entry<Long, ?> entry, Long actTime) {
|
||||
if (entry != null) {
|
||||
time = entry.getKey();
|
||||
value = entry.getValue();
|
||||
@ -84,7 +81,7 @@ public class SignalPainter extends TrackPainter {
|
||||
}
|
||||
|
||||
public void paintArea(GC gc, Rectangle area) {
|
||||
ISignal<? extends ISignalChange> signal = trackEntry.getSignal();
|
||||
ISignal<?> signal = trackEntry.getSignal();
|
||||
if (trackEntry.selected)
|
||||
gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
|
||||
else
|
||||
@ -93,8 +90,8 @@ public class SignalPainter extends TrackPainter {
|
||||
gc.fillRectangle(area);
|
||||
long beginTime = area.x * this.waveCanvas.getScaleFactor();
|
||||
long endTime = (area.x + area.width) * this.waveCanvas.getScaleFactor();
|
||||
Entry<Long, ? extends ISignalChange> first = signal.getEvents().floorEntry(beginTime);
|
||||
Entry<Long, ? extends ISignalChange> last = signal.getEvents().floorEntry(endTime);
|
||||
Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
|
||||
Entry<Long, ?> last = signal.getEvents().floorEntry(endTime);
|
||||
if (first == null) {
|
||||
if (last == null)
|
||||
return;
|
||||
@ -105,7 +102,7 @@ public class SignalPainter extends TrackPainter {
|
||||
gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
||||
gc.setLineStyle(SWT.LINE_SOLID);
|
||||
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 right = new SignalChange(entries.size() > 0 ? entries.firstEntry() : first);
|
||||
maxX = area.x + area.width;
|
||||
@ -143,7 +140,7 @@ public class SignalPainter extends TrackPainter {
|
||||
if (xEnd == xBegin) {
|
||||
multiple = true;
|
||||
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)
|
||||
right.set(entry, endTime);
|
||||
xEnd = getXEnd(eTime);
|
||||
@ -151,17 +148,19 @@ public class SignalPainter extends TrackPainter {
|
||||
} while (left.time < endTime);
|
||||
}
|
||||
|
||||
private SignalStencil getStencil(GC gc, SignalChange left, NavigableMap<Long, ? extends ISignalChange> entries) {
|
||||
if(left.value instanceof ISignalChangeBit)
|
||||
return new SingleBitStencil();
|
||||
else if (left.value instanceof ISignalChangeBitVector)
|
||||
private SignalStencil getStencil(GC gc, SignalChange left, NavigableMap<Long, ?> entries) {
|
||||
Object val = left.value;
|
||||
if(val instanceof BitVector) {
|
||||
BitVector bv = (BitVector) val;
|
||||
if(bv.getWidth()==1)
|
||||
return new SingleBitStencil();
|
||||
if(trackEntry.waveDisplay==TrackEntry.WaveDisplay.DEFAULT)
|
||||
return new MultiBitStencil(gc);
|
||||
else
|
||||
return new MultiBitStencilAnalog(entries, left.value,
|
||||
trackEntry.waveDisplay==TrackEntry.WaveDisplay.CONTINOUS,
|
||||
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);
|
||||
else
|
||||
return null;
|
||||
@ -169,7 +168,7 @@ public class SignalPainter extends TrackPainter {
|
||||
|
||||
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 {
|
||||
@ -183,9 +182,10 @@ public class SignalPainter extends TrackPainter {
|
||||
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()];
|
||||
ISignalChangeBitVector last = (ISignalChangeBitVector) left;
|
||||
BitVector last = (BitVector) left;
|
||||
if (last.getValue().toString().contains("X")) {
|
||||
colorBorder = waveCanvas.colors[WaveformColors.SIGNALX.ordinal()];
|
||||
} else if (last.getValue().toString().contains("Z")) {
|
||||
@ -208,13 +208,13 @@ public class SignalPainter extends TrackPainter {
|
||||
String label = null;
|
||||
switch(trackEntry.valueDisplay) {
|
||||
case SIGNED:
|
||||
label=Long.toString(last.getValue().toSignedValue());
|
||||
label=Long.toString(last.toSignedValue());
|
||||
break;
|
||||
case UNSIGNED:
|
||||
label=Long.toString(last.getValue().toUnsignedValue());
|
||||
label=Long.toString(last.toUnsignedValue());
|
||||
break;
|
||||
default:
|
||||
label="h'"+last.getValue().toHexString();
|
||||
label="h'"+last.toHexString();
|
||||
}
|
||||
Point bb = getBoxWidth(gc, label);
|
||||
if (xBegin < area.x) {
|
||||
@ -245,16 +245,15 @@ public class SignalPainter extends TrackPainter {
|
||||
private long minVal;
|
||||
private long range;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public MultiBitStencilAnalog(NavigableMap<Long, ? extends ISignalChange> entries, ISignalChange left, boolean continous, boolean signed) {
|
||||
public MultiBitStencilAnalog(NavigableMap<Long, ?> entries, Object left, boolean continous, boolean signed) {
|
||||
this.continous=continous;
|
||||
Collection<ISignalChangeBitVector> values = ((NavigableMap<Long, ISignalChangeBitVector>) entries).values();
|
||||
minVal=((ISignalChangeBitVector) left).getValue().toUnsignedValue();
|
||||
Collection<?> values = ((NavigableMap<Long, ?>) entries).values();
|
||||
minVal=((BitVector) left).toUnsignedValue();
|
||||
range=2;
|
||||
if(!values.isEmpty()) {
|
||||
long maxVal=minVal;
|
||||
for (ISignalChange e : entries.values()) {
|
||||
long v = ((ISignalChangeBitVector)e).getValue().toUnsignedValue();
|
||||
for (Object e : entries.values()) {
|
||||
long v = ((BitVector)e).toUnsignedValue();
|
||||
maxVal=Math.max(maxVal, 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) {
|
||||
long leftVal = ((ISignalChangeBitVector) left).getValue().toUnsignedValue();
|
||||
long rightVal= ((ISignalChangeBitVector) right).getValue().toUnsignedValue();
|
||||
@SuppressWarnings("unchecked")
|
||||
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
long leftVal = ((BitVector) left).toUnsignedValue();
|
||||
long rightVal= ((BitVector) right).toUnsignedValue();
|
||||
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
int yOffsetLeft = (int) ((leftVal-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 {
|
||||
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) {
|
||||
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNALU.ordinal()]);
|
||||
gc.drawLine(xBegin, yOffsetT, xBegin, yOffsetB);
|
||||
@ -303,7 +304,7 @@ public class SignalPainter extends TrackPainter {
|
||||
} else {
|
||||
Color color = waveCanvas.colors[WaveformColors.SIGNALX.ordinal()];
|
||||
int yOffset = yOffsetM;
|
||||
switch (((ISignalChangeBit) left).getValue()) {
|
||||
switch (((BitVector) left).getValue()[0]) {
|
||||
case '1':
|
||||
color = waveCanvas.colors[WaveformColors.SIGNAL1.ordinal()];
|
||||
yOffset = yOffsetT;
|
||||
@ -323,7 +324,7 @@ public class SignalPainter extends TrackPainter {
|
||||
} else {
|
||||
gc.drawLine(xBegin, yOffset, xEnd, yOffset);
|
||||
int yNext = yOffsetM;
|
||||
switch (((ISignalChangeBit) right).getValue()) {
|
||||
switch (((BitVector) right).getValue()[0]) {
|
||||
case '1':
|
||||
yNext = yOffsetT;
|
||||
break;
|
||||
@ -347,16 +348,15 @@ public class SignalPainter extends TrackPainter {
|
||||
|
||||
boolean continous=true;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public RealStencil(NavigableMap<Long, ? extends ISignalChange> entries, ISignalChange left, boolean continous) {
|
||||
public RealStencil(NavigableMap<Long, ?> entries, Object left, boolean continous) {
|
||||
this.continous=continous;
|
||||
Collection<ISignalChangeReal> values = ((NavigableMap<Long, ISignalChangeReal>) entries).values();
|
||||
minVal=((ISignalChangeReal) left).getValue();
|
||||
Collection<?> values = ((NavigableMap<Long, ?>) entries).values();
|
||||
minVal=(Double) left;
|
||||
range=2.0;
|
||||
if(!values.isEmpty()) {
|
||||
double maxVal=minVal;
|
||||
for (ISignalChange e : entries.values()) {
|
||||
double v = ((ISignalChangeReal)e).getValue();
|
||||
for (Object e : entries.values()) {
|
||||
double v = ((Double)e);
|
||||
if(Double.isNaN(maxVal))
|
||||
maxVal=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) {
|
||||
double leftVal = ((ISignalChangeReal) left).getValue();
|
||||
double rightVal= ((ISignalChangeReal) right).getValue();
|
||||
@SuppressWarnings("unchecked")
|
||||
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
double leftVal = (Double) left;
|
||||
double rightVal= (Double) right;
|
||||
if(Double.isNaN(leftVal)) {
|
||||
Color color = waveCanvas.colors[WaveformColors.SIGNAL_NAN.ordinal()];
|
||||
int width = xEnd - xBegin;
|
||||
|
@ -80,7 +80,7 @@ public class WaveformCanvas extends Canvas {
|
||||
|
||||
private List<CursorPainter> cursorPainters;
|
||||
|
||||
HashMap<IWaveform<?>, IWaveformPainter> wave2painterMap;
|
||||
HashMap<IWaveform, IWaveformPainter> wave2painterMap;
|
||||
/**
|
||||
* Constructor for ScrollableCanvas.
|
||||
*
|
||||
@ -438,7 +438,7 @@ public class WaveformCanvas extends Canvas {
|
||||
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<>();
|
||||
int x = i - origin.x;
|
||||
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()) {
|
||||
TrackEntry te = painter.getTrackEntry();
|
||||
if(te.waveform == waveform) {
|
||||
|
@ -13,6 +13,8 @@ package com.minres.scviewer.database.swt.internal;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@ -70,11 +72,8 @@ import org.eclipse.swt.widgets.Widget;
|
||||
import org.eclipse.wb.swt.SWTResourceManager;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.minres.scviewer.database.BitVector;
|
||||
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.ITxEvent;
|
||||
import com.minres.scviewer.database.ITxRelation;
|
||||
@ -95,6 +94,8 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
|
||||
private PropertyChangeSupport pcs;
|
||||
|
||||
static final DecimalFormat df = new DecimalFormat("#.00####");
|
||||
|
||||
private ITx currentTxSelection;
|
||||
|
||||
private TrackEntry currentWaveformSelection;
|
||||
@ -448,24 +449,28 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
private void updateValueList(){
|
||||
final Long time = getCursorTime();
|
||||
for(TrackEntry entry:streams){
|
||||
if(entry.isSignal()){
|
||||
ISignalChange event = ((ISignal<?>)entry.waveform).getWaveformEventsBeforeTime(time);
|
||||
if(event instanceof ISignalChangeBit){
|
||||
entry.currentValue="b'"+((ISignalChangeBit)event).getValue();
|
||||
} else if(event instanceof ISignalChangeBitVector){
|
||||
// TODO: same code resides in SignalPainter, fix it
|
||||
switch(entry.valueDisplay) {
|
||||
case SIGNED:
|
||||
entry.currentValue=Long.toString(((ISignalChangeBitVector)event).getValue().toSignedValue());
|
||||
break;
|
||||
case UNSIGNED:
|
||||
entry.currentValue=Long.toString(((ISignalChangeBitVector)event).getValue().toUnsignedValue());
|
||||
break;
|
||||
default:
|
||||
entry.currentValue="h'"+((ISignalChangeBitVector)event).getValue().toHexString();
|
||||
if(entry.isSignal()){
|
||||
ISignal<?> signal = (ISignal<?>) entry.waveform;
|
||||
Object value = signal.getWaveformValueBeforeTime(time);
|
||||
if(value instanceof BitVector){
|
||||
BitVector bv = (BitVector) value;
|
||||
if(bv.getWidth()==1)
|
||||
entry.currentValue="b'"+bv;
|
||||
else {
|
||||
// TODO: same code resides in SignalPainter, fix it
|
||||
switch(entry.valueDisplay) {
|
||||
case SIGNED:
|
||||
entry.currentValue=Long.toString(bv.toSignedValue());
|
||||
break;
|
||||
case UNSIGNED:
|
||||
entry.currentValue=Long.toString(bv.toUnsignedValue());
|
||||
break;
|
||||
default:
|
||||
entry.currentValue="h'"+bv.toHexString();
|
||||
}
|
||||
}
|
||||
} else if(event instanceof ISignalChangeReal){
|
||||
double val = ((ISignalChangeReal)event).getValue();
|
||||
} else if(value instanceof Double){
|
||||
Double val = (Double) value;
|
||||
if(val>0.001)
|
||||
entry.currentValue=String.format("%1$,.3f", val);
|
||||
else
|
||||
@ -486,15 +491,13 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
}
|
||||
firstTx=stream.getEvents().lowerEntry(firstTx.getKey());
|
||||
}while(firstTx!=null && !isArrayFull(resultsList));
|
||||
String value=null;
|
||||
entry.currentValue="";
|
||||
boolean separator=false;
|
||||
for(ITx o:resultsList){
|
||||
if(value==null)
|
||||
value=new String();
|
||||
else
|
||||
value+="|";
|
||||
if(o!=null) value+=((ITx)o).getGenerator().getName();
|
||||
if(separator) entry.currentValue+="|";
|
||||
if(o!=null) entry.currentValue+=((ITx)o).getGenerator().getName();
|
||||
separator=true;
|
||||
}
|
||||
entry.currentValue=value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -813,13 +816,13 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
Rectangle subArea = new Rectangle(rect.x, 0, rect.width, waveformCanvas.getTrackHeight());
|
||||
if (lastKey == firstKey) {
|
||||
TrackEntry trackEntry=trackVerticalOffset.get(firstKey);
|
||||
IWaveform<? extends IWaveformEvent> w = trackEntry.waveform;
|
||||
IWaveform w = trackEntry.waveform;
|
||||
if (w instanceof ITxStream<?>)
|
||||
subArea.height *= ((ITxStream<?>) w).getMaxConcurrency();
|
||||
drawTextFormat(gc, subArea, firstKey, w.getFullName(), trackEntry.selected);
|
||||
} else {
|
||||
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();
|
||||
if (w instanceof ITxStream<?>)
|
||||
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());
|
||||
if (lastKey == firstKey) {
|
||||
TrackEntry trackEntry=trackVerticalOffset.get(firstKey);
|
||||
IWaveform<? extends IWaveformEvent> w = trackEntry.waveform;
|
||||
IWaveform w = trackEntry.waveform;
|
||||
if (w instanceof ITxStream<?>)
|
||||
subArea.height *= ((ITxStream<?>) w).getMaxConcurrency();
|
||||
drawValue(gc, subArea, firstKey, trackEntry.currentValue, trackEntry.selected);
|
||||
} else {
|
||||
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();
|
||||
if (w instanceof ITxStream<?>)
|
||||
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)
|
||||
if(trackEntry.waveform.equals(source)) return trackEntry;
|
||||
return null;
|
||||
@ -1178,7 +1181,8 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
public String getScaledTime(long time) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
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)
|
||||
|
@ -59,7 +59,7 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi
|
||||
|
||||
public List<TrackEntry> getStreamList();
|
||||
|
||||
public TrackEntry getEntryForStream(IWaveform<?> source);
|
||||
public TrackEntry getEntryForStream(IWaveform source);
|
||||
|
||||
public void moveSelectedTrack(int i);
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
package com.minres.scviewer.database.ui;
|
||||
|
||||
import com.minres.scviewer.database.ISignal;
|
||||
import com.minres.scviewer.database.ISignalChange;
|
||||
import com.minres.scviewer.database.ITxEvent;
|
||||
import com.minres.scviewer.database.ITxStream;
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
@ -28,7 +27,7 @@ public class TrackEntry {
|
||||
DEFAULT, STEP_WISE, CONTINOUS
|
||||
}
|
||||
|
||||
final public IWaveform<? extends IWaveformEvent> waveform;
|
||||
final public IWaveform waveform;
|
||||
|
||||
public int vOffset;
|
||||
|
||||
@ -42,7 +41,7 @@ public class TrackEntry {
|
||||
|
||||
public WaveDisplay waveDisplay = WaveDisplay.DEFAULT;
|
||||
|
||||
public TrackEntry(IWaveform<? extends IWaveformEvent> waveform) {
|
||||
public TrackEntry(IWaveform waveform) {
|
||||
this.waveform = waveform;
|
||||
vOffset=0;
|
||||
height=0;
|
||||
@ -61,7 +60,7 @@ public class TrackEntry {
|
||||
return waveform instanceof ISignal<?>;
|
||||
}
|
||||
|
||||
public ISignal<? extends ISignalChange> getSignal(){
|
||||
public ISignal<?> getSignal(){
|
||||
return (ISignal<?>) waveform;
|
||||
}
|
||||
|
||||
|
@ -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";
|
||||
}
|
@ -47,6 +47,7 @@ public class Messages extends NLS {
|
||||
public static String WaveformViewer_19;
|
||||
public static String WaveformViewer_20;
|
||||
public static String WaveformViewer_21;
|
||||
public static String WaveformViewer_22;
|
||||
public static String WaveformViewer_37;
|
||||
public static String WaveformViewer_38;
|
||||
public static String WaveformViewer_39;
|
||||
|
@ -22,10 +22,8 @@ import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
|
||||
import com.minres.scviewer.database.BitVector;
|
||||
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.e4.application.parts.WaveformViewer;
|
||||
|
||||
@ -45,8 +43,8 @@ public class WaveformPopupMenuContribution {
|
||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
Object selected = ((IStructuredSelection)sel).getFirstElement();
|
||||
if(selected instanceof ISignal<?>) {
|
||||
ISignalChange s = (ISignalChange) ((ISignal<?>) selected).getEvents().firstEntry().getValue();
|
||||
if((s instanceof ISignalChangeReal) || (s instanceof ISignalChangeBitVector)) {
|
||||
Object x = ((ISignal<?>) selected).getEvents().firstEntry().getValue();
|
||||
if((x instanceof Double) || (x instanceof BitVector)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -67,13 +65,13 @@ public class WaveformPopupMenuContribution {
|
||||
Object second=null;
|
||||
if(it.hasNext()) second=it.next();
|
||||
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
|
||||
if((s instanceof ISignalChangeReal) || (s instanceof ISignalChangeBitVector)) {
|
||||
if((o instanceof Double) || (o instanceof BitVector)) {
|
||||
TrackEntry entry=nullEntry;
|
||||
if(second instanceof TrackEntry)
|
||||
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, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, entry.valueDisplay);
|
||||
addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, entry.valueDisplay);
|
||||
|
@ -56,7 +56,7 @@ public class AddWaveformHandler {
|
||||
if(designBrowser==null) designBrowser = getListPart( partService);
|
||||
if(designBrowser!=null && selection.size()>0){
|
||||
List<?> sel=selection.toList();
|
||||
designBrowser.getActiveWaveformViewerPart().addStreamsToList(sel.toArray(new IWaveform<?>[]{}),
|
||||
designBrowser.getActiveWaveformViewerPart().addStreamsToList(sel.toArray(new IWaveform[]{}),
|
||||
"before".equalsIgnoreCase(where)); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
@ -25,15 +25,15 @@ public class DeleteWaveformHandler {
|
||||
@CanExecute
|
||||
public Boolean canExecute(ESelectionService selectionService){
|
||||
Object o = selectionService.getSelection();
|
||||
return o instanceof IStructuredSelection && ((IStructuredSelection)o).getFirstElement() instanceof IWaveform<?>;
|
||||
return o instanceof IStructuredSelection && ((IStructuredSelection)o).getFirstElement() instanceof IWaveform;
|
||||
}
|
||||
|
||||
@Execute
|
||||
public void execute(ESelectionService selectionService, MPart activePart) {
|
||||
Object o = activePart.getObject();
|
||||
Object sel = selectionService.getSelection();
|
||||
if(o instanceof WaveformViewer && ((IStructuredSelection)sel).getFirstElement() instanceof IWaveform<?>){
|
||||
((WaveformViewer)o).removeStreamFromList((IWaveform<?>) ((IStructuredSelection)sel).getFirstElement());
|
||||
if(o instanceof WaveformViewer && ((IStructuredSelection)sel).getFirstElement() instanceof IWaveform){
|
||||
((WaveformViewer)o).removeStreamFromList((IWaveform) ((IStructuredSelection)sel).getFirstElement());
|
||||
}
|
||||
}
|
||||
}
|
@ -33,7 +33,7 @@ public class MoveWaveformHandler {
|
||||
Object sel = selectionService.getSelection();
|
||||
if( sel instanceof IStructuredSelection) {
|
||||
Object o= ((IStructuredSelection)sel).getFirstElement();
|
||||
return o instanceof IWaveform<?> || o instanceof ITx;
|
||||
return o instanceof IWaveform || o instanceof ITx;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class NavigateEvent {
|
||||
Object sel = selectionService.getSelection();
|
||||
if( sel instanceof IStructuredSelection) {
|
||||
Object o= ((IStructuredSelection)sel).getFirstElement();
|
||||
return o instanceof IWaveform<?> || o instanceof ITx;
|
||||
return o instanceof IWaveform || o instanceof ITx;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.ProgressBar;
|
||||
import org.osgi.service.prefs.PreferencesService;
|
||||
|
||||
import com.minres.scviewer.e4.application.AppModelId;
|
||||
import com.minres.scviewer.e4.application.Messages;
|
||||
|
||||
/**
|
||||
@ -80,11 +81,11 @@ public class StatusBarControl {
|
||||
*/
|
||||
@PostConstruct
|
||||
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);
|
||||
} 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);
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ public class WaveStatusBarControl extends StatusBarControl {
|
||||
label=new CLabel(box, SWT.SHADOW_NONE);
|
||||
label.setText(labelString);
|
||||
text=new CLabel(box, SWT.SHADOW_IN);
|
||||
text.setAlignment(SWT.RIGHT);
|
||||
GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
|
||||
layoutData.minimumWidth=width;
|
||||
text.setLayoutData(layoutData);
|
||||
@ -126,10 +127,10 @@ public class WaveStatusBarControl extends StatusBarControl {
|
||||
@Inject
|
||||
public WaveStatusBarControl(UISynchronize sync) {
|
||||
super(sync);
|
||||
cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5, 80);
|
||||
markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6, 80);
|
||||
markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7, 80);
|
||||
zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8, 80);
|
||||
cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5, 150);
|
||||
markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6, 150);
|
||||
markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7, 150);
|
||||
zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8, 60);
|
||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution);
|
||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution);
|
||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution);
|
||||
|
@ -8,7 +8,7 @@ DesignBrowser_8=Insert before
|
||||
LoadingWaveformDb_0=Database loading...
|
||||
LoadStoreSettingsHandler_2=*.scview
|
||||
LoadStoreSettingsHandler_3=SCViewer.scview
|
||||
OpenHandler_0=*.vcd;*.txdb;*.txlog
|
||||
OpenHandler_0=*.vcd;*.txdb;*.txlog;CURRENT
|
||||
QuitHandler_0=Confirmation
|
||||
QuitHandler_1=Do you want to exit?
|
||||
RelationTypeToolControl_0=------------
|
||||
@ -41,6 +41,7 @@ WaveformViewer_18=Would you like to reload the database?
|
||||
WaveformViewer_19=vcd
|
||||
WaveformViewer_20=txdb
|
||||
WaveformViewer_21=txlog
|
||||
WaveformViewer_22=txldb
|
||||
WaveformViewer_37=Database open
|
||||
WaveformViewer_38=Would you like to open the adjacent database
|
||||
WaveformViewer_39=\ as well?
|
||||
|
@ -388,7 +388,7 @@ public class DesignBrowser {
|
||||
Object object= ((IStructuredSelection)selection).getFirstElement();
|
||||
if(object instanceof IHierNode&& ((IHierNode)object).getChildNodes().size()!=0)
|
||||
txTableViewer.setInput(object);
|
||||
otherSelectionCount = (object instanceof IWaveform<?> || object instanceof ITx)?1:0;
|
||||
otherSelectionCount = (object instanceof IWaveform || object instanceof ITx)?1:0;
|
||||
}
|
||||
}
|
||||
updateButtons();
|
||||
@ -437,7 +437,7 @@ public class DesignBrowser {
|
||||
if (searchString == null || searchString.length() == 0) {
|
||||
return true;
|
||||
}
|
||||
IWaveform<?> p = (IWaveform<?>) element;
|
||||
IWaveform p = (IWaveform) element;
|
||||
if (p.getName().matches(searchString)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -58,13 +58,13 @@ public class LoadingWaveformDb implements IWaveformDb {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IWaveform<? extends IWaveformEvent> getStreamByName(String name) {
|
||||
public IWaveform getStreamByName(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IWaveform<?>> getAllWaves() {
|
||||
return new ArrayList<IWaveform<?>>();
|
||||
public List<IWaveform> getAllWaves() {
|
||||
return new ArrayList<IWaveform>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -499,6 +499,9 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
if (partInput instanceof File) {
|
||||
filesToLoad = new ArrayList<File>();
|
||||
File file = (File) partInput;
|
||||
if(file.isFile() && "CURRENT".equals(file.getName())){
|
||||
file=file.getParentFile();
|
||||
}
|
||||
if (file.exists()) {
|
||||
filesToLoad.add(file);
|
||||
try {
|
||||
@ -508,8 +511,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_20)));
|
||||
} else if (askIfToLoad(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)))) {
|
||||
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$
|
||||
List<TrackEntry> res = new LinkedList<>();
|
||||
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) {
|
||||
TrackEntry t = new TrackEntry(waveform);
|
||||
res.add(t);
|
||||
@ -685,8 +693,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
Object sel = o == null ? selectionService.getSelection() : o;
|
||||
if (sel instanceof IStructuredSelection)
|
||||
for (Object el : ((IStructuredSelection) sel).toArray()) {
|
||||
if (el instanceof IWaveform<?>)
|
||||
addStreamToList((IWaveform<?>) el, false);
|
||||
if (el instanceof IWaveform)
|
||||
addStreamToList((IWaveform) el, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -761,8 +769,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
* @param obj the obj
|
||||
* @param insert the insert
|
||||
*/
|
||||
public void addStreamToList(IWaveform<? extends IWaveformEvent> obj, boolean insert) {
|
||||
addStreamsToList(new IWaveform<?>[] { obj }, insert);
|
||||
public void addStreamToList(IWaveform obj, boolean insert) {
|
||||
addStreamsToList(new IWaveform[] { obj }, insert);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -771,16 +779,16 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
* @param iWaveforms the i waveforms
|
||||
* @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<>();
|
||||
for (IWaveform<? extends IWaveformEvent> stream : iWaveforms)
|
||||
for (IWaveform stream : iWaveforms)
|
||||
streams.add(new TrackEntry(stream));
|
||||
IStructuredSelection selection = (IStructuredSelection) waveformPane.getSelection();
|
||||
if (selection.size() == 0) {
|
||||
waveformPane.getStreamList().addAll(streams);
|
||||
} else {
|
||||
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);
|
||||
int index = waveformPane.getStreamList().indexOf(trackEntry);
|
||||
if (!insert)
|
||||
@ -795,7 +803,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
*
|
||||
* @param stream the stream
|
||||
*/
|
||||
public void removeStreamFromList(IWaveform<? extends IWaveformEvent> stream) {
|
||||
public void removeStreamFromList(IWaveform stream) {
|
||||
TrackEntry trackEntry = waveformPane.getEntryForStream(stream);
|
||||
List<TrackEntry> streams = waveformPane.getStreamList();
|
||||
ISelection sel = waveformPane.getSelection();
|
||||
@ -822,8 +830,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
*
|
||||
* @param iWaveforms the i waveforms
|
||||
*/
|
||||
public void removeStreamsFromList(IWaveform<? extends IWaveformEvent>[] iWaveforms) {
|
||||
for (IWaveform<? extends IWaveformEvent> stream : iWaveforms)
|
||||
public void removeStreamsFromList(IWaveform[] iWaveforms) {
|
||||
for (IWaveform stream : iWaveforms)
|
||||
removeStreamFromList(stream);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||
@Override
|
||||
public boolean apply(IHierNode arg0) {
|
||||
if(showNodes){
|
||||
return arg0 instanceof IWaveform<?>;
|
||||
return arg0 instanceof IWaveform;
|
||||
} else{
|
||||
return arg0.getChildNodes().size()!=0;
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ import org.eclipse.jface.viewers.ILabelProviderListener;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.wb.swt.ResourceManager;
|
||||
|
||||
import com.minres.scviewer.database.BitVector;
|
||||
import com.minres.scviewer.database.IHierNode;
|
||||
import com.minres.scviewer.database.ISignal;
|
||||
import com.minres.scviewer.database.ISignalChangeBitVector;
|
||||
import com.minres.scviewer.database.ITxStream;
|
||||
import com.minres.scviewer.database.IWaveformDb;
|
||||
import com.minres.scviewer.e4.application.parts.LoadingWaveformDb;
|
||||
@ -101,10 +101,10 @@ public class TxDbLabelProvider implements ILabelProvider {
|
||||
return stream;
|
||||
}else if(element instanceof ISignal<?>){
|
||||
Object o = ((ISignal<?>)element).getEvents().firstEntry().getValue();
|
||||
if(o instanceof ISignalChangeBitVector)
|
||||
return wave;
|
||||
else
|
||||
if(o instanceof BitVector && ((BitVector)o).getWidth()==1)
|
||||
return signal;
|
||||
else
|
||||
return wave;
|
||||
}else if(element instanceof IHierNode){
|
||||
return folder;
|
||||
} else
|
||||
|
@ -47,6 +47,7 @@
|
||||
<plugin id="com.google.guava"/>
|
||||
<plugin id="com.ibm.icu"/>
|
||||
<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.text"/>
|
||||
<plugin id="com.minres.scviewer.database.ui"/>
|
||||
|
@ -242,7 +242,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||
((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames().size()>0){
|
||||
LinkedList<TrackEntry> entries= new LinkedList<>();
|
||||
for(String streamName:((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames()){
|
||||
IWaveform<? extends IWaveformEvent> stream = database.getStreamByName(streamName);
|
||||
IWaveform stream = database.getStreamByName(streamName);
|
||||
if(stream!=null)
|
||||
entries.add(new TrackEntry(stream));
|
||||
}
|
||||
@ -333,7 +333,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||
return database;
|
||||
}
|
||||
|
||||
public void addStreamToList(IWaveform<? extends IWaveformEvent> obj){
|
||||
public void addStreamToList(IWaveform obj){
|
||||
if(getEditorInput() instanceof TxEditorInput && !((TxEditorInput) getEditorInput()).getStreamNames().contains(obj.getFullName())){
|
||||
((TxEditorInput) getEditorInput()).getStreamNames().add(obj.getFullName());
|
||||
txDisplay.getStreamList().add(new TrackEntry(obj));
|
||||
@ -342,12 +342,12 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||
|
||||
}
|
||||
|
||||
public void addStreamsToList(IWaveform<? extends IWaveformEvent>[] iWaveforms){
|
||||
for(IWaveform<? extends IWaveformEvent> stream:iWaveforms)
|
||||
public void addStreamsToList(IWaveform[] iWaveforms){
|
||||
for(IWaveform stream:iWaveforms)
|
||||
addStreamToList(stream);
|
||||
}
|
||||
|
||||
public void removeStreamFromList(IWaveform<? extends IWaveformEvent> waveform){
|
||||
public void removeStreamFromList(IWaveform waveform){
|
||||
if(getEditorInput() instanceof TxEditorInput && ((TxEditorInput) getEditorInput()).getStreamNames().contains(waveform.getFullName())){
|
||||
((TxEditorInput) getEditorInput()).getStreamNames().remove(waveform.getFullName());
|
||||
}
|
||||
@ -361,8 +361,8 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||
txDisplay.getStreamList().remove(entry);
|
||||
}
|
||||
|
||||
public void removeStreamsFromList(IWaveform<? extends IWaveformEvent>[] iWaveforms){
|
||||
for(IWaveform<? extends IWaveformEvent> stream:iWaveforms)
|
||||
public void removeStreamsFromList(IWaveform[] iWaveforms){
|
||||
for(IWaveform stream:iWaveforms)
|
||||
removeStreamFromList(stream);
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,8 @@ public class RemoveHandler extends AbstractHandler {
|
||||
if(editor instanceof TxEditorPart){
|
||||
TxEditorPart editorPart = (TxEditorPart) editor;
|
||||
ISelection selection =editorPart.getSelection();
|
||||
if(selection instanceof StructuredSelection && ((StructuredSelection)selection).getFirstElement() instanceof IWaveform<?>){
|
||||
editorPart.removeStreamFromList((IWaveform<? extends IWaveformEvent>) ((StructuredSelection)selection).getFirstElement());
|
||||
if(selection instanceof StructuredSelection && ((StructuredSelection)selection).getFirstElement() instanceof IWaveform){
|
||||
editorPart.removeStreamFromList((IWaveform) ((StructuredSelection)selection).getFirstElement());
|
||||
editorPart.setSelection(new StructuredSelection());
|
||||
}
|
||||
}
|
||||
|
@ -183,16 +183,16 @@ public class TxOutlinePage extends ContentOutlinePage implements ISelectionList
|
||||
for(Object obj :selection.toArray()){
|
||||
if(obj instanceof IWaveform){
|
||||
if(remove)
|
||||
editor.removeStreamFromList((IWaveform<? extends IWaveformEvent>) obj);
|
||||
editor.removeStreamFromList((IWaveform) obj);
|
||||
else
|
||||
editor.addStreamToList((IWaveform<? extends IWaveformEvent>) obj);
|
||||
editor.addStreamToList((IWaveform) obj);
|
||||
} else if(obj instanceof 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);
|
||||
while(queue.size()>0){
|
||||
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());
|
||||
}
|
||||
if(remove)
|
||||
|
Loading…
Reference in New Issue
Block a user