Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
cf663bcae5 | |||
31e79e453c | |||
23a2f8d6c8 | |||
ceaf52bfa1 | |||
7a98eda464 | |||
c8e587c1ea | |||
d95683a146 | |||
07062d5618 | |||
e0b710efc4 | |||
e0f174173c | |||
12a7c701e3 | |||
cb259503cb | |||
8aca26e499 | |||
ebf3f920bf | |||
3b57ec029b | |||
01c9b7f1c2 | |||
a737f5588d | |||
8f838a96b7 |
@ -15,7 +15,9 @@
|
||||
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/>
|
||||
</launchConfiguration>
|
||||
|
@ -13,7 +13,9 @@
|
||||
<stringAttribute key="M2_USER_SETTINGS" value=""/>
|
||||
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/>
|
||||
</launchConfiguration>
|
||||
|
@ -18,7 +18,9 @@
|
||||
<stringAttribute key="bad_container_name" value="/com.minres.scviewer.parent/.launch"/>
|
||||
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/>
|
||||
</launchConfiguration>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
@ -183,8 +182,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
||||
}
|
||||
}
|
||||
rowCount=rowEndTime.size()>0?rowEndTime.size():1;
|
||||
//getChildNodes().parallelStream().forEach(c -> ((TxGenerator)c).calculateConcurrency());
|
||||
getChildNodes().stream().forEach(c -> ((TxGenerator)c).calculateConcurrency());
|
||||
getChildNodes().parallelStream().forEach(c -> ((TxGenerator)c).calculateConcurrency());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working.
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
@ -17,15 +16,13 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.commons.compress.compressors.lz4.BlockLZ4CompressorInputStream;
|
||||
import org.eclipse.collections.impl.map.mutable.UnifiedMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -42,7 +39,6 @@ import com.minres.scviewer.database.RelationType;
|
||||
import com.minres.scviewer.database.RelationTypeFactory;
|
||||
import com.minres.scviewer.database.tx.ITx;
|
||||
import com.minres.scviewer.database.tx.ITxAttribute;
|
||||
import com.minres.scviewer.database.RelationType;
|
||||
|
||||
import jacob.CborDecoder;
|
||||
import jacob.CborType;
|
||||
@ -53,7 +49,7 @@ import jacob.CborType;
|
||||
public class FtrDbLoader implements IWaveformDbLoader {
|
||||
|
||||
enum FileType { NONE, PLAIN, GZIP, LZ4};
|
||||
|
||||
|
||||
/** The max time. */
|
||||
private Long maxTime = 0L;
|
||||
|
||||
@ -97,9 +93,8 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
/** The pcs. */
|
||||
protected PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||
|
||||
/** The Constant x. */
|
||||
static final byte[] x = "scv_tr_stream".getBytes();
|
||||
|
||||
long time_scale_factor = 1000l;
|
||||
|
||||
/**
|
||||
* Adds the property change listener.
|
||||
*
|
||||
@ -136,7 +131,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
* @param txId the tx id
|
||||
* @return the transaction
|
||||
*/
|
||||
public ITx getTransaction(long txId) {
|
||||
public synchronized ITx getTransaction(long txId) {
|
||||
if (txCache.containsKey(txId))
|
||||
return txCache.get(txId);
|
||||
if(transactions.containsKey(txId)) {
|
||||
@ -190,8 +185,10 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
this.file=file;
|
||||
try(FileInputStream fis = new FileInputStream(file)) {
|
||||
new CborDbParser(this, fis);
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Problem parsing file "+file.getName()+": " , e);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error parsing file "+file.getName(), e);
|
||||
LOG.error("Error parsing file "+file.getName()+ ": ", e);
|
||||
transactions.clear();
|
||||
throw new InputFormatException(e.toString());
|
||||
}
|
||||
@ -203,9 +200,17 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
try(FileInputStream fis = new FileInputStream(file)) {
|
||||
FileChannel fc = fis.getChannel();
|
||||
for (Long offset : fileOffsets) {
|
||||
fc.position(offset);
|
||||
CborDecoder parser = new CborDecoder(fis);
|
||||
ret.add(parser.readByteString());
|
||||
if(offset>=0) {
|
||||
fc.position(offset);
|
||||
CborDecoder parser = new CborDecoder(fis);
|
||||
ret.add(parser.readByteString());
|
||||
} else {
|
||||
fc.position(-offset);
|
||||
CborDecoder parser = new CborDecoder(fis);
|
||||
BlockLZ4CompressorInputStream decomp = new BlockLZ4CompressorInputStream(new ByteArrayInputStream(parser.readByteString()));
|
||||
ret.add(decomp.readAllBytes());
|
||||
decomp.close();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error parsing file "+file.getName(), e);
|
||||
@ -238,34 +243,36 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
assert(sz==3);
|
||||
long name_id = cborDecoder.readInt();
|
||||
long type_id = cborDecoder.readInt();
|
||||
DataType type = DataType.values()[(int)type_id];
|
||||
String attrName = strDict.get((int)name_id);
|
||||
if(!attributeTypes.containsKey(attrName)) {
|
||||
attributeTypes.put(attrName, new TxAttributeType(attrName, DataType.values()[(int)type_id], AssociationType.values()[(int)tag-7]));
|
||||
}
|
||||
TxAttributeType attrType = attributeTypes.get(attrName);
|
||||
switch((int)type_id) {
|
||||
case 0: // BOOLEAN
|
||||
ITxAttribute b = new TxAttribute(attrType, cborDecoder.readInt()>0?"True":"False");
|
||||
TxAttributeType attrType = getOrAddAttributeType(tag, type, attrName);
|
||||
switch(type) {
|
||||
case BOOLEAN:
|
||||
ITxAttribute b = new TxAttribute(attrType, cborDecoder.readBoolean()?"True":"False");
|
||||
ret.add(b);
|
||||
break;
|
||||
case 2: // INTEGER
|
||||
case 3: // UNSIGNED
|
||||
case INTEGER:
|
||||
case UNSIGNED:
|
||||
case POINTER:
|
||||
case TIME:
|
||||
ITxAttribute a = new TxAttribute(attrType, String.valueOf(cborDecoder.readInt()));
|
||||
ret.add(a);
|
||||
break;
|
||||
case 4: // FLOATING_POINT_NUMBER
|
||||
case 7: // FIXED_POINT_INTEGER
|
||||
case 8: // UNSIGNED_FIXED_POINT_INTEGER
|
||||
case FLOATING_POINT_NUMBER:
|
||||
case FIXED_POINT_INTEGER:
|
||||
case UNSIGNED_FIXED_POINT_INTEGER:
|
||||
ITxAttribute v = new TxAttribute(attrType, String.valueOf(cborDecoder.readFloat()));
|
||||
ret.add(v);
|
||||
break;
|
||||
case 1: // ENUMERATION
|
||||
case 5: // BIT_VECTOR
|
||||
case 6: // LOGIC_VECTOR
|
||||
case 12: // STRING
|
||||
case ENUMERATION:
|
||||
case BIT_VECTOR:
|
||||
case LOGIC_VECTOR:
|
||||
case STRING:
|
||||
ITxAttribute s = new TxAttribute(attrType, strDict.get((int)cborDecoder.readInt()));
|
||||
ret.add(s);
|
||||
break;
|
||||
default:
|
||||
LOG.warn("Unsupported data type: "+type_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -276,6 +283,14 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private synchronized TxAttributeType getOrAddAttributeType(long tag, DataType type, String attrName) {
|
||||
if(!attributeTypes.containsKey(attrName)) {
|
||||
attributeTypes.put(attrName, new TxAttributeType(attrName, type, AssociationType.values()[(int)tag-7]));
|
||||
}
|
||||
TxAttributeType attrType = attributeTypes.get(attrName);
|
||||
return attrType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispose.
|
||||
*/
|
||||
@ -318,16 +333,44 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
while(next != null && !break_type.isEqualType(next)) {
|
||||
long tag = readTag();
|
||||
switch((int)tag) {
|
||||
<<<<<<< HEAD
|
||||
case 6: // info
|
||||
=======
|
||||
case 6: { // info
|
||||
>>>>>>> refs/heads/release/2.17.1
|
||||
CborDecoder cbd = new CborDecoder(new ByteArrayInputStream(readByteString()));
|
||||
long sz = cbd.readArrayLength();
|
||||
assert(sz==3);
|
||||
long time_numerator=cbd.readInt();
|
||||
long time_denominator=cbd.readInt();
|
||||
loader.time_scale_factor = 1000000000000000l*time_numerator/time_denominator;
|
||||
long epoch_tag = cbd.readTag();
|
||||
assert(epoch_tag==1);
|
||||
cbd.readInt(); // epoch
|
||||
break;
|
||||
}
|
||||
case 8: { // dictionary uncompressed
|
||||
parseDict(new CborDecoder(new ByteArrayInputStream(readByteString())));
|
||||
break;
|
||||
}
|
||||
case 9: { // dictionary compressed
|
||||
long sz = readArrayLength();
|
||||
assert(sz==2);
|
||||
readInt(); // uncompressed size
|
||||
parseDict(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(readByteString()))));
|
||||
break;
|
||||
}
|
||||
case 10: { // directory uncompressed
|
||||
parseDir(new CborDecoder(new ByteArrayInputStream(readByteString())));
|
||||
break;
|
||||
}
|
||||
case 11: { // directory compressed
|
||||
long sz = readArrayLength();
|
||||
assert(sz==2);
|
||||
readInt(); // uncompressed size
|
||||
parseDir(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(readByteString()))));
|
||||
break;
|
||||
}
|
||||
case 12: { //tx chunk uncompressed
|
||||
long len = readArrayLength();
|
||||
assert(len==2);
|
||||
@ -337,15 +380,36 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
parseTx(txStream, txStream.fileOffsets.size()-1, readByteString());
|
||||
break;
|
||||
}
|
||||
case 13: { //tx chunk compressed
|
||||
long len = readArrayLength();
|
||||
assert(len==3);
|
||||
long stream_id = readInt();
|
||||
readInt(); // uncompressed size
|
||||
TxStream txStream = loader.txStreams.get(stream_id);
|
||||
txStream.fileOffsets.add(0-inputStream.getChannel().position());
|
||||
BlockLZ4CompressorInputStream decomp = new BlockLZ4CompressorInputStream(new ByteArrayInputStream(readByteString()));
|
||||
parseTx(txStream, txStream.fileOffsets.size()-1, decomp.readAllBytes());
|
||||
decomp.close();
|
||||
break;
|
||||
}
|
||||
case 14: { // relations uncompressed
|
||||
parseRel(new CborDecoder(new ByteArrayInputStream(readByteString())));
|
||||
break;
|
||||
}
|
||||
case 15: { // relations uncompressed
|
||||
long sz = readArrayLength();
|
||||
assert(sz==2);
|
||||
readInt(); // uncompressed size
|
||||
parseRel(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(readByteString()))));
|
||||
break;
|
||||
}
|
||||
}
|
||||
next = peekType();
|
||||
}
|
||||
} catch(IOException e) {
|
||||
LOG.error("Error parsing file input stream", e);
|
||||
long pos = 0;
|
||||
try {pos=inputStream.getChannel().position(); } catch (Exception ee) {}
|
||||
LOG.error("Error parsing file input stream at position" + pos, e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,7 +455,8 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
long gen_id = cborDecoder.readInt();
|
||||
long name_id = cborDecoder.readInt();
|
||||
long stream_id = cborDecoder.readInt();
|
||||
add(gen_id, new TxGenerator(loader, gen_id, loader.strDict.get((int)name_id), loader.txStreams.get(stream_id)));
|
||||
if(loader.txStreams.containsKey(stream_id))
|
||||
add(gen_id, new TxGenerator(loader, gen_id, loader.strDict.get((int)name_id), loader.txStreams.get(stream_id)));
|
||||
} else {
|
||||
throw new IOException("Illegal tage ncountered: "+id);
|
||||
}
|
||||
@ -405,16 +470,18 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
while(next != null && !break_type.isEqualType(next)) {
|
||||
long blockOffset = cborDecoder.getPos();
|
||||
long tx_size = cborDecoder.readArrayLength();
|
||||
long txId = 0;
|
||||
long genId = 0;
|
||||
for(long i = 0; i<tx_size; ++i) {
|
||||
long tag = cborDecoder.readTag();
|
||||
switch((int)tag) {
|
||||
case 6: // id/generator/start/end
|
||||
long len = cborDecoder.readArrayLength();
|
||||
assert(len==4);
|
||||
long txId = cborDecoder.readInt();
|
||||
long genId = cborDecoder.readInt();
|
||||
long startTime = cborDecoder.readInt()*1000; //TODO: scale based on info
|
||||
long endTime = cborDecoder.readInt()*1000; //TODO: scale based on info
|
||||
txId = cborDecoder.readInt();
|
||||
genId = cborDecoder.readInt();
|
||||
long startTime = cborDecoder.readInt()*loader.time_scale_factor;
|
||||
long endTime = cborDecoder.readInt()*loader.time_scale_factor;
|
||||
TxGenerator gen = loader.txGenerators.get(genId);
|
||||
FtrTx scvTx = new FtrTx(txId, gen.stream.getId(), genId, startTime, endTime, blockId, blockOffset);
|
||||
loader.maxTime = loader.maxTime > scvTx.endTime ? loader.maxTime : scvTx.endTime;
|
||||
@ -433,8 +500,23 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
default: { // skip over 7:begin attr, 8:record attr, 9:end attr
|
||||
long sz = cborDecoder.readArrayLength();
|
||||
assert(sz==3);
|
||||
for(long j = 0; j<sz; ++j)
|
||||
cborDecoder.readInt();
|
||||
long type_id = cborDecoder.readInt();
|
||||
switch(DataType.values()[(int)type_id]) {
|
||||
case BOOLEAN:
|
||||
cborDecoder.readBoolean();
|
||||
break;
|
||||
case FLOATING_POINT_NUMBER: // FLOATING_POINT_NUMBER
|
||||
case FIXED_POINT_INTEGER: // FIXED_POINT_INTEGER
|
||||
case UNSIGNED_FIXED_POINT_INTEGER: // UNSIGNED_FIXED_POINT_INTEGER
|
||||
cborDecoder.readFloat();
|
||||
break;
|
||||
case NONE: // UNSIGNED_FIXED_POINT_INTEGER
|
||||
LOG.warn("Unsupported data type: "+type_id);
|
||||
break;
|
||||
default:
|
||||
cborDecoder.readInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working.
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
@ -11,18 +10,13 @@
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.ftr;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import org.apache.commons.compress.compressors.lz4.FramedLZ4CompressorInputStream;
|
||||
|
||||
import com.minres.scviewer.database.IWaveformDbLoader;
|
||||
import com.minres.scviewer.database.IWaveformDbLoaderFactory;
|
||||
import com.minres.scviewer.database.ftr.FtrDbLoader.FileType;
|
||||
|
||||
/**
|
||||
* The Class TextDbLoader.
|
||||
|
@ -1,12 +1,12 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH and others.
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
* IT Just working - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.ftr;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working.
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
@ -11,7 +10,6 @@
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.ftr;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -19,8 +17,6 @@ import java.util.List;
|
||||
import com.minres.scviewer.database.InputFormatException;
|
||||
import com.minres.scviewer.database.tx.ITxAttribute;
|
||||
|
||||
import jacob.CborDecoder;
|
||||
|
||||
/**
|
||||
* The Class ScvTx.
|
||||
*/
|
||||
|
@ -17,7 +17,6 @@ import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.InputFormatException;
|
||||
import com.minres.scviewer.database.tx.ITx;
|
||||
import com.minres.scviewer.database.tx.ITxAttribute;
|
||||
import com.minres.scviewer.database.tx.ITxRelation;
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working.
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working.
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
|
@ -1,12 +1,12 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH and others.
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
* IT Just working - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.ftr;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working.
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
|
@ -1,12 +1,12 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH and others.
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
* IT Just working - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.ftr;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2012 IT Just working.
|
||||
* Copyright (c) 2020 MINRES Technologies GmbH
|
||||
* Copyright (c) 2023 MINRES Technologies GmbH
|
||||
* 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
|
||||
|
@ -435,9 +435,10 @@ public class CborDecoder {
|
||||
} else if (breakAllowed && length == BREAK) {
|
||||
return -1;
|
||||
}
|
||||
if (result < 0) {
|
||||
fail("Not well-formed CBOR integer found, invalid length: %d!", result);
|
||||
}
|
||||
// unsigned values larger than long.MAX are shown as negative values
|
||||
// if (result < 0) {
|
||||
// fail("Not well-formed CBOR integer found, invalid length: %d!", result);
|
||||
// }
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -14,8 +14,6 @@ import java.beans.IntrospectionException;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@ -42,8 +40,6 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
|
||||
|
||||
private ScvSimProps scvSimProps;
|
||||
|
||||
private static final byte[] x = "SQLite format 3".getBytes();
|
||||
|
||||
/** The pcs. */
|
||||
protected PropertyChangeSupport pcs = new PropertyChangeSupport(this);
|
||||
|
||||
|
@ -32,7 +32,18 @@ public class TxAttribute implements ITxAttribute{
|
||||
|
||||
@Override
|
||||
public DataType getDataType() {
|
||||
return DataType.values()[scvAttribute.getData_type()];
|
||||
int dt = scvAttribute.getData_type();
|
||||
switch(dt) {
|
||||
case 12:
|
||||
return DataType.STRING;
|
||||
case 10:
|
||||
return DataType.POINTER;
|
||||
default:
|
||||
if(dt<9)
|
||||
return DataType.values()[dt];
|
||||
else
|
||||
return DataType.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -11,7 +11,6 @@
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.text;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
@ -32,22 +31,6 @@ public class TextDbLoaderFactory implements IWaveformDbLoaderFactory {
|
||||
/** The Constant x. */
|
||||
static final byte[] x = "scv_tr_stream".getBytes();
|
||||
|
||||
/**
|
||||
* Checks if f is gzipped.
|
||||
*
|
||||
* @param f the f
|
||||
* @return true, if is gzipped
|
||||
*/
|
||||
private static boolean isGzipped(File f) {
|
||||
try (InputStream is = new FileInputStream(f)) {
|
||||
byte[] signature = new byte[2];
|
||||
int nread = is.read(signature); // read the gzip signature
|
||||
return nread == 2 && signature[0] == (byte) 0x1f && signature[1] == (byte) 0x8b;
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Can load.
|
||||
*
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>4.0.0-SNAPSHOT</version>
|
||||
|
@ -56,8 +56,9 @@ public class RulerPainter implements IPainter {
|
||||
int baselineY=waveCanvas.rulerHeight - 1;
|
||||
int bottom=waveCanvas.rulerHeight - 2;
|
||||
|
||||
long safe_scale_factor = scaleFactor!=0?scaleFactor:1;
|
||||
long startTickTime = startTime+rulerTickMinor-(startTime % rulerTickMinor);
|
||||
long majorTickDist = rulerTickMajor/scaleFactor;
|
||||
long majorTickDist = rulerTickMajor/safe_scale_factor;
|
||||
|
||||
gc.setBackground(waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
|
||||
gc.fillRectangle(new Rectangle(area.x, area.y, area.width, waveCanvas.rulerHeight));
|
||||
@ -75,7 +76,7 @@ public class RulerPainter implements IPainter {
|
||||
boolean drawEvery = majorTickDist>maxTextLength;
|
||||
boolean drawText=true;
|
||||
for (long tickTime = startTickTime; tickTime < endTime; tickTime+= rulerTickMinor) {
|
||||
int x0Pos = (int) (tickTime/scaleFactor) + proj.getTranslation().x;
|
||||
int x0Pos = (int) (tickTime/safe_scale_factor) + proj.getTranslation().x;
|
||||
if ((tickTime % rulerTickMajor) == 0) {
|
||||
if(drawEvery || drawText)
|
||||
gc.drawText(waveCanvas.timeToString(tickTime), x0Pos, area.y+textY);
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -14,46 +14,30 @@ package com.minres.scviewer.database;
|
||||
* The Enum DataType.
|
||||
*/
|
||||
public enum DataType {
|
||||
|
||||
/** The boolean. */
|
||||
BOOLEAN,
|
||||
BOOLEAN, // bool
|
||||
/** The enumeration. */
|
||||
// bool
|
||||
ENUMERATION,
|
||||
ENUMERATION, // enum
|
||||
/** The integer. */
|
||||
// enum
|
||||
INTEGER,
|
||||
INTEGER, // char, short, int, long, long long, sc_int, sc_bigint
|
||||
/** The unsigned. */
|
||||
// char, short, int, long, long long, sc_int, sc_bigint
|
||||
UNSIGNED, // unsigned { char, short, int, long, long long }, sc_uint,
|
||||
UNSIGNED, // unsigned { char, short, int, long, long long }, sc_uint, sc_biguint
|
||||
/** The floating point number. */
|
||||
// sc_biguint
|
||||
FLOATING_POINT_NUMBER,
|
||||
FLOATING_POINT_NUMBER, // float, double
|
||||
/** The bit vector. */
|
||||
// float, double
|
||||
BIT_VECTOR,
|
||||
BIT_VECTOR, // sc_bit, sc_bv
|
||||
/** The logic vector. */
|
||||
// sc_bit, sc_bv
|
||||
LOGIC_VECTOR,
|
||||
LOGIC_VECTOR, // sc_logic, sc_lv
|
||||
/** The fixed point integer. */
|
||||
// sc_logic, sc_lv
|
||||
FIXED_POINT_INTEGER,
|
||||
FIXED_POINT_INTEGER, // sc_fixed
|
||||
/** The unsigned fixed point integer. */
|
||||
// sc_fixed
|
||||
UNSIGNED_FIXED_POINT_INTEGER,
|
||||
/** The record. */
|
||||
// sc_ufixed
|
||||
RECORD,
|
||||
UNSIGNED_FIXED_POINT_INTEGER, // sc_ufixed
|
||||
/** The pointer. */
|
||||
// struct/class
|
||||
POINTER,
|
||||
/** The array. */
|
||||
// T*
|
||||
ARRAY,
|
||||
POINTER, // T*
|
||||
/** The string. */
|
||||
// string, std::string
|
||||
STRING,
|
||||
STRING, // string, std::string
|
||||
/** The time. */
|
||||
// sc_time
|
||||
TIME
|
||||
TIME, // sc_time
|
||||
/** The void type. */
|
||||
NONE
|
||||
}
|
||||
|
@ -20,8 +20,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: SCViewer Help
|
||||
Bundle-SymbolicName: com.minres.scviewer.e4.application.help;singleton:=true
|
||||
Bundle-Version: 2.17.0
|
||||
Bundle-Version: 2.17.3
|
||||
Bundle-Vendor: MINRES Technologies GmbH
|
||||
Automatic-Module-Name: com.minres.scviewer.e4.application.help
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
||||
Bundle-Version: 2.17.0
|
||||
Bundle-Version: 2.17.3
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
@ -21,7 +21,7 @@
|
||||
class="com.minres.scviewer.ui.TxEditorPart"
|
||||
contributorClass="com.minres.scviewer.ui.TxEditorActionBarContributor"
|
||||
extensions="txdb"
|
||||
filenames="*.txdb,*.txlog,*.vcd"
|
||||
filenames="*.txdb,*.txlog,*.vcd,*.ftr"
|
||||
icon="res/images/scviewer.png"
|
||||
id="com.minres.scviewer.ui.TxEditorPart"
|
||||
name="Wave Viewer">
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
4
pom.xml
4
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>releng/com.minres.scviewer.target</module>
|
||||
@ -70,7 +70,7 @@
|
||||
<artifact>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.target</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
</artifact>
|
||||
</target>
|
||||
<executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.minimal-15</executionEnvironment>
|
||||
|
@ -6,11 +6,11 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<packaging>eclipse-repository</packaging>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<build>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?pde version="3.5"?>
|
||||
|
||||
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.17.0" useFeatures="true" includeLaunchers="true" autoIncludeRequirements="true">
|
||||
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.17.3" useFeatures="true" includeLaunchers="true">
|
||||
|
||||
<configIni use="default">
|
||||
</configIni>
|
||||
@ -67,8 +67,8 @@
|
||||
</features>
|
||||
|
||||
<configurations>
|
||||
<plugin id="com.minres.scviewer.database.text" autoStart="true" startLevel="2" />
|
||||
<plugin id="com.minres.scviewer.database.ftr" autoStart="true" startLevel="2" />
|
||||
<plugin id="com.minres.scviewer.database.text" autoStart="true" startLevel="2" />
|
||||
<plugin id="com.minres.scviewer.database.vcd" autoStart="true" startLevel="2" />
|
||||
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="1" />
|
||||
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
|
||||
@ -79,7 +79,7 @@
|
||||
</configurations>
|
||||
|
||||
<repositories>
|
||||
<repository location="http://https://minres.github.io/SCViewer/repository" enabled="true" />
|
||||
<repository location="https://minres.github.io/SCViewer/repository" enabled="true" />
|
||||
</repositories>
|
||||
|
||||
<preferencesInfo>
|
||||
|
@ -40,13 +40,13 @@
|
||||
<unit id="org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.feature.group" version="0.0.0"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<repository location="https://download.eclipse.org/tools/orbit/downloads/2021-12"/>
|
||||
<unit id="org.apache.commons.compress" version="1.21.0.v20211103-2100"/>
|
||||
<unit id="org.apache.commons.compress.source" version="1.21.0.v20211103-2100"/>
|
||||
<unit id="ch.qos.logback.slf4j" version="1.0.7.v201505121915"/>
|
||||
<unit id="ch.qos.logback.slf4j.source" version="1.0.7.v201505121915"/>
|
||||
<unit id="org.slf4j.api" version="1.7.2.v20121108-1250"/>
|
||||
<unit id="org.slf4j.api.source" version="1.7.2.v20121108-1250"/>
|
||||
<repository location="https://download.eclipse.org/tools/orbit/downloads/2022-12"/>
|
||||
<unit id="org.apache.commons.compress" version="0.0.0"/>
|
||||
<unit id="org.apache.commons.compress.source" version="0.0.0"/>
|
||||
<unit id="ch.qos.logback.slf4j" version="0.0.0"/>
|
||||
<unit id="ch.qos.logback.slf4j.source" version="0.0.0"/>
|
||||
<unit id="org.slf4j.api" version="0.0.0"/>
|
||||
<unit id="org.slf4j.api.source" version="0.0.0"/>
|
||||
</location>
|
||||
</locations>
|
||||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-15"/>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<build>
|
||||
|
@ -9,8 +9,7 @@ Require-Bundle: com.minres.scviewer.database,
|
||||
com.minres.scviewer.database.sqlite;bundle-version="1.0.0",
|
||||
com.minres.scviewer.database.text;bundle-version="1.0.0",
|
||||
com.minres.scviewer.database.vcd;bundle-version="1.0.0",
|
||||
org.junit,
|
||||
org.junit.jupiter.api
|
||||
org.junit
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Service-Component: OSGI-INF/component.xml
|
||||
Automatic-Module-Name: com.minres.scviewer.database.test
|
||||
|
Binary file not shown.
BIN
tests/com.minres.scviewer.database.test/inputs/my_db_c.ftr
Normal file
BIN
tests/com.minres.scviewer.database.test/inputs/my_db_c.ftr
Normal file
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.17.0</version>
|
||||
<version>2.17.3</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
@ -15,11 +15,7 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@ -148,4 +144,38 @@ public class DatabaseServicesTest {
|
||||
assertEquals(3, attr.size());
|
||||
});
|
||||
}
|
||||
@Test
|
||||
public void testCFtr() throws Exception {
|
||||
File f = new File("inputs/my_db_c.ftr").getAbsoluteFile();
|
||||
assertTrue(f.exists());
|
||||
waveformDb.load(f);
|
||||
assertNotNull(waveformDb);
|
||||
List<IWaveform> waveforms = waveformDb.getAllWaves();
|
||||
assertEquals(8, waveforms.size());
|
||||
assertEquals(1, waveformDb.getChildNodes().size());
|
||||
for(IWaveform w:waveforms) {
|
||||
if(w.getId()==1) {
|
||||
assertEquals(2, w.getRowCount());
|
||||
} else if(w.getId()==2l) {
|
||||
assertEquals(1, w.getRowCount());
|
||||
} else if(w.getId()==3l) {
|
||||
assertEquals(1, w.getRowCount());
|
||||
}
|
||||
}
|
||||
//waveforms.stream().filter(s -> s.getId()==1).collect(Collectors.toList());
|
||||
waveforms.stream().filter(s -> s.getId()==1).forEach(s -> {
|
||||
assertEquals(27, s.getEvents().size());
|
||||
});
|
||||
waveforms.stream().filter(s -> s.getId()==1).map(s -> s.getEventsAtTime(0)).forEach(el -> {
|
||||
assertEquals(1, el.length);
|
||||
IEvent evt = el[0];
|
||||
assertTrue(evt instanceof ITxEvent);
|
||||
ITx tx = ((ITxEvent)evt).getTransaction();
|
||||
assertNotNull(tx);
|
||||
assertEquals(0, tx.getBeginTime());
|
||||
assertEquals(280000000, tx.getEndTime());
|
||||
List<ITxAttribute> attr = tx.getAttributes();
|
||||
assertEquals(3, attr.size());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user