From ceaf52bfa1f730153eb2d0c043ffe49dbd852c34 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 23 Feb 2023 21:10:57 +0100 Subject: [PATCH 1/3] fixes some divide by zero exception while drawing --- .../com/minres/scviewer/database/ftr/FtrDbLoader.java | 10 ++-------- .../database/ui/swt/internal/RulerPainter.java | 5 +++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java index d5f8990..37bfb58 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java @@ -328,7 +328,6 @@ public class FtrDbLoader implements IWaveformDbLoader { long array_len = readArrayLength(); assert(array_len==-1); CborType next = peekType(); - int chunk_idx=0; while(next != null && !break_type.isEqualType(next)) { long tag = readTag(); switch((int)tag) { @@ -400,7 +399,6 @@ public class FtrDbLoader implements IWaveformDbLoader { } } next = peekType(); - chunk_idx++; } } catch(IOException e) { long pos = 0; @@ -468,7 +466,6 @@ public class FtrDbLoader implements IWaveformDbLoader { long tx_size = cborDecoder.readArrayLength(); long txId = 0; long genId = 0; - long attr_idx=0; for(long i = 0; imaxTextLength; 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); From 23a2f8d6c87fcbb3d71d9c88de9aaa13974a64f6 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 24 Feb 2023 07:59:17 +0100 Subject: [PATCH 2/3] fixes data type numbering --- .../scviewer/database/ftr/FtrDbLoader.java | 48 +++++++++++-------- .../scviewer/database/sqlite/TxAttribute.java | 13 ++++- .../minres/scviewer/database/DataType.java | 44 ++++++----------- 3 files changed, 53 insertions(+), 52 deletions(-) diff --git a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java index 37bfb58..c0e2f4e 100644 --- a/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java +++ b/plugins/com.minres.scviewer.database.ftr/src/com/minres/scviewer/database/ftr/FtrDbLoader.java @@ -49,7 +49,7 @@ import jacob.CborType; public class FtrDbLoader implements IWaveformDbLoader { enum FileType { NONE, PLAIN, GZIP, LZ4}; - + /** The max time. */ private Long maxTime = 0L; @@ -243,29 +243,31 @@ 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); - TxAttributeType attrType = getOrAddAttributeType(tag, type_id, attrName); - switch((int)type_id) { - case 0: // BOOLEAN + 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 10: // POINTER + 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; @@ -281,9 +283,9 @@ public class FtrDbLoader implements IWaveformDbLoader { return ret; } - private synchronized TxAttributeType getOrAddAttributeType(long tag, long type_id, String attrName) { + private synchronized TxAttributeType getOrAddAttributeType(long tag, DataType type, String attrName) { if(!attributeTypes.containsKey(attrName)) { - attributeTypes.put(attrName, new TxAttributeType(attrName, DataType.values()[(int)type_id], AssociationType.values()[(int)tag-7])); + attributeTypes.put(attrName, new TxAttributeType(attrName, type, AssociationType.values()[(int)tag-7])); } TxAttributeType attrType = attributeTypes.get(attrName); return attrType; @@ -495,15 +497,19 @@ public class FtrDbLoader implements IWaveformDbLoader { long sz = cborDecoder.readArrayLength(); assert(sz==3); cborDecoder.readInt(); - switch((int)cborDecoder.readInt()) { - case 0: // BOOLEAN + long type_id = cborDecoder.readInt(); + switch(DataType.values()[(int)type_id]) { + case BOOLEAN: cborDecoder.readBoolean(); break; - case 4: // FLOATING_POINT_NUMBER - case 7: // FIXED_POINT_INTEGER - case 8: // UNSIGNED_FIXED_POINT_INTEGER + 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(); } diff --git a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java index 94fcb18..2f833b2 100644 --- a/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java +++ b/plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java @@ -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 diff --git a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java index b37a16d..e8e0057 100644 --- a/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java +++ b/plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java @@ -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 } From 31e79e453ccde2ae61877cad417a25093c573128 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 24 Feb 2023 09:15:10 +0100 Subject: [PATCH 3/3] updates version number --- doc/com.minres.scviewer.doc/pom.xml | 2 +- features/com.minres.scviewer.database.feature/pom.xml | 2 +- features/com.minres.scviewer.e4.feature/pom.xml | 2 +- features/com.minres.scviewer.e4.help.feature/pom.xml | 2 +- features/com.minres.scviewer.e4.platform.feature/pom.xml | 2 +- features/com.minres.scviewer.feature/pom.xml | 2 +- features/com.minres.scviewer.ui.feature/pom.xml | 2 +- plugins/com.minres.scviewer.database.ftr/pom.xml | 2 +- plugins/com.minres.scviewer.database.sqlite/pom.xml | 2 +- plugins/com.minres.scviewer.database.text/pom.xml | 2 +- plugins/com.minres.scviewer.database.ui.swt/pom.xml | 2 +- plugins/com.minres.scviewer.database.vcd/pom.xml | 2 +- plugins/com.minres.scviewer.database/pom.xml | 2 +- .../META-INF/MANIFEST.MF | 2 +- plugins/com.minres.scviewer.e4.application.help/pom.xml | 2 +- .../com.minres.scviewer.e4.application/META-INF/MANIFEST.MF | 2 +- plugins/com.minres.scviewer.e4.application/pom.xml | 2 +- plugins/com.minres.scviewer.ui/pom.xml | 2 +- pom.xml | 4 ++-- products/com.minres.scviewer.e4.product/pom.xml | 4 ++-- products/com.minres.scviewer.e4.product/scviewer.product | 2 +- releng/com.minres.scviewer.target/pom.xml | 2 +- releng/com.minres.scviewer.updateSite/pom.xml | 2 +- tests/com.minres.scviewer.database.test/pom.xml | 2 +- 24 files changed, 26 insertions(+), 26 deletions(-) diff --git a/doc/com.minres.scviewer.doc/pom.xml b/doc/com.minres.scviewer.doc/pom.xml index 4e78910..bf07081 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.17.2 + 2.17.3 ../.. diff --git a/features/com.minres.scviewer.database.feature/pom.xml b/features/com.minres.scviewer.database.feature/pom.xml index 7f525c9..27095a0 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.17.2 + 2.17.3 ../.. 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 91cd079..7b1b9da 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.17.2 + 2.17.3 ../.. 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 24f3465..3c20d60 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.17.2 + 2.17.3 ../.. 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 e2415a4..e9c5d55 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.17.2 + 2.17.3 ../.. 1.0.0-SNAPSHOT diff --git a/features/com.minres.scviewer.feature/pom.xml b/features/com.minres.scviewer.feature/pom.xml index 46cf00f..8b43b83 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.17.2 + 2.17.3 ../.. 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 11ccde9..5858e87 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.17.2 + 2.17.3 ../.. 1.1.0-SNAPSHOT diff --git a/plugins/com.minres.scviewer.database.ftr/pom.xml b/plugins/com.minres.scviewer.database.ftr/pom.xml index b83f1f9..602cf8d 100644 --- a/plugins/com.minres.scviewer.database.ftr/pom.xml +++ b/plugins/com.minres.scviewer.database.ftr/pom.xml @@ -6,7 +6,7 @@ com.minres.scviewer com.minres.scviewer.parent - 2.17.2 + 2.17.3 ../.. eclipse-plugin diff --git a/plugins/com.minres.scviewer.database.sqlite/pom.xml b/plugins/com.minres.scviewer.database.sqlite/pom.xml index bf772c5..60577c0 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.17.2 + 2.17.3 ../.. eclipse-plugin diff --git a/plugins/com.minres.scviewer.database.text/pom.xml b/plugins/com.minres.scviewer.database.text/pom.xml index ea051de..6f77df7 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.17.2 + 2.17.3 ../.. eclipse-plugin diff --git a/plugins/com.minres.scviewer.database.ui.swt/pom.xml b/plugins/com.minres.scviewer.database.ui.swt/pom.xml index 4560781..cc91144 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.17.2 + 2.17.3 ../.. 4.0.0-SNAPSHOT diff --git a/plugins/com.minres.scviewer.database.vcd/pom.xml b/plugins/com.minres.scviewer.database.vcd/pom.xml index 9284855..1e32c07 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.17.2 + 2.17.3 ../.. eclipse-plugin diff --git a/plugins/com.minres.scviewer.database/pom.xml b/plugins/com.minres.scviewer.database/pom.xml index 77a04e2..94a40f6 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.17.2 + 2.17.3 ../.. eclipse-plugin 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 7b6bc5d..9ad7a71 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.17.2 +Bundle-Version: 2.17.3 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 7546b00..77a19b7 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.17.2 + 2.17.3 ../.. 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 dd80143..c1102a8 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.17.2 +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", diff --git a/plugins/com.minres.scviewer.e4.application/pom.xml b/plugins/com.minres.scviewer.e4.application/pom.xml index 231c4fd..2b7fab7 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.17.2 + 2.17.3 ../.. eclipse-plugin diff --git a/plugins/com.minres.scviewer.ui/pom.xml b/plugins/com.minres.scviewer.ui/pom.xml index 7969e95..8eb8a41 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.17.2 + 2.17.3 ../.. eclipse-plugin diff --git a/pom.xml b/pom.xml index ad4bec1..2700a9f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.minres.scviewer com.minres.scviewer.parent - 2.17.2 + 2.17.3 pom releng/com.minres.scviewer.target @@ -70,7 +70,7 @@ com.minres.scviewer com.minres.scviewer.target - 2.17.2 + 2.17.3 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 7ce7504..fc95efd 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.17.2 + 2.17.3 ../.. com.minres.scviewer.e4.product - 2.17.2 + 2.17.3 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 a671948..331616f 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 fc40c70..97db396 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.17.2 + 2.17.3 ../.. diff --git a/releng/com.minres.scviewer.updateSite/pom.xml b/releng/com.minres.scviewer.updateSite/pom.xml index 307f6c7..d831342 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.17.2 + 2.17.3 ../.. diff --git a/tests/com.minres.scviewer.database.test/pom.xml b/tests/com.minres.scviewer.database.test/pom.xml index 64ac288..04e88d3 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.17.2 + 2.17.3 ../.. eclipse-test-plugin