2015-11-06 19:29:36 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* MINRES Technologies GmbH - initial API and implementation
|
|
|
|
*******************************************************************************/
|
|
|
|
package com.minres.scviewer.database.ui;
|
|
|
|
|
|
|
|
import com.minres.scviewer.database.ISignal;
|
|
|
|
import com.minres.scviewer.database.ITxEvent;
|
|
|
|
import com.minres.scviewer.database.ITxStream;
|
|
|
|
import com.minres.scviewer.database.IWaveform;
|
|
|
|
|
2018-10-14 08:59:17 +02:00
|
|
|
|
2015-11-06 19:29:36 +01:00
|
|
|
public class TrackEntry {
|
2018-10-14 08:59:17 +02:00
|
|
|
public enum ValueDisplay {
|
|
|
|
DEFAULT, SIGNED, UNSIGNED
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum WaveDisplay {
|
|
|
|
DEFAULT, STEP_WISE, CONTINOUS
|
|
|
|
}
|
|
|
|
|
2018-11-05 18:23:17 +01:00
|
|
|
final public IWaveform waveform;
|
2015-11-06 19:29:36 +01:00
|
|
|
|
|
|
|
public int vOffset;
|
|
|
|
|
|
|
|
public int height;
|
|
|
|
|
|
|
|
public boolean selected;
|
|
|
|
|
2018-10-14 08:59:17 +02:00
|
|
|
public String currentValue="";
|
|
|
|
|
|
|
|
public ValueDisplay valueDisplay = ValueDisplay.DEFAULT;
|
|
|
|
|
|
|
|
public WaveDisplay waveDisplay = WaveDisplay.DEFAULT;
|
|
|
|
|
2018-11-05 18:23:17 +01:00
|
|
|
public TrackEntry(IWaveform waveform) {
|
2015-11-06 19:29:36 +01:00
|
|
|
this.waveform = waveform;
|
|
|
|
vOffset=0;
|
|
|
|
height=0;
|
|
|
|
selected=false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isStream(){
|
|
|
|
return waveform instanceof ITxStream<?>;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ITxStream<? extends ITxEvent> getStream(){
|
|
|
|
return (ITxStream<?>) waveform;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isSignal(){
|
|
|
|
return waveform instanceof ISignal<?>;
|
|
|
|
}
|
|
|
|
|
2018-11-05 18:23:17 +01:00
|
|
|
public ISignal<?> getSignal(){
|
2015-11-06 19:29:36 +01:00
|
|
|
return (ISignal<?>) waveform;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if(obj instanceof TrackEntry){
|
|
|
|
TrackEntry o = (TrackEntry) obj;
|
|
|
|
return waveform==o.waveform && vOffset==o.vOffset;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|