diff --git a/doc/com.minres.scviewer.doc/pom.xml b/doc/com.minres.scviewer.doc/pom.xml
index 23cab87..ac99b20 100644
--- a/doc/com.minres.scviewer.doc/pom.xml
+++ b/doc/com.minres.scviewer.doc/pom.xml
@@ -7,7 +7,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
diff --git a/features/com.minres.scviewer.database.feature/pom.xml b/features/com.minres.scviewer.database.feature/pom.xml
index b5553f2..f445d67 100644
--- a/features/com.minres.scviewer.database.feature/pom.xml
+++ b/features/com.minres.scviewer.database.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
3.0.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.e4.feature/pom.xml b/features/com.minres.scviewer.e4.feature/pom.xml
index 680e93f..94a5118 100644
--- a/features/com.minres.scviewer.e4.feature/pom.xml
+++ b/features/com.minres.scviewer.e4.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
1.1.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.e4.help.feature/pom.xml b/features/com.minres.scviewer.e4.help.feature/pom.xml
index b011cb8..2f51a4c 100644
--- a/features/com.minres.scviewer.e4.help.feature/pom.xml
+++ b/features/com.minres.scviewer.e4.help.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
1.0.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.e4.platform.feature/pom.xml b/features/com.minres.scviewer.e4.platform.feature/pom.xml
index e54aa8e..4507cad 100644
--- a/features/com.minres.scviewer.e4.platform.feature/pom.xml
+++ b/features/com.minres.scviewer.e4.platform.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
1.0.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.feature/pom.xml b/features/com.minres.scviewer.feature/pom.xml
index c4ef4d3..991d0e5 100644
--- a/features/com.minres.scviewer.feature/pom.xml
+++ b/features/com.minres.scviewer.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
1.1.0-SNAPSHOT
diff --git a/features/com.minres.scviewer.ui.feature/pom.xml b/features/com.minres.scviewer.ui.feature/pom.xml
index 6ff0b7a..d62fad2 100644
--- a/features/com.minres.scviewer.ui.feature/pom.xml
+++ b/features/com.minres.scviewer.ui.feature/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
1.1.0-SNAPSHOT
diff --git a/plugins/com.minres.scviewer.database.sqlite/pom.xml b/plugins/com.minres.scviewer.database.sqlite/pom.xml
index 707af5c..6acc76f 100644
--- a/plugins/com.minres.scviewer.database.sqlite/pom.xml
+++ b/plugins/com.minres.scviewer.database.sqlite/pom.xml
@@ -4,7 +4,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java
index cf027af..189229e 100644
--- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java
+++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java
@@ -78,24 +78,24 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
return streams;
}
- @Override
- public boolean canLoad(File inputFile) {
- if (!inputFile.isDirectory() && inputFile.exists()) {
- try(InputStream stream = new FileInputStream(inputFile)){
- byte[] buffer = new byte[x.length];
- int readCnt = stream.read(buffer, 0, x.length);
- if (readCnt == x.length) {
- for (int i = 0; i < x.length; i++)
- if (buffer[i] != x[i])
- return false;
- }
- return true;
- } catch (Exception e) {
- return false;
- }
- }
- return false;
- }
+// @Override
+// public boolean canLoad(File inputFile) {
+// if (!inputFile.isDirectory() && inputFile.exists()) {
+// try(InputStream stream = new FileInputStream(inputFile)){
+// byte[] buffer = new byte[x.length];
+// int readCnt = stream.read(buffer, 0, x.length);
+// if (readCnt == x.length) {
+// for (int i = 0; i < x.length; i++)
+// if (buffer[i] != x[i])
+// return false;
+// }
+// return true;
+// } catch (Exception e) {
+// return false;
+// }
+// }
+// return false;
+// }
@Override
public void load(IWaveformDb db, File file) throws InputFormatException {
diff --git a/plugins/com.minres.scviewer.database.text/pom.xml b/plugins/com.minres.scviewer.database.text/pom.xml
index 06fcec1..ee4b549 100644
--- a/plugins/com.minres.scviewer.database.text/pom.xml
+++ b/plugins/com.minres.scviewer.database.text/pom.xml
@@ -6,7 +6,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java
index 95e616e..63796ec 100644
--- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java
+++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java
@@ -59,14 +59,14 @@ import com.minres.scviewer.database.tx.ITx;
public class TextDbLoader implements IWaveformDbLoader {
enum FileType { NONE, PLAIN, GZIP, LZ4};
-
+
/** the file size limit of a zipped txlog where the loader starts to use a file mapped database */
private static final long MEMMAP_LIMIT=256l*1024l*1024l;
-
+
private static final long MAPDB_INITIAL_ALLOC = 512l*1024l*1024l;
-
+
private static final long MAPDB_INCREMENTAL_ALLOC = 128l*1024l*1024l;
-
+
/** The max time. */
private Long maxTime = 0L;
@@ -185,46 +185,25 @@ public class TextDbLoader implements IWaveformDbLoader {
return relationTypes.values();
}
- /**
- * Can load.
- *
- * @param inputFile the input file
- * @return true, if successful
- */
- @Override
- public boolean canLoad(File inputFile) {
- if (!inputFile.isDirectory() && inputFile.exists()) {
- FileType fType = getFileType(inputFile);
- try(InputStream stream = fType==FileType.GZIP ? new GZIPInputStream(new FileInputStream(inputFile)) :
- fType==FileType.LZ4? new FramedLZ4CompressorInputStream(new FileInputStream(inputFile)) : new FileInputStream(inputFile)){
- byte[] buffer = new byte[x.length];
- int readCnt = stream.read(buffer, 0, x.length);
- if (readCnt == x.length) {
- for (int i = 0; i < x.length; i++)
- if (buffer[i] != x[i])
- return false;
- }
- return true;
- } catch (Exception e) {
- return false;
- }
- }
- return false;
- }
-
/**
* Checks if is gzipped.
*
* @param f the f
* @return true, if is gzipped
*/
- private static FileType getFileType(File f) {
+ static FileType getFileType(File f) {
try (InputStream is = new FileInputStream(f)) {
byte[] signature = new byte[4];
int nread = is.read(signature); // read the gzip signature
- if(nread > 2 && signature[0] == (byte) 0x1f && signature[1] == (byte) 0x8b)
+ if(nread >= 2 &&
+ signature[0] == (byte) 0x1f &&
+ signature[1] == (byte) 0x8b)
return FileType.GZIP;
- else if(nread>4 && signature[0] == (byte) 0x04 && signature[1] == (byte) 0x22 && signature[2] == (byte) 0x4d && signature[3] == (byte) 0x18)
+ else if(nread>=4 &&
+ signature[0] == (byte) 0x04 &&
+ signature[1] == (byte) 0x22 &&
+ signature[2] == (byte) 0x4d &&
+ signature[3] == (byte) 0x18)
return FileType.LZ4;
else
return FileType.PLAIN;
@@ -264,14 +243,15 @@ public class TextDbLoader implements IWaveformDbLoader {
}
TextDbParser parser = new TextDbParser(this);
try {
-
+
parser.txSink = mapDb.hashMap("transactions", Serializer.LONG, Serializer.JAVA).create();
InputStream is = new BufferedInputStream(new FileInputStream(file));
parser.parseInput(fType==FileType.GZIP ? new GZIPInputStream(is) : fType==FileType.LZ4? new FramedLZ4CompressorInputStream(is) : is);
- transactions = parser.txSink;
} catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
} catch (Exception e) {
throw new InputFormatException(e.toString());
+ } finally {
+ transactions = parser.txSink;
}
txStreams.values().parallelStream().forEach(TxStream::calculateConcurrency);
}
@@ -351,20 +331,22 @@ public class TextDbLoader implements IWaveformDbLoader {
* @throws IOException Signals that an I/O exception has occurred.
* @throws InputFormatException Signals that the input format is wrong
*/
- void parseInput(InputStream inputStream) throws IOException, InputFormatException {
- reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
- String curLine = reader.readLine();
- String nextLine = null;
- while ((nextLine = reader.readLine()) != null && curLine != null) {
- curLine = parseLine(curLine, nextLine, false);
- }
- if (curLine != null)
- parseLine(curLine, nextLine, true);
- for(Entry e: transactionById.entrySet()) {
- ScvTx scvTx = e.getValue();
- scvTx.endTime=loader.maxTime;
- txSink.put(e.getKey(), scvTx);
- }
+ void parseInput(InputStream inputStream) throws InputFormatException {
+ try {
+ reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
+ String curLine = reader.readLine();
+ String nextLine = null;
+ while ((nextLine = reader.readLine()) != null && curLine != null) {
+ curLine = parseLine(curLine, nextLine, false);
+ }
+ if (curLine != null)
+ parseLine(curLine, nextLine, true);
+ for(Entry e: transactionById.entrySet()) {
+ ScvTx scvTx = e.getValue();
+ scvTx.endTime=loader.maxTime;
+ txSink.put(e.getKey(), scvTx);
+ }
+ } catch(IOException e) {}
}
/**
@@ -397,80 +379,86 @@ public class TextDbLoader implements IWaveformDbLoader {
* @throws InputFormatException Signals that the input format is wrong
*/
private String parseLine(String curLine, String nextLine, boolean last) throws IOException, InputFormatException {
- String[] tokens = curLine.split("\\s+");
- if ("tx_record_attribute".equals(tokens[0]) && tokens.length>4) {
- Long id = Long.parseLong(tokens[1]);
- String name = tokens[2].substring(1, tokens[2].length()-1);
- DataType type = DataType.valueOf(tokens[3]);
- String remaining = tokens.length > 5 ? String.join(" ", Arrays.copyOfRange(tokens, 5, tokens.length)) : "";
- TxAttributeType attrType = getAttrType(name, type, AssociationType.RECORD);
- transactionById.get(id).attributes.add(new TxAttribute(attrType, getAttrString(attrType, remaining)));
- } else if ("tx_begin".equals(tokens[0]) && tokens.length>4) {
- Long id = Long.parseLong(tokens[1]);
- Long genId = Long.parseLong(tokens[2]);
- TxGenerator gen = loader.txGenerators.get(genId);
- ScvTx scvTx = new ScvTx(id, gen.stream.getId(), genId,
- Long.parseLong(tokens[3]) * stringToScale(tokens[4]));
- loader.maxTime = loader.maxTime > scvTx.beginTime ? loader.maxTime : scvTx.beginTime;
- if (nextLine != null && nextLine.charAt(0) == 'a') {
- int idx = 0;
- while (nextLine != null && nextLine.charAt(0) == 'a') {
- String[] attrTokens = nextLine.split("\\s+");
- TxAttributeType attrType = gen.beginAttrs.get(idx);
- TxAttribute attr = new TxAttribute(attrType, getAttrString(attrType, attrTokens[1]));
- scvTx.attributes.add(attr);
- idx++;
- nextLine = reader.readLine();
+ if(curLine.charAt(0)=='t') {
+ String[] tokens = curLine.split(" ");
+ //if ("tx_record_attribute".equals(tokens[0]) && tokens.length>4) {
+ if (curLine.charAt(5)=='c' && tokens.length>4) {
+ Long id = Long.parseLong(tokens[1]);
+ String name = tokens[2].substring(1, tokens[2].length()-1);
+ DataType type = DataType.valueOf(tokens[3]);
+ String remaining = tokens.length > 5 ? String.join(" ", Arrays.copyOfRange(tokens, 5, tokens.length)) : "";
+ TxAttributeType attrType = getAttrType(name, type, AssociationType.RECORD);
+ transactionById.get(id).attributes.add(new TxAttribute(attrType, getAttrString(attrType, remaining)));
+ //} else if ("tx_begin".equals(tokens[0]) && tokens.length>4) {
+ } else if (curLine.charAt(3)=='b' && tokens.length>4) {
+ Long id = Long.parseLong(tokens[1]);
+ Long genId = Long.parseLong(tokens[2]);
+ TxGenerator gen = loader.txGenerators.get(genId);
+ ScvTx scvTx = new ScvTx(id, gen.stream.getId(), genId,
+ Long.parseLong(tokens[3]) * stringToScale(tokens[4]));
+ loader.maxTime = loader.maxTime > scvTx.beginTime ? loader.maxTime : scvTx.beginTime;
+ if (nextLine != null && nextLine.charAt(0) == 'a') {
+ int idx = 0;
+ while (nextLine != null && nextLine.charAt(0) == 'a') {
+ String[] attrTokens = nextLine.split("\\s+");
+ TxAttributeType attrType = gen.beginAttrs.get(idx);
+ TxAttribute attr = new TxAttribute(attrType, getAttrString(attrType, attrTokens[1]));
+ scvTx.attributes.add(attr);
+ idx++;
+ nextLine = reader.readLine();
+ }
}
- }
- transactionById.put(id, scvTx);
- } else if ("tx_end".equals(tokens[0]) && tokens.length>4) {
- Long id = Long.parseLong(tokens[1]);
- ScvTx scvTx = transactionById.get(id);
- assert Long.parseLong(tokens[2]) == scvTx.generatorId;
- scvTx.endTime = Long.parseLong(tokens[3]) * stringToScale(tokens[4]);
- loader.maxTime = loader.maxTime > scvTx.endTime ? loader.maxTime : scvTx.endTime;
- TxGenerator gen = loader.txGenerators.get(scvTx.generatorId);
- TxStream stream = loader.txStreams.get(gen.stream.getId());
- if (scvTx.beginTime == scvTx.endTime) {
- stream.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
- gen.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
- } else {
- stream.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
- gen.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
- stream.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
- gen.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
- }
- if (nextLine != null && nextLine.charAt(0) == 'a') {
- int idx = 0;
- while (nextLine != null && nextLine.charAt(0) == 'a') {
- String[] attrTokens = nextLine.split("\\s+");
- TxAttributeType attrType = gen.endAttrs.get(idx);
- TxAttribute attr = new TxAttribute(attrType, getAttrString(attrType, attrTokens[1]));
- scvTx.attributes.add(attr);
- idx++;
- nextLine = reader.readLine();
+ transactionById.put(id, scvTx);
+ //} else if ("tx_end".equals(tokens[0]) && tokens.length>4) {
+ } else if (curLine.charAt(3)=='e' && tokens.length>4) {
+ Long id = Long.parseLong(tokens[1]);
+ ScvTx scvTx = transactionById.get(id);
+ assert Long.parseLong(tokens[2]) == scvTx.generatorId;
+ scvTx.endTime = Long.parseLong(tokens[3]) * stringToScale(tokens[4]);
+ loader.maxTime = loader.maxTime > scvTx.endTime ? loader.maxTime : scvTx.endTime;
+ TxGenerator gen = loader.txGenerators.get(scvTx.generatorId);
+ TxStream stream = loader.txStreams.get(gen.stream.getId());
+ if (scvTx.beginTime == scvTx.endTime) {
+ stream.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
+ gen.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
+ } else {
+ stream.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
+ gen.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
+ stream.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
+ gen.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
}
+ if (nextLine != null && nextLine.charAt(0) == 'a') {
+ int idx = 0;
+ while (nextLine != null && nextLine.charAt(0) == 'a') {
+ String[] attrTokens = nextLine.split("\\s+");
+ TxAttributeType attrType = gen.endAttrs.get(idx);
+ TxAttribute attr = new TxAttribute(attrType, getAttrString(attrType, attrTokens[1]));
+ scvTx.attributes.add(attr);
+ idx++;
+ nextLine = reader.readLine();
+ }
+ }
+ txSink.put(scvTx.getId(), scvTx);
+ transactionById.remove(id);
+ //} else if ("tx_relation".equals(tokens[0]) && tokens.length>3) {
+ } else if (curLine.charAt(5)=='l' && tokens.length>3) {
+ Long tr2 = Long.parseLong(tokens[2]);
+ Long tr1 = Long.parseLong(tokens[3]);
+ String relType = tokens[1].substring(1, tokens[1].length() - 1);
+ if (!loader.relationTypes.containsKey(relType))
+ loader.relationTypes.put(relType, RelationTypeFactory.create(relType));
+ ScvRelation rel = new ScvRelation(loader.relationTypes.get(relType), tr1, tr2);
+ loader.relationsOut.put(tr1, rel);
+ loader.relationsIn.put(tr2, rel);
}
- txSink.put(scvTx.getId(), scvTx);
- transactionById.remove(id);
- } else if ("tx_relation".equals(tokens[0]) && tokens.length>3) {
- Long tr2 = Long.parseLong(tokens[2]);
- Long tr1 = Long.parseLong(tokens[3]);
- String relType = tokens[1].substring(1, tokens[1].length() - 1);
- if (!loader.relationTypes.containsKey(relType))
- loader.relationTypes.put(relType, RelationTypeFactory.create(relType));
- ScvRelation rel = new ScvRelation(loader.relationTypes.get(relType), tr1, tr2);
- loader.relationsOut.put(tr1, rel);
- loader.relationsIn.put(tr2, rel);
- } else if ("scv_tr_stream".equals(tokens[0])) {
+ } else if (curLine.length()>13 && "scv_tr_stream".equals(curLine.substring(0, 13))) {
Matcher matcher = scv_tr_stream.matcher(curLine);
if (matcher.matches()) {
Long id = Long.parseLong(matcher.group(1));
TxStream stream = new TxStream(loader, id, matcher.group(2), matcher.group(3));
add(id, stream);
}
- } else if ("scv_tr_generator".equals(tokens[0])) {
+ } else if (curLine.length()>16 && "scv_tr_generator".equals(curLine.substring(0, 16))) {
Matcher matcher = scv_tr_generator.matcher(curLine);
if ((matcher.matches())) {
Long id = Long.parseLong(matcher.group(1));
@@ -478,21 +466,21 @@ public class TextDbLoader implements IWaveformDbLoader {
generator = new TxGenerator(loader, id, matcher.group(2), stream);
add(id, generator);
}
- } else if ("begin_attribute".equals(tokens[0])) {
+ } else if (curLine.length()>15 && "begin_attribute".equals(curLine.substring(0, 15))) {
Matcher matcher = begin_attribute.matcher(curLine);
if ((matcher.matches())) {
TxAttributeType attrType = getAttrType(matcher.group(2), DataType.valueOf(matcher.group(3)),
AssociationType.BEGIN);
generator.beginAttrs.add(attrType);
}
- } else if ("end_attribute".equals(tokens[0])) {
+ } else if (curLine.length()>13 && "end_attribute".equals(curLine.substring(0, 13))) {
Matcher matcher = end_attribute.matcher(curLine);
if ((matcher.matches())) {
TxAttributeType attrType = getAttrType(matcher.group(2), DataType.valueOf(matcher.group(3)),
AssociationType.END);
generator.endAttrs.add(attrType);
}
- } else if (")".equals(tokens[0])) {
+ } else if (curLine.charAt(0) == ')') {
generator = null;
} else if(!last)
throw new InputFormatException("Don't know what to do with: '" + curLine + "'");
diff --git a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java
index 2324ff4..dc70190 100644
--- a/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java
+++ b/plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoaderFactory.java
@@ -11,14 +11,18 @@
*******************************************************************************/
package com.minres.scviewer.database.text;
+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.text.TextDbLoader.FileType;
/**
* The Class TextDbLoader.
@@ -52,21 +56,17 @@ public class TextDbLoaderFactory implements IWaveformDbLoaderFactory {
*/
@Override
public boolean canLoad(File inputFile) {
- if (!inputFile.isDirectory() && inputFile.exists()) {
- boolean gzipped = isGzipped(inputFile);
- try(InputStream stream = gzipped ? new GZIPInputStream(new FileInputStream(inputFile)) : new FileInputStream(inputFile)){
- byte[] buffer = new byte[x.length];
- int readCnt = stream.read(buffer, 0, x.length);
- if (readCnt == x.length) {
- for (int i = 0; i < x.length; i++)
- if (buffer[i] != x[i])
- return false;
- }
- return true;
- } catch (Exception e) {
- return false;
+ FileType fType = TextDbLoader.getFileType(inputFile);
+ try (InputStream is = new FileInputStream(inputFile)) {
+ InputStream plainIs = fType==FileType.GZIP ? new GZIPInputStream(is) : fType==FileType.LZ4? new FramedLZ4CompressorInputStream(is) : is;
+ byte[] buffer = new byte[x.length];
+ int readCnt = plainIs.read(buffer, 0, x.length);
+ if (readCnt == x.length) {
+ for (int i = 0; i < x.length; i++)
+ if (buffer[i] != x[i]) return false;
}
- }
+ return true;
+ } catch (IOException e) {}
return false;
}
diff --git a/plugins/com.minres.scviewer.database.ui.swt/pom.xml b/plugins/com.minres.scviewer.database.ui.swt/pom.xml
index f38087c..23ddfa4 100644
--- a/plugins/com.minres.scviewer.database.ui.swt/pom.xml
+++ b/plugins/com.minres.scviewer.database.ui.swt/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
4.0.0-SNAPSHOT
diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/SignalPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/SignalPainter.java
index 43a9f2a..280c1d3 100644
--- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/SignalPainter.java
+++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/SignalPainter.java
@@ -356,7 +356,7 @@ public class SignalPainter extends TrackPainter {
public RealStencil(IEventList entries, Object left, boolean continous) {
this.continous=continous;
Collection values = entries.entrySet();
- minVal=(Double) left;
+ minVal=((DoubleVal) left).value;
range=2.0;
if(!values.isEmpty()) {
double maxVal=minVal;
diff --git a/plugins/com.minres.scviewer.database.vcd/pom.xml b/plugins/com.minres.scviewer.database.vcd/pom.xml
index 0aa62e5..129a6c0 100644
--- a/plugins/com.minres.scviewer.database.vcd/pom.xml
+++ b/plugins/com.minres.scviewer.database.vcd/pom.xml
@@ -5,7 +5,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java b/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java
index 57f19f1..8476df0 100644
--- a/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java
+++ b/plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java
@@ -66,34 +66,6 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder {
}
- /**
- * Can load.
- *
- * @param inputFile the input file
- * @return true, if successful
- */
- @Override
- public boolean canLoad(File inputFile) {
- if(!inputFile.isDirectory() || inputFile.exists()) {
- String name = inputFile.getName();
- if(!(name.endsWith(".vcd") ||
- name.endsWith(".vcdz") ||
- name.endsWith(".vcdgz") ||
- name.endsWith(".vcd.gz")) )
- return false;
- boolean gzipped = isGzipped(inputFile);
- try(InputStream stream = gzipped ? new GZIPInputStream(new FileInputStream(inputFile)) : new FileInputStream(inputFile)){
- byte[] buffer = new byte[8];
- if (stream.read(buffer, 0, buffer.length) == buffer.length) {
- return buffer[0]=='$';
- }
- } catch (Exception e) {
- return false;
- }
- }
- return false;
- }
-
/* (non-Javadoc)
* @see com.minres.scviewer.database.ITrDb#load(java.io.File)
*/
diff --git a/plugins/com.minres.scviewer.database/pom.xml b/plugins/com.minres.scviewer.database/pom.xml
index 431fb60..5ce5fb9 100644
--- a/plugins/com.minres.scviewer.database/pom.xml
+++ b/plugins/com.minres.scviewer.database/pom.xml
@@ -4,7 +4,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java
index 3a56058..7c1d224 100644
--- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java
+++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java
@@ -48,13 +48,6 @@ public interface IWaveformDbLoader {
*/
public void removePropertyChangeListener(PropertyChangeListener l) ;
- /**
- * Can load the given file.
- *
- * @param inputFile the input file
- * @return true, if successful
- */
- public boolean canLoad(File inputFile);
/**
* Load.
*
diff --git a/plugins/com.minres.scviewer.e4.application.help/META-INF/MANIFEST.MF b/plugins/com.minres.scviewer.e4.application.help/META-INF/MANIFEST.MF
index ae94659..c3b825a 100644
--- a/plugins/com.minres.scviewer.e4.application.help/META-INF/MANIFEST.MF
+++ b/plugins/com.minres.scviewer.e4.application.help/META-INF/MANIFEST.MF
@@ -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.16.0
+Bundle-Version: 2.16.1
Bundle-Vendor: MINRES Technologies GmbH
Automatic-Module-Name: com.minres.scviewer.e4.application.help
Bundle-RequiredExecutionEnvironment: JavaSE-11
diff --git a/plugins/com.minres.scviewer.e4.application.help/pom.xml b/plugins/com.minres.scviewer.e4.application.help/pom.xml
index 1b5b923..f4a54f1 100644
--- a/plugins/com.minres.scviewer.e4.application.help/pom.xml
+++ b/plugins/com.minres.scviewer.e4.application.help/pom.xml
@@ -6,7 +6,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF b/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
index e4fd2c3..943cacc 100644
--- a/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
+++ b/plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
@@ -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.16.0
+Bundle-Version: 2.16.1
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.11.1",
diff --git a/plugins/com.minres.scviewer.e4.application/pom.xml b/plugins/com.minres.scviewer.e4.application/pom.xml
index bf4f124..b63206d 100644
--- a/plugins/com.minres.scviewer.e4.application/pom.xml
+++ b/plugins/com.minres.scviewer.e4.application/pom.xml
@@ -6,7 +6,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-plugin
diff --git a/plugins/com.minres.scviewer.ui/pom.xml b/plugins/com.minres.scviewer.ui/pom.xml
index 30a2580..d38d355 100644
--- a/plugins/com.minres.scviewer.ui/pom.xml
+++ b/plugins/com.minres.scviewer.ui/pom.xml
@@ -4,7 +4,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-plugin
diff --git a/pom.xml b/pom.xml
index fa43c77..b4c65b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
pom
releng/com.minres.scviewer.target
@@ -69,7 +69,7 @@
com.minres.scviewer
com.minres.scviewer.target
- 2.16.0
+ 2.16.1
org.eclipse.justj.openjdk.hotspot.jre.minimal-15
diff --git a/products/com.minres.scviewer.e4.product/pom.xml b/products/com.minres.scviewer.e4.product/pom.xml
index 38ff11b..7f1fe2d 100644
--- a/products/com.minres.scviewer.e4.product/pom.xml
+++ b/products/com.minres.scviewer.e4.product/pom.xml
@@ -6,11 +6,11 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
com.minres.scviewer.e4.product
- 2.16.0
+ 2.16.1
eclipse-repository
com.minres.scviewer
diff --git a/products/com.minres.scviewer.e4.product/scviewer.product b/products/com.minres.scviewer.e4.product/scviewer.product
index ba9b8c2..63caa8e 100644
--- a/products/com.minres.scviewer.e4.product/scviewer.product
+++ b/products/com.minres.scviewer.e4.product/scviewer.product
@@ -1,7 +1,7 @@
-
+
diff --git a/releng/com.minres.scviewer.target/pom.xml b/releng/com.minres.scviewer.target/pom.xml
index 39ce240..b680d5b 100644
--- a/releng/com.minres.scviewer.target/pom.xml
+++ b/releng/com.minres.scviewer.target/pom.xml
@@ -12,7 +12,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
diff --git a/releng/com.minres.scviewer.updateSite/pom.xml b/releng/com.minres.scviewer.updateSite/pom.xml
index 3de80a2..6976eb7 100644
--- a/releng/com.minres.scviewer.updateSite/pom.xml
+++ b/releng/com.minres.scviewer.updateSite/pom.xml
@@ -7,7 +7,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
@@ -67,9 +67,9 @@
-application org.eclipse.ant.core.antRunner -buildfile packaging-p2-composite.ant p2.composite.add -Dsite.label="SCViewer Software Repository" -Dproject.build.directory=${project.build.directory} -DunqualifiedVersion=${unqualifiedVersion} -Dsoftware.download.area="${software.download.area}/SCViewer-GHP/repository"
- 2020-03
+ 2021-12
p2
- http://download.eclipse.org/releases/2020-03/
+ http://download.eclipse.org/releases/2021-12/
diff --git a/tests/com.minres.scviewer.database.test/inputs/SCViewer.scview b/tests/com.minres.scviewer.database.test/inputs/SCViewer.scview
new file mode 100644
index 0000000..f9664e1
--- /dev/null
+++ b/tests/com.minres.scviewer.database.test/inputs/SCViewer.scview
@@ -0,0 +1,80 @@
+#Written by SCViewer
+#Mon Jan 03 21:01:50 CET 2022
+SHOWN_WAVEFORM0=duv.addr_ack
+SHOWN_WAVEFORM11.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM2=duv.bus_addr[7\:0]
+SHOWN_WAVEFORM1=duv.addr_req
+SHOWN_WAVEFORM8=tr.addr_req
+SHOWN_WAVEFORM7=tr.addr_ack
+SHOWN_WAVEFORM9=tr.addr_stream
+SHOWN_WAVEFORM4=duv.clk
+SHOWN_WAVEFORM16.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM3=duv.bus_data[7\:0]
+SHOWN_WAVEFORM14.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM6=duv.rw
+SHOWN_WAVEFORM5=duv.data_rdy
+SHOWN_WAVEFORM8.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM3.WAVE_DISPLAY=DEFAULT
+SHOWN_CURSOR1=100000000
+SHOWN_CURSOR0=10000000
+SHOWN_WAVEFORM12.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM5.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM11.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM0.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM12.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM16.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORMS=17
+SHOWN_WAVEFORM15.WAVE_DISPLAY=DEFAULT
+SCALING_FACTOR=1000000
+SHOWN_CURSORS=2
+SHOWN_WAVEFORM14.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM13.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM0.WAVEFORM_SELECTED=TRUE
+SHOWN_WAVEFORM7.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM13.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM6.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM15.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM2.WAVEFORM_SELECTED=TRUE
+DATABASE_FILE1=C\:\\Users\\eyck\\git\\SCViewer\\tests\\com.minres.scviewer.database.test\\inputs\\my_db.txlog
+DATABASE_FILE0=C\:\\Users\\eyck\\git\\SCViewer\\tests\\com.minres.scviewer.database.test\\inputs\\my_db.vcd
+SHOWN_WAVEFORM9.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM7.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM9.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM7.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM12.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM10.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM9.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM4.WAVEFORM_SELECTED=TRUE
+SHOWN_WAVEFORM5.WAVE_DISPLAY=DEFAULT
+DATABASE_FILES=2
+SHOWN_WAVEFORM1.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM4.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM13.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM10.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM5.WAVEFORM_SELECTED=TRUE
+SHOWN_WAVEFORM14.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM15.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM6.WAVEFORM_SELECTED=TRUE
+SHOWN_WAVEFORM1.WAVEFORM_SELECTED=TRUE
+SHOWN_WAVEFORM16=tr.rw
+SHOWN_WAVEFORM11.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM4.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM1.VALUE_DISPLAY=DEFAULT
+TX_DETAILS_SHOWN=false
+SHOWN_WAVEFORM2.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM2.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM11=tr.bus_data[7\:0]
+SHOWN_WAVEFORM10=tr.bus_addr[7\:0]
+SHOWN_WAVEFORM15=tr.pipelined_stream
+SHOWN_WAVEFORM0.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM14=tr.data_stream
+SHOWN_WAVEFORM13=tr.data_rdy
+SHOWN_WAVEFORM12=tr.clk
+SHOWN_WAVEFORM10.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM8.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM3.VALUE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM6.WAVE_DISPLAY=DEFAULT
+BASE_LINE_TIME=0
+SHOWN_WAVEFORM16.WAVEFORM_SELECTED=FALSE
+SHOWN_WAVEFORM8.WAVE_DISPLAY=DEFAULT
+SHOWN_WAVEFORM3.WAVEFORM_SELECTED=TRUE
diff --git a/tests/com.minres.scviewer.database.test/pom.xml b/tests/com.minres.scviewer.database.test/pom.xml
index 0d29076..7d8f2b2 100644
--- a/tests/com.minres.scviewer.database.test/pom.xml
+++ b/tests/com.minres.scviewer.database.test/pom.xml
@@ -6,7 +6,7 @@
com.minres.scviewer
com.minres.scviewer.parent
- 2.16.0
+ 2.16.1
../..
eclipse-test-plugin