Merge branch 'release/2.17.1'

This commit is contained in:
Eyck Jentzsch 2023-02-22 07:30:06 +01:00
commit 8aca26e499
27 changed files with 112 additions and 35 deletions

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>3.0.0-SNAPSHOT</version> <version>3.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -17,15 +17,13 @@ import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; 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.eclipse.collections.impl.map.mutable.UnifiedMap;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -42,7 +40,6 @@ import com.minres.scviewer.database.RelationType;
import com.minres.scviewer.database.RelationTypeFactory; import com.minres.scviewer.database.RelationTypeFactory;
import com.minres.scviewer.database.tx.ITx; import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxAttribute; import com.minres.scviewer.database.tx.ITxAttribute;
import com.minres.scviewer.database.RelationType;
import jacob.CborDecoder; import jacob.CborDecoder;
import jacob.CborType; import jacob.CborType;
@ -202,9 +199,17 @@ public class FtrDbLoader implements IWaveformDbLoader {
try(FileInputStream fis = new FileInputStream(file)) { try(FileInputStream fis = new FileInputStream(file)) {
FileChannel fc = fis.getChannel(); FileChannel fc = fis.getChannel();
for (Long offset : fileOffsets) { for (Long offset : fileOffsets) {
if(offset>=0) {
fc.position(offset); fc.position(offset);
CborDecoder parser = new CborDecoder(fis); CborDecoder parser = new CborDecoder(fis);
ret.add(parser.readByteString()); 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) { } catch (Exception e) {
LOG.error("Error parsing file "+file.getName(), e); LOG.error("Error parsing file "+file.getName(), e);
@ -317,7 +322,11 @@ public class FtrDbLoader implements IWaveformDbLoader {
while(next != null && !break_type.isEqualType(next)) { while(next != null && !break_type.isEqualType(next)) {
long tag = readTag(); long tag = readTag();
switch((int)tag) { switch((int)tag) {
<<<<<<< HEAD
case 6: // info case 6: // info
=======
case 6: { // info
>>>>>>> refs/heads/release/2.17.1
CborDecoder cbd = new CborDecoder(new ByteArrayInputStream(readByteString())); CborDecoder cbd = new CborDecoder(new ByteArrayInputStream(readByteString()));
long sz = cbd.readArrayLength(); long sz = cbd.readArrayLength();
assert(sz==3); assert(sz==3);
@ -328,14 +337,29 @@ public class FtrDbLoader implements IWaveformDbLoader {
assert(epoch_tag==1); assert(epoch_tag==1);
cbd.readInt(); // epoch cbd.readInt(); // epoch
break; break;
}
case 8: { // dictionary uncompressed case 8: { // dictionary uncompressed
parseDict(new CborDecoder(new ByteArrayInputStream(readByteString()))); parseDict(new CborDecoder(new ByteArrayInputStream(readByteString())));
break; 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 case 10: { // directory uncompressed
parseDir(new CborDecoder(new ByteArrayInputStream(readByteString()))); parseDir(new CborDecoder(new ByteArrayInputStream(readByteString())));
break; 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 case 12: { //tx chunk uncompressed
long len = readArrayLength(); long len = readArrayLength();
assert(len==2); assert(len==2);
@ -345,10 +369,29 @@ public class FtrDbLoader implements IWaveformDbLoader {
parseTx(txStream, txStream.fileOffsets.size()-1, readByteString()); parseTx(txStream, txStream.fileOffsets.size()-1, readByteString());
break; 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 case 14: { // relations uncompressed
parseRel(new CborDecoder(new ByteArrayInputStream(readByteString()))); parseRel(new CborDecoder(new ByteArrayInputStream(readByteString())));
break; 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(); next = peekType();
} }

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<version>4.0.0-SNAPSHOT</version> <version>4.0.0-SNAPSHOT</version>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: SCViewer Help Bundle-Name: SCViewer Help
Bundle-SymbolicName: com.minres.scviewer.e4.application.help;singleton:=true Bundle-SymbolicName: com.minres.scviewer.e4.application.help;singleton:=true
Bundle-Version: 2.17.0 Bundle-Version: 2.17.1
Bundle-Vendor: MINRES Technologies GmbH Bundle-Vendor: MINRES Technologies GmbH
Automatic-Module-Name: com.minres.scviewer.e4.application.help Automatic-Module-Name: com.minres.scviewer.e4.application.help
Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-RequiredExecutionEnvironment: JavaSE-11

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
Bundle-Version: 2.17.0 Bundle-Version: 2.17.1
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Require-Bundle: javax.inject;bundle-version="1.0.0", Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.11.1", org.eclipse.core.runtime;bundle-version="3.11.1",

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-plugin</packaging> <packaging>eclipse-plugin</packaging>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>releng/com.minres.scviewer.target</module> <module>releng/com.minres.scviewer.target</module>
@ -70,7 +70,7 @@
<artifact> <artifact>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.target</artifactId> <artifactId>com.minres.scviewer.target</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
</artifact> </artifact>
</target> </target>
<executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.minimal-15</executionEnvironment> <executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.minimal-15</executionEnvironment>

View File

@ -6,11 +6,11 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<artifactId>com.minres.scviewer.e4.product</artifactId> <artifactId>com.minres.scviewer.e4.product</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<packaging>eclipse-repository</packaging> <packaging>eclipse-repository</packaging>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<build> <build>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?> <?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.1" useFeatures="true" includeLaunchers="true">
<configIni use="default"> <configIni use="default">
</configIni> </configIni>
@ -67,8 +67,8 @@
</features> </features>
<configurations> <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.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="com.minres.scviewer.database.vcd" autoStart="true" startLevel="2" />
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="1" /> <plugin id="org.apache.felix.scr" autoStart="true" startLevel="1" />
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" /> <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
@ -79,7 +79,7 @@
</configurations> </configurations>
<repositories> <repositories>
<repository location="http://https://minres.github.io/SCViewer/repository" enabled="true" /> <repository location="https://minres.github.io/SCViewer/repository" enabled="true" />
</repositories> </repositories>
<preferencesInfo> <preferencesInfo>

View File

@ -12,7 +12,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>

View File

@ -7,7 +7,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<build> <build>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.minres.scviewer</groupId> <groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId> <artifactId>com.minres.scviewer.parent</artifactId>
<version>2.17.0</version> <version>2.17.1</version>
<relativePath>../..</relativePath> <relativePath>../..</relativePath>
</parent> </parent>
<packaging>eclipse-test-plugin</packaging> <packaging>eclipse-test-plugin</packaging>

View File

@ -148,4 +148,38 @@ public class DatabaseServicesTest {
assertEquals(3, attr.size()); 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());
});
}
} }