Merge branch 'release/v2.6.2'
This commit is contained in:
commit
62e0ec2008
|
@ -12,15 +12,15 @@ package com.minres.scviewer.database.swt;
|
|||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.minres.scviewer.database.swt.internal.WaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewerFactory;
|
||||
import com.minres.scviewer.database.swt.internal.WaveformView;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewFactory;
|
||||
|
||||
public class WaveformViewerFactory implements IWaveformViewerFactory {
|
||||
public class WaveformViewFactory implements IWaveformViewFactory {
|
||||
|
||||
@Override
|
||||
public IWaveformViewer createPanel(Composite parent) {
|
||||
return new WaveformViewer(parent);
|
||||
public IWaveformView createPanel(Composite parent) {
|
||||
return new WaveformView(parent);
|
||||
}
|
||||
|
||||
}
|
|
@ -249,7 +249,7 @@ public class SignalPainter extends TrackPainter {
|
|||
final boolean continous;
|
||||
private long minVal;
|
||||
private long range;
|
||||
|
||||
double yRange = (yOffsetB-yOffsetT);
|
||||
public MultiBitStencilAnalog(NavigableMap<Long, ?> entries, Object left, boolean continous, boolean signed) {
|
||||
this.continous=continous;
|
||||
Collection<?> values = ((NavigableMap<Long, ?>) entries).values();
|
||||
|
@ -276,8 +276,8 @@ public class SignalPainter extends TrackPainter {
|
|||
long leftVal = ((BitVector) left).toUnsignedValue();
|
||||
long rightVal= ((BitVector) right).toUnsignedValue();
|
||||
proj.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetRight = (int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) * yRange / range);
|
||||
int yOffsetRight = (int) ((rightVal-minVal) * yRange / range);
|
||||
if(continous) {
|
||||
if (xEnd > maxPosX) {
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
||||
|
@ -401,8 +401,8 @@ public class SignalPainter extends TrackPainter {
|
|||
}
|
||||
} else {
|
||||
proj.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetRight = Double.isNaN(rightVal)?yOffsetLeft:(int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) * (yOffsetB-yOffsetT) / range);
|
||||
int yOffsetRight = Double.isNaN(rightVal)?yOffsetLeft:(int) ((rightVal-minVal) * (yOffsetB-yOffsetT) / range);
|
||||
if(continous) {
|
||||
if (xEnd > maxPosX) {
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.eclipse.swt.events.SelectionAdapter;
|
|||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
@ -40,7 +41,7 @@ import com.minres.scviewer.database.ITx;
|
|||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.RelationType;
|
||||
import com.minres.scviewer.database.swt.Constants;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
|
||||
|
@ -48,6 +49,8 @@ public class WaveformCanvas extends Canvas {
|
|||
|
||||
Color[] colors = new Color[WaveformColors.values().length];
|
||||
|
||||
private boolean doubleBuffering = true;
|
||||
|
||||
private int trackHeight = 50;
|
||||
|
||||
private long scaleFactor = 1000000L; // 1ns
|
||||
|
@ -110,7 +113,7 @@ public class WaveformCanvas extends Canvas {
|
|||
painterList.add(trackAreaPainter);
|
||||
rulerPainter=new RulerPainter(this);
|
||||
painterList.add(rulerPainter);
|
||||
arrowPainter=new ArrowPainter(this, IWaveformViewer.NEXT_PREV_IN_STREAM);
|
||||
arrowPainter=new ArrowPainter(this, IWaveformView.NEXT_PREV_IN_STREAM);
|
||||
painterList.add(arrowPainter);
|
||||
CursorPainter cp = new CursorPainter(this, scaleFactor * 10, cursorPainters.size()-1);
|
||||
painterList.add(cp);
|
||||
|
@ -398,7 +401,18 @@ public class WaveformCanvas extends Canvas {
|
|||
/* Paint function */
|
||||
private void paint(GC gc) {
|
||||
Rectangle clientRect = getClientArea(); /* Canvas' painting area */
|
||||
Projection p = new Projection(gc);
|
||||
GC thisGc = gc;
|
||||
Image d_backingImg = null;
|
||||
if(doubleBuffering) {
|
||||
Point p = getSize();
|
||||
d_backingImg = new Image(getDisplay(), p.x, p.y);
|
||||
thisGc = new GC(d_backingImg);
|
||||
thisGc.setBackground(gc.getBackground());
|
||||
thisGc.setForeground(gc.getForeground());
|
||||
thisGc.setFont(gc.getFont());
|
||||
|
||||
}
|
||||
Projection p = new Projection(thisGc);
|
||||
p.setTranslation(origin);
|
||||
if (painterList.size() > 0 ) {
|
||||
for (IPainter painter : painterList)
|
||||
|
@ -407,6 +421,11 @@ public class WaveformCanvas extends Canvas {
|
|||
gc.fillRectangle(clientRect);
|
||||
initScrollBars();
|
||||
}
|
||||
if(doubleBuffering) {
|
||||
gc.drawImage(d_backingImg, 0, 0);
|
||||
d_backingImg.dispose();
|
||||
thisGc.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Object> getElementsAt(Point point) {
|
||||
|
|
|
@ -89,11 +89,11 @@ import com.minres.scviewer.database.RelationType;
|
|||
import com.minres.scviewer.database.swt.Constants;
|
||||
import com.minres.scviewer.database.ui.GotoDirection;
|
||||
import com.minres.scviewer.database.ui.ICursor;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
|
||||
public class WaveformViewer implements IWaveformViewer {
|
||||
public class WaveformView implements IWaveformView {
|
||||
|
||||
private ListenerList<ISelectionChangedListener> selectionChangedListeners = new ListenerList<ISelectionChangedListener>();
|
||||
|
||||
|
@ -185,8 +185,7 @@ public class WaveformViewer implements IWaveformViewer {
|
|||
gc.setAlpha(128);
|
||||
int minX = Math.min(start.x, end.x);
|
||||
int width = Math.max(start.x, end.x) - minX;
|
||||
Point origin = waveformCanvas.getOrigin();
|
||||
int y_top = waveformCanvas.getRulerHeight()- origin.y;
|
||||
int y_top = waveformCanvas.getRulerHeight();
|
||||
int y_bottom = waveformCanvas.getSize().y;
|
||||
gc.fillRectangle(minX, y_top, width,y_bottom);
|
||||
}
|
||||
|
@ -288,7 +287,7 @@ public class WaveformViewer implements IWaveformViewer {
|
|||
};
|
||||
protected WaveformMouseListener waveformMouseListener = new WaveformMouseListener();
|
||||
|
||||
public WaveformViewer(Composite parent) {
|
||||
public WaveformView(Composite parent) {
|
||||
pcs=new PropertyChangeSupport(this);
|
||||
|
||||
trackVerticalOffset = new TreeMap<Integer, TrackEntry>();
|
||||
|
@ -755,7 +754,7 @@ public class WaveformViewer implements IWaveformViewer {
|
|||
@Override
|
||||
public void moveSelection(GotoDirection direction, RelationType relationType) {
|
||||
if (currentWaveformSelection!=null && currentWaveformSelection.isStream() && currentTxSelection!=null) {
|
||||
if(relationType.equals(IWaveformViewer.NEXT_PREV_IN_STREAM)){
|
||||
if(relationType.equals(IWaveformView.NEXT_PREV_IN_STREAM)){
|
||||
ITxStream<? extends ITxEvent> stream = currentWaveformSelection.getStream();
|
||||
ITx transaction = null;
|
||||
if (direction == GotoDirection.NEXT) {
|
|
@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.Control;
|
|||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.RelationType;
|
||||
|
||||
public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvider{
|
||||
public interface IWaveformView extends PropertyChangeListener, ISelectionProvider{
|
||||
|
||||
String CURSOR_PROPERTY = "cursor_time";
|
||||
|
|
@ -12,6 +12,6 @@ package com.minres.scviewer.database.ui;
|
|||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
public interface IWaveformViewerFactory {
|
||||
public IWaveformViewer createPanel(Composite parent);
|
||||
public interface IWaveformViewFactory {
|
||||
public IWaveformView createPanel(Composite parent);
|
||||
}
|
|
@ -41,6 +41,7 @@ public class Messages extends NLS {
|
|||
public static String TransactionDetails_21;
|
||||
public static String TransactionDetails_3;
|
||||
public static String TransactionDetails_4;
|
||||
public static String WaveformPreferencesPage_description;
|
||||
public static String WaveformPreferencesPage_1;
|
||||
public static String WaveformViewer_13;
|
||||
public static String WaveformViewer_14;
|
||||
|
@ -61,6 +62,30 @@ public class Messages extends NLS {
|
|||
public static String WaveStatusBarControl_6;
|
||||
public static String WaveStatusBarControl_7;
|
||||
public static String WaveStatusBarControl_8;
|
||||
public static String line;
|
||||
public static String line_highlite;
|
||||
public static String track_bg_even;
|
||||
public static String track_bg_odd;
|
||||
public static String track_bg_highlite;
|
||||
public static String tx_bg;
|
||||
public static String tx_bg_highlite;
|
||||
public static String tx_border;
|
||||
public static String signal0;
|
||||
public static String signal1;
|
||||
public static String signalz;
|
||||
public static String signalx;
|
||||
public static String signalu;
|
||||
public static String signal_text;
|
||||
public static String signal_real;
|
||||
public static String signal_nan;
|
||||
public static String cursor;
|
||||
public static String cursor_drag;
|
||||
public static String cursor_text;
|
||||
public static String marker;
|
||||
public static String marker_text;
|
||||
public static String rel_arrow;
|
||||
public static String rel_arrow_highlite;
|
||||
|
||||
static {
|
||||
// initialize resource bundle
|
||||
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
|
||||
|
|
|
@ -35,6 +35,7 @@ TransactionDetails_20=Time
|
|||
TransactionDetails_21=End time
|
||||
TransactionDetails_3=Value
|
||||
TransactionDetails_4=Relation
|
||||
WaveformPreferencesPage_description=Default Waveform Window Settings
|
||||
WaveformPreferencesPage_1=Color for
|
||||
WaveformViewer_13=Database Load Status
|
||||
WaveformViewer_14=Database Load Cancelled
|
||||
|
@ -55,3 +56,27 @@ WaveStatusBarControl_5=C:
|
|||
WaveStatusBarControl_6=M:
|
||||
WaveStatusBarControl_7=C-M:
|
||||
WaveStatusBarControl_8=Z:
|
||||
line=Track line
|
||||
line_highlite=higlighted Track line
|
||||
track_bg_even=even Track Background
|
||||
track_bg_odd=odd Track Background
|
||||
track_bg_highlite=highlighted Track Background
|
||||
tx_bg=Transaction Background
|
||||
tx_bg_highlite=highlighted Transaction Background
|
||||
tx_border=Transaction Border
|
||||
signal0=Signal Value '0'
|
||||
signal1=Signal Value '1'
|
||||
signalz=Signal Value 'Z'
|
||||
signalx=Signal Value 'X'
|
||||
signalu=Signal Value 'U'
|
||||
signal_text=Signal text
|
||||
signal_real=Signal real Value
|
||||
signal_nan=Signal NaN Value
|
||||
cursor=Cursor
|
||||
cursor_drag=dragged Cursor
|
||||
cursor_text=Cursor Text
|
||||
marker=Marker
|
||||
marker_text=Marker TExt
|
||||
rel_arrow=Relation arrow
|
||||
rel_arrow_highlite=highlighted Relation arrorw
|
||||
|
||||
|
|
|
@ -93,10 +93,10 @@ import com.minres.scviewer.database.RelationType;
|
|||
import com.minres.scviewer.database.swt.Constants;
|
||||
import com.minres.scviewer.database.swt.ToolTipContentProvider;
|
||||
import com.minres.scviewer.database.swt.ToolTipHelpTextProvider;
|
||||
import com.minres.scviewer.database.swt.WaveformViewerFactory;
|
||||
import com.minres.scviewer.database.swt.WaveformViewFactory;
|
||||
import com.minres.scviewer.database.ui.GotoDirection;
|
||||
import com.minres.scviewer.database.ui.ICursor;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
||||
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
||||
|
@ -164,10 +164,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
private static int disposeListenerNumber = 0;
|
||||
|
||||
/** The factory. */
|
||||
WaveformViewerFactory factory = new WaveformViewerFactory();
|
||||
WaveformViewFactory factory = new WaveformViewFactory();
|
||||
|
||||
/** The waveform pane. */
|
||||
private IWaveformViewer waveformPane;
|
||||
private IWaveformView waveformPane;
|
||||
|
||||
/** get UISynchronize injected as field */
|
||||
@Inject UISynchronize sync;
|
||||
|
@ -217,7 +217,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
private Object detailsSettings;
|
||||
|
||||
/** The navigation relation type. */
|
||||
private RelationType navigationRelationType=IWaveformViewer.NEXT_PREV_IN_STREAM ;
|
||||
private RelationType navigationRelationType=IWaveformView.NEXT_PREV_IN_STREAM ;
|
||||
|
||||
/** The file monitor. */
|
||||
FileMonitor fileMonitor = new FileMonitor();
|
||||
|
@ -262,7 +262,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
//set selection to empty selection when opening a new waveformPane
|
||||
selectionService.setSelection(new StructuredSelection());
|
||||
|
||||
waveformPane.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
waveformPane.addPropertyChangeListener(IWaveformView.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
Long time = (Long) evt.getNewValue();
|
||||
|
@ -272,7 +272,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
|
||||
}
|
||||
});
|
||||
waveformPane.addPropertyChangeListener(IWaveformViewer.MARKER_PROPERTY, new PropertyChangeListener() {
|
||||
waveformPane.addPropertyChangeListener(IWaveformView.MARKER_PROPERTY, new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
Long time = (Long) evt.getNewValue();
|
||||
|
@ -478,13 +478,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnShowHoverChange(@Preference(value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
public void reactOnShowHoverChange(@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE, value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
showHover=hover;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnReloadDatabaseChange(@Preference(value = PreferenceConstants.DATABASE_RELOAD) Boolean checkForUpdates) {
|
||||
public void reactOnReloadDatabaseChange(@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE, value = PreferenceConstants.DATABASE_RELOAD) Boolean checkForUpdates) {
|
||||
if (checkForUpdates) {
|
||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad, FILE_CHECK_INTERVAL);
|
||||
} else {
|
||||
|
@ -1215,7 +1215,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
*/
|
||||
public List<RelationType> getAllRelationTypes() {
|
||||
List<RelationType> res =new ArrayList<>();
|
||||
res.add(IWaveformViewer.NEXT_PREV_IN_STREAM);
|
||||
res.add(IWaveformView.NEXT_PREV_IN_STREAM);
|
||||
res.addAll(database.getAllRelationTypes());
|
||||
return res;
|
||||
}
|
||||
|
@ -1227,7 +1227,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||
*/
|
||||
public List<RelationType> getSelectionRelationTypes() {
|
||||
List<RelationType> res =new ArrayList<>();
|
||||
res.add(IWaveformViewer.NEXT_PREV_IN_STREAM);
|
||||
res.add(IWaveformView.NEXT_PREV_IN_STREAM);
|
||||
ISelection selection = waveformPane.getSelection();
|
||||
if(selection instanceof IStructuredSelection && !selection.isEmpty()){
|
||||
IStructuredSelection sel=(IStructuredSelection) selection;
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
*******************************************************************************/
|
||||
package com.minres.scviewer.e4.application.preferences;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.eclipse.jface.preference.ColorFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
|
||||
|
@ -26,6 +29,7 @@ public class WaveformPreferencesPage extends FieldEditorPreferencePage {
|
|||
*/
|
||||
public WaveformPreferencesPage() {
|
||||
super(GRID);
|
||||
setDescription(Messages.WaveformPreferencesPage_description);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -33,9 +37,18 @@ public class WaveformPreferencesPage extends FieldEditorPreferencePage {
|
|||
*/
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
|
||||
Field[] declaredFields = Messages.class.getDeclaredFields();
|
||||
HashMap<String, String> staticFields = new HashMap<String, String>();
|
||||
for (Field field : declaredFields) {
|
||||
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
|
||||
try {
|
||||
staticFields.put(field.getName(), (String)field.get(null));
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {}
|
||||
}
|
||||
}
|
||||
for (WaveformColors c : WaveformColors.values()) {
|
||||
addField(new ColorFieldEditor(c.name() + "_COLOR", Messages.WaveformPreferencesPage_1 + c.name().toLowerCase(), //$NON-NLS-1$
|
||||
addField(new ColorFieldEditor(c.name() + "_COLOR",
|
||||
Messages.WaveformPreferencesPage_1 + staticFields.get(c.name().toLowerCase()), //$NON-NLS-1$
|
||||
getFieldEditorParent()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
|
|||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.IWaveformDb;
|
||||
import com.minres.scviewer.database.IWaveformDbFactory;
|
||||
import com.minres.scviewer.database.swt.WaveformViewerFactory;
|
||||
import com.minres.scviewer.database.swt.WaveformViewFactory;
|
||||
import com.minres.scviewer.database.ui.GotoDirection;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.ui.views.TxOutlinePage;
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
|||
|
||||
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave";
|
||||
|
||||
private IWaveformViewer txDisplay;
|
||||
private IWaveformView txDisplay;
|
||||
|
||||
/** This is the root of the editor's model. */
|
||||
private IWaveformDb database;
|
||||
|
@ -112,10 +112,10 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
|||
}
|
||||
}
|
||||
});
|
||||
WaveformViewerFactory factory = new WaveformViewerFactory();
|
||||
WaveformViewFactory factory = new WaveformViewFactory();
|
||||
txDisplay = factory.createPanel(parent);
|
||||
txDisplay.setMaxTime(0);
|
||||
txDisplay.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
txDisplay.addPropertyChangeListener(IWaveformView.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
Long time = (Long) evt.getNewValue();
|
||||
|
|
Loading…
Reference in New Issue