Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56ad3026a1 | ||
|
|
3e31fee780 | ||
|
|
589762b220 | ||
|
|
4824d48828 | ||
|
|
7bceaa0635 | ||
|
|
d48fa68280 | ||
|
|
ad313b83f3 | ||
|
|
1eed2c970c | ||
|
|
6668151a53 | ||
|
|
591fe2c4c7 | ||
|
|
1f861cefb8 | ||
|
|
40d402ce8a | ||
|
|
889dee0b87 | ||
|
|
2b913d0e94 | ||
|
|
883aeb600b | ||
|
|
75fa1a4f31 | ||
|
|
e78c65a36c | ||
|
|
8d4ec071e5 | ||
|
|
d31fe15000 | ||
|
|
c85a842dbe | ||
|
|
82c4dcf552 | ||
|
|
182b5bc01e | ||
|
|
de66bb2580 | ||
|
|
f4908e45ba | ||
|
|
51115ff55c | ||
|
|
33c58983e3 | ||
|
|
2ffcbe1fa3 | ||
|
|
360df27a53 | ||
|
|
17015f1bbc | ||
|
|
e4ba753f82 | ||
|
|
97d6062c3f | ||
|
|
92428a3859 | ||
|
|
5f244dc03a | ||
|
|
64cc09d207 |
No files matched your search
@@ -9,7 +9,7 @@
|
|||||||
<listAttribute key="M2_PROPERTIES"/>
|
<listAttribute key="M2_PROPERTIES"/>
|
||||||
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
|
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>
|
||||||
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
|
<booleanAttribute key="M2_SKIP_TESTS" value="false"/>
|
||||||
<intAttribute key="M2_THREADS" value="1"/>
|
<intAttribute key="M2_THREADS" value="4"/>
|
||||||
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
|
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
|
||||||
<stringAttribute key="M2_USER_SETTINGS" value=""/>
|
<stringAttribute key="M2_USER_SETTINGS" value=""/>
|
||||||
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/>
|
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/>
|
||||||
|
|||||||
@@ -14,4 +14,15 @@
|
|||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997756</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx16G -Xms100m -Xlog:disable",
|
||||||
|
"java.autobuild.enabled": false
|
||||||
|
}
|
||||||
@@ -5,7 +5,24 @@
|
|||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997726</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -20,4 +20,15 @@
|
|||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997692</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>3.0.0-SNAPSHOT</version>
|
<version>3.0.0-SNAPSHOT</version>
|
||||||
|
|||||||
@@ -10,8 +10,25 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997737</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
|
|||||||
@@ -10,8 +10,25 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997741</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|||||||
@@ -10,8 +10,25 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997745</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|||||||
@@ -20,4 +20,15 @@
|
|||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997752</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<feature
|
<feature
|
||||||
id="com.minres.scviewer.feature"
|
id="com.minres.scviewer.feature"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="1.1.0.qualifier"
|
version="2.20.0"
|
||||||
provider-name="%providerName">
|
provider-name="%providerName">
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
@@ -46,22 +46,14 @@ http://www.eclipse.org/legal/epl-v10.html
|
|||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
id="org.junit"
|
id="org.junit"
|
||||||
download-size="0"
|
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"/>
|
version="0.0.0"/>
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
id="org.hamcrest.core"
|
id="org.hamcrest.core"
|
||||||
download-size="0"
|
version="0.0.0"/>
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"
|
|
||||||
unpack="false"/>
|
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
id="com.minres.scviewer.ui"
|
id="com.minres.scviewer.ui"
|
||||||
download-size="0"
|
version="0.0.0"/>
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"
|
|
||||||
unpack="false"/>
|
|
||||||
|
|
||||||
</feature>
|
</feature>
|
||||||
@@ -5,8 +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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
|
||||||
</project>
|
</project>
|
||||||
@@ -10,8 +10,25 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997772</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|||||||
@@ -25,9 +25,26 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997695</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -4,7 +4,7 @@ Bundle-Name: FST signal database
|
|||||||
Bundle-SymbolicName: com.minres.scviewer.database.fst
|
Bundle-SymbolicName: com.minres.scviewer.database.fst
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.0.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
||||||
org.eclipse.osgi.services;bundle-version="3.4.0",
|
org.eclipse.osgi.services;bundle-version="3.4.0",
|
||||||
com.google.guava;bundle-version="15.0.0"
|
com.google.guava;bundle-version="15.0.0"
|
||||||
|
|||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|||||||
+9
-6
@@ -17,6 +17,7 @@ import com.minres.scviewer.database.HierNode;
|
|||||||
import com.minres.scviewer.database.IEvent;
|
import com.minres.scviewer.database.IEvent;
|
||||||
import com.minres.scviewer.database.IEventList;
|
import com.minres.scviewer.database.IEventList;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
import com.minres.scviewer.database.WaveformType;
|
import com.minres.scviewer.database.WaveformType;
|
||||||
|
|
||||||
public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
||||||
@@ -31,7 +32,7 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
|||||||
|
|
||||||
private final int width;
|
private final int width;
|
||||||
|
|
||||||
private final IEventList values;
|
private final LazyValue<IEventList> values;
|
||||||
|
|
||||||
public FstSignal(FstDbLoader loader, String name) {
|
public FstSignal(FstDbLoader loader, String name) {
|
||||||
this(loader, 0, name, 0, 1);
|
this(loader, 0, name, 0, 1);
|
||||||
@@ -48,7 +49,7 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
|||||||
this.id=id;
|
this.id=id;
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
this.width=width;
|
this.width=width;
|
||||||
this.values=new EventList();
|
this.values=new LazyValue<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FstSignal(FstSignal<T> o, int id, String name) {
|
public FstSignal(FstSignal<T> o, int id, String name) {
|
||||||
@@ -73,9 +74,11 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEventList getEvents() {
|
public IEventList getEvents() {
|
||||||
if(values.size()==0)
|
return values.get(() -> {
|
||||||
loader.getEvents(id, width, values);
|
EventList loaded = new EventList();
|
||||||
return values;
|
loader.getEvents(id, width, loaded);
|
||||||
|
return loaded;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -89,7 +92,7 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
|||||||
if(e==null)
|
if(e==null)
|
||||||
return new IEvent[] {};
|
return new IEvent[] {};
|
||||||
else
|
else
|
||||||
return getEvents().floorEntry(time).events;
|
return e.events;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|||||||
@@ -36,4 +36,15 @@
|
|||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997699</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -4,7 +4,7 @@ Bundle-Name: CBOR transaction database
|
|||||||
Bundle-SymbolicName: com.minres.scviewer.database.ftr
|
Bundle-SymbolicName: com.minres.scviewer.database.ftr
|
||||||
Bundle-Version: 1.0.2.qualifier
|
Bundle-Version: 1.0.2.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
Import-Package: org.osgi.framework;version="1.3.0",
|
Import-Package: org.osgi.framework;version="1.3.0",
|
||||||
org.slf4j;version="1.7.2"
|
org.slf4j;version="1.7.2"
|
||||||
Require-Bundle: com.minres.scviewer.database,
|
Require-Bundle: com.minres.scviewer.database,
|
||||||
@@ -16,3 +16,4 @@ Service-Component: OSGI-INF/component.xml
|
|||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Automatic-Module-Name: com.minres.scviewer.database.ftr
|
Automatic-Module-Name: com.minres.scviewer.database.ftr
|
||||||
Bundle-ClassPath: .
|
Bundle-ClassPath: .
|
||||||
|
Export-Package: com.minres.scviewer.database.ftr;x-friends:="com.minres.scviewer.database.test"
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|||||||
+46
-48
@@ -10,9 +10,12 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database.ftr;
|
package com.minres.scviewer.database.ftr;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
|
import com.minres.scviewer.database.tx.ITx;
|
||||||
|
import com.minres.scviewer.database.tx.TransactionLists;
|
||||||
|
import com.minres.scviewer.database.tx.ITransactionProvider;
|
||||||
import com.minres.scviewer.database.EventEntry;
|
import com.minres.scviewer.database.EventEntry;
|
||||||
import com.minres.scviewer.database.EventList;
|
import com.minres.scviewer.database.EventList;
|
||||||
import com.minres.scviewer.database.HierNode;
|
import com.minres.scviewer.database.HierNode;
|
||||||
@@ -20,13 +23,27 @@ import com.minres.scviewer.database.IEvent;
|
|||||||
import com.minres.scviewer.database.IEventList;
|
import com.minres.scviewer.database.IEventList;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.WaveformType;
|
import com.minres.scviewer.database.WaveformType;
|
||||||
import com.minres.scviewer.database.tx.ITx;
|
import com.minres.scviewer.database.tx.TxRowAllocator;
|
||||||
import com.minres.scviewer.database.tx.ITxEvent;
|
import com.minres.scviewer.database.tx.ITxEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class AbstractTxStream.
|
* The Class AbstractTxStream.
|
||||||
*/
|
*/
|
||||||
abstract class AbstractTxStream extends HierNode implements IWaveform {
|
abstract class AbstractTxStream extends HierNode implements IWaveform, ITransactionProvider {
|
||||||
|
|
||||||
|
private final LazyValue<List<ITx>> transactionList = new LazyValue<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ITx> getTransactionList() {
|
||||||
|
return transactionList.get(() -> TransactionLists.fromEvents(getEvents(), () -> false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ITx getTransaction(long id) {
|
||||||
|
getEvents(); // FTR parses the owning stream on demand.
|
||||||
|
ITx transaction = loader.getTransaction(id);
|
||||||
|
return transaction != null && (transaction.getStream() == this || transaction.getGenerator() == this) ? transaction : null;
|
||||||
|
}
|
||||||
|
|
||||||
private final String fullName;
|
private final String fullName;
|
||||||
|
|
||||||
@@ -38,6 +55,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
|
|
||||||
/** The events. */
|
/** The events. */
|
||||||
protected IEventList events = new EventList();
|
protected IEventList events = new EventList();
|
||||||
|
private EventList.Builder eventBuilder = new EventList.Builder();
|
||||||
|
|
||||||
/** The max concurrency. */
|
/** The max concurrency. */
|
||||||
private int rowCount = -1;
|
private int rowCount = -1;
|
||||||
@@ -71,7 +89,14 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
* @param evt the evt
|
* @param evt the evt
|
||||||
*/
|
*/
|
||||||
public void addEvent(ITxEvent evt) {
|
public void addEvent(ITxEvent evt) {
|
||||||
events.put(evt.getTime(), evt);
|
eventBuilder.add(evt.getTime(), evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void finishEvents() {
|
||||||
|
if (eventBuilder != null) {
|
||||||
|
events = eventBuilder.build();
|
||||||
|
eventBuilder = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,7 +107,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IEvent[] getEventsAtTime(long time) {
|
public IEvent[] getEventsAtTime(long time) {
|
||||||
return events.get(time);
|
return getEvents().get(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,11 +118,11 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IEvent[] getEventsBeforeTime(long time) {
|
public IEvent[] getEventsBeforeTime(long time) {
|
||||||
EventEntry e = events.floorEntry(time);
|
EventEntry e = getEvents().floorEntry(time);
|
||||||
if (e == null)
|
if (e == null)
|
||||||
return new IEvent[] {};
|
return new IEvent[] {};
|
||||||
else
|
else
|
||||||
return events.floorEntry(time).events;
|
return e.events;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +132,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public WaveformType getType() {
|
public WaveformType getType() {
|
||||||
return WaveformType.TRANSACTION;
|
return WaveformType.STREAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -126,7 +151,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
* @return the width
|
* @return the width
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getRowCount() {
|
public synchronized int getRowCount() {
|
||||||
if (rowCount<0)
|
if (rowCount<0)
|
||||||
calculateConcurrency();
|
calculateConcurrency();
|
||||||
return rowCount;
|
return rowCount;
|
||||||
@@ -140,43 +165,16 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
/**
|
/**
|
||||||
* Calculate concurrency.
|
* Calculate concurrency.
|
||||||
*/
|
*/
|
||||||
void calculateConcurrency() {
|
synchronized void calculateConcurrency() {
|
||||||
if (rowCount>=0)
|
if (rowCount >= 0) return;
|
||||||
return;
|
int count = TxRowAllocator.assign(getEvents(), (event, row) -> {
|
||||||
ArrayList<Long> rowEndTime = new ArrayList<>();
|
((TxEvent) event).setConcurrencyIndex(row);
|
||||||
HashMap<Long, Integer> rowByTxId = new HashMap<>();
|
Tx tx = (Tx) event.getTransaction();
|
||||||
for(EventEntry entry: getEvents()) {
|
if (this instanceof TxGenerator) tx.setConcurrencyIdxInGen(row);
|
||||||
for(IEvent evt:entry.events) {
|
else tx.setConcurrencyIndxInStream(row);
|
||||||
TxEvent txEvt = (TxEvent) evt;
|
});
|
||||||
ITx tx = txEvt.getTransaction();
|
for (com.minres.scviewer.database.IHierNode child : getChildNodes())
|
||||||
int rowIdx = 0;
|
((TxGenerator) child).calculateConcurrency();
|
||||||
switch(evt.getKind()) {
|
rowCount = count;
|
||||||
case END: //TODO: might throw NPE in concurrent execution
|
|
||||||
Long txId = txEvt.getTransaction().getId();
|
|
||||||
txEvt.setConcurrencyIndex(rowByTxId.get(txId));
|
|
||||||
rowByTxId.remove(txId);
|
|
||||||
break;
|
|
||||||
case SINGLE:
|
|
||||||
for (; rowIdx < rowEndTime.size() && rowEndTime.get(rowIdx)>tx.getBeginTime(); rowIdx++);
|
|
||||||
if (rowEndTime.size() <= rowIdx)
|
|
||||||
rowEndTime.add(tx.getEndTime());
|
|
||||||
else
|
|
||||||
rowEndTime.set(rowIdx, tx.getEndTime());
|
|
||||||
((TxEvent) evt).setConcurrencyIndex(rowIdx);
|
|
||||||
break;
|
|
||||||
case BEGIN:
|
|
||||||
for (; rowIdx < rowEndTime.size() && rowEndTime.get(rowIdx)>tx.getBeginTime(); rowIdx++);
|
|
||||||
if (rowEndTime.size() <= rowIdx)
|
|
||||||
rowEndTime.add(tx.getEndTime());
|
|
||||||
else
|
|
||||||
rowEndTime.set(rowIdx, tx.getEndTime());
|
|
||||||
((TxEvent) evt).setConcurrencyIndex(rowIdx);
|
|
||||||
rowByTxId.put(tx.getId(), rowIdx);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rowCount=rowEndTime.size()>0?rowEndTime.size():1;
|
|
||||||
getChildNodes().parallelStream().forEach(c -> ((TxGenerator)c).calculateConcurrency());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+57
-59
@@ -76,7 +76,8 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
final Map<Long, FtrTx> transactions = UnifiedMap.newMap();
|
final Map<Long, FtrTx> transactions = UnifiedMap.newMap();
|
||||||
|
|
||||||
/** The attribute types. */
|
/** The attribute types. */
|
||||||
final Map<String, TxAttributeType> attributeTypes = UnifiedMap.newMap();
|
private record AttributeKey(String name, DataType type, AssociationType association) { }
|
||||||
|
final Map<AttributeKey, TxAttributeType> attributeTypes = UnifiedMap.newMap();
|
||||||
|
|
||||||
/** The relations in. */
|
/** The relations in. */
|
||||||
final HashMultimap<Long, FtrRelation> relationsIn = HashMultimap.create();
|
final HashMultimap<Long, FtrRelation> relationsIn = HashMultimap.create();
|
||||||
@@ -177,19 +178,17 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
* @throws InputFormatException the input format exception
|
* @throws InputFormatException the input format exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void load(File file) throws InputFormatException {
|
public synchronized void load(File file) throws InputFormatException {
|
||||||
this.file=file;
|
dispose();
|
||||||
|
this.file = file;
|
||||||
try {
|
try {
|
||||||
fis = new FileInputStream(file);
|
fis = new FileInputStream(file);
|
||||||
FileChannel channel = fis.getChannel();
|
FileChannel channel = fis.getChannel();
|
||||||
lock=channel.lock(0, Long.MAX_VALUE, true);
|
lock = channel.lock(0, Long.MAX_VALUE, true);
|
||||||
parseInput(new CborDecoder(fis), channel);
|
parseInput(new CborDecoder(fis), channel);
|
||||||
} catch (IOException e) {
|
|
||||||
LOG.warn("Problem parsing file "+file.getName()+": " , e);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Error parsing file "+file.getName()+ ": ", e);
|
dispose();
|
||||||
transactions.clear();
|
throw new InputFormatException("Cannot parse " + file.getName(), e);
|
||||||
throw new InputFormatException(e.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,8 +211,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
} catch (Exception 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("Cannot read FTR chunks", e);
|
||||||
throw new InputFormatException(e.toString());
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -221,7 +219,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
void parseTx(TxStream txStream, long blockId, byte[] chunk) throws IOException {
|
void parseTx(TxStream txStream, long blockId, byte[] chunk) throws IOException {
|
||||||
CborDecoder cborDecoder = new CborDecoder(new ByteArrayInputStream(chunk));
|
CborDecoder cborDecoder = new CborDecoder(new ByteArrayInputStream(chunk));
|
||||||
long size = cborDecoder.readArrayLength();
|
long size = cborDecoder.readArrayLength();
|
||||||
assert(size==-1);
|
if (!(size==-1)) throw new IOException("Invalid FTR structure: size==-1");
|
||||||
CborType next = cborDecoder.peekType();
|
CborType next = cborDecoder.peekType();
|
||||||
while(next != null && !break_type.isEqualType(next)) {
|
while(next != null && !break_type.isEqualType(next)) {
|
||||||
long blockOffset = cborDecoder.getPos();
|
long blockOffset = cborDecoder.getPos();
|
||||||
@@ -233,28 +231,30 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
switch((int)tag) {
|
switch((int)tag) {
|
||||||
case 6: // id/generator/start/end
|
case 6: // id/generator/start/end
|
||||||
long len = cborDecoder.readArrayLength();
|
long len = cborDecoder.readArrayLength();
|
||||||
assert(len==4);
|
if (!(len==4)) throw new IOException("Invalid FTR structure: len==4");
|
||||||
txId = cborDecoder.readInt();
|
txId = cborDecoder.readInt();
|
||||||
genId = cborDecoder.readInt();
|
genId = cborDecoder.readInt();
|
||||||
long startTime = cborDecoder.readInt()*time_scale_factor;
|
long startTime = cborDecoder.readInt()*time_scale_factor;
|
||||||
long endTime = cborDecoder.readInt()*time_scale_factor;
|
long endTime = cborDecoder.readInt()*time_scale_factor;
|
||||||
|
if(endTime<startTime) // fix buggy recording, end time needs to be later or equal start time
|
||||||
|
endTime=startTime;
|
||||||
TxGenerator gen = txGenerators.get(genId);
|
TxGenerator gen = txGenerators.get(genId);
|
||||||
FtrTx scvTx = new FtrTx(txId, gen.stream.getId(), genId, startTime, endTime, blockId, blockOffset);
|
TxStream stream = gen.stream;
|
||||||
|
FtrTx scvTx = new FtrTx(txId, stream.getId(), genId, startTime, endTime, blockId, blockOffset);
|
||||||
updateTransactions(txId, scvTx);
|
updateTransactions(txId, scvTx);
|
||||||
TxStream stream = txStreams.get(gen.stream.getId());
|
|
||||||
if (scvTx.beginTime == scvTx.endTime) {
|
if (scvTx.beginTime == scvTx.endTime) {
|
||||||
stream.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime));
|
stream.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime, stream.getType()));
|
||||||
gen.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime));
|
gen.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime, gen.getType()));
|
||||||
} else {
|
} else {
|
||||||
stream.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime));
|
stream.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime, stream.getType()));
|
||||||
gen.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime));
|
gen.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime, gen.getType()));
|
||||||
stream.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime));
|
stream.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime, stream.getType()));
|
||||||
gen.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime));
|
gen.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime, gen.getType()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: { // skip over 7:begin attr, 8:record attr, 9:end attr
|
default: { // skip over 7:begin attr, 8:record attr, 9:end attr
|
||||||
long sz = cborDecoder.readArrayLength();
|
long sz = cborDecoder.readArrayLength();
|
||||||
assert(sz==3);
|
if (!(sz==3)) throw new IOException("Invalid FTR structure: sz==3");
|
||||||
cborDecoder.readInt();
|
cborDecoder.readInt();
|
||||||
long type_id = cborDecoder.readInt();
|
long type_id = cborDecoder.readInt();
|
||||||
switch(DataType.values()[(int)type_id]) {
|
switch(DataType.values()[(int)type_id]) {
|
||||||
@@ -296,7 +296,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
switch((int)tag) {
|
switch((int)tag) {
|
||||||
case 6: // id/generator/start/end
|
case 6: // id/generator/start/end
|
||||||
long len = cborDecoder.readArrayLength();
|
long len = cborDecoder.readArrayLength();
|
||||||
assert(len==4);
|
if (!(len==4)) throw new IOException("Invalid FTR structure: len==4");
|
||||||
cborDecoder.readInt(); //txid
|
cborDecoder.readInt(); //txid
|
||||||
cborDecoder.readInt(); // genId
|
cborDecoder.readInt(); // genId
|
||||||
cborDecoder.readInt(); // startTime
|
cborDecoder.readInt(); // startTime
|
||||||
@@ -304,7 +304,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
break;
|
break;
|
||||||
default: { // skip over 7:begin attr, 8:record attr, 9:end attr
|
default: { // skip over 7:begin attr, 8:record attr, 9:end attr
|
||||||
long sz = cborDecoder.readArrayLength();
|
long sz = cborDecoder.readArrayLength();
|
||||||
assert(sz==3);
|
if (!(sz==3)) throw new IOException("Invalid FTR structure: sz==3");
|
||||||
long name_id = cborDecoder.readInt();
|
long name_id = cborDecoder.readInt();
|
||||||
long type_id = cborDecoder.readInt();
|
long type_id = cborDecoder.readInt();
|
||||||
DataType type = DataType.values()[(int)type_id];
|
DataType type = DataType.values()[(int)type_id];
|
||||||
@@ -342,37 +342,41 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error("Error parsing file "+file.getName(), e);
|
throw new IllegalStateException("Cannot parse attributes in " + file.getName(), e);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized TxAttributeType getOrAddAttributeType(long tag, DataType type, String attrName) {
|
private synchronized TxAttributeType getOrAddAttributeType(long tag, DataType type, String attrName) {
|
||||||
if(!attributeTypes.containsKey(attrName)) {
|
AssociationType association = AssociationType.values()[(int) tag - 7];
|
||||||
attributeTypes.put(attrName, new TxAttributeType(attrName, type, AssociationType.values()[(int)tag-7]));
|
AttributeKey key = new AttributeKey(attrName, type, association);
|
||||||
}
|
return attributeTypes.computeIfAbsent(key, k -> new TxAttributeType(k.name(), k.type(), k.association()));
|
||||||
TxAttributeType attrType = attributeTypes.get(attrName);
|
|
||||||
return attrType;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Dispose.
|
* Dispose.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public synchronized void dispose() {
|
||||||
try {
|
try { if (lock != null) lock.close(); }
|
||||||
if(lock!=null) lock.close();
|
catch (IOException e) { LOG.warn("Cannot release FTR lock", e); }
|
||||||
lock=null;
|
finally { lock = null; }
|
||||||
if(fis!=null) fis.close();
|
try { if (fis != null) fis.close(); }
|
||||||
fis=null;
|
catch (IOException e) { LOG.warn("Cannot close FTR file", e); }
|
||||||
} catch (IOException e) { }
|
finally { fis = null; }
|
||||||
attrValues.clear();
|
attrValues.clear();
|
||||||
relationTypes.clear();
|
relationTypes.clear();
|
||||||
txStreams.clear();
|
txStreams.clear();
|
||||||
txGenerators.clear();
|
txGenerators.clear();
|
||||||
transactions.clear();
|
transactions.clear();
|
||||||
|
txCache.clear();
|
||||||
|
strDict.clear();
|
||||||
attributeTypes.clear();
|
attributeTypes.clear();
|
||||||
relationsIn.clear();
|
relationsIn.clear();
|
||||||
relationsOut.clear();
|
relationsOut.clear();
|
||||||
|
threads.clear();
|
||||||
|
maxTime = 0;
|
||||||
|
time_scale_factor = 1000L;
|
||||||
|
file = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long calculateTimescaleMultipierPower(long power){
|
static long calculateTimescaleMultipierPower(long power){
|
||||||
@@ -386,12 +390,11 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void parseInput(CborDecoder cborDecoder, FileChannel channel) {
|
public void parseInput(CborDecoder cborDecoder, FileChannel channel) throws IOException {
|
||||||
try {
|
|
||||||
long cbor_tag = cborDecoder.readTag();
|
long cbor_tag = cborDecoder.readTag();
|
||||||
assert(cbor_tag == 55799);
|
if (!(cbor_tag == 55799)) throw new IOException("Invalid FTR structure: cbor_tag == 55799");
|
||||||
long array_len = cborDecoder.readArrayLength();
|
long array_len = cborDecoder.readArrayLength();
|
||||||
assert(array_len==-1);
|
if (!(array_len==-1)) throw new IOException("Invalid FTR structure: array_len==-1");
|
||||||
CborType next = cborDecoder.peekType();
|
CborType next = cborDecoder.peekType();
|
||||||
while(next != null && !break_type.isEqualType(next)) {
|
while(next != null && !break_type.isEqualType(next)) {
|
||||||
long tag = cborDecoder.readTag();
|
long tag = cborDecoder.readTag();
|
||||||
@@ -399,12 +402,12 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
case 6: { // info
|
case 6: { // info
|
||||||
CborDecoder cbd = new CborDecoder(new ByteArrayInputStream(cborDecoder.readByteString()));
|
CborDecoder cbd = new CborDecoder(new ByteArrayInputStream(cborDecoder.readByteString()));
|
||||||
long sz = cbd.readArrayLength();
|
long sz = cbd.readArrayLength();
|
||||||
assert(sz==2);
|
if (!(sz==2)) throw new IOException("Invalid FTR structure: sz==2");
|
||||||
long time_scale=cbd.readInt();
|
long time_scale=cbd.readInt();
|
||||||
long eff_time_scale=time_scale-IWaveformDb.databaseTimeScale;
|
long eff_time_scale=time_scale-IWaveformDb.databaseTimeScale;
|
||||||
time_scale_factor = calculateTimescaleMultipierPower(eff_time_scale);
|
time_scale_factor = calculateTimescaleMultipierPower(eff_time_scale);
|
||||||
long epoch_tag = cbd.readTag();
|
long epoch_tag = cbd.readTag();
|
||||||
assert(epoch_tag==1);
|
if (!(epoch_tag==1)) throw new IOException("Invalid FTR structure: epoch_tag==1");
|
||||||
cbd.readInt(); // epoch
|
cbd.readInt(); // epoch
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -414,7 +417,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
case 9: { // dictionary compressed
|
case 9: { // dictionary compressed
|
||||||
long sz = cborDecoder.readArrayLength();
|
long sz = cborDecoder.readArrayLength();
|
||||||
assert(sz==2);
|
if (!(sz==2)) throw new IOException("Invalid FTR structure: sz==2");
|
||||||
cborDecoder.readInt(); // uncompressed size
|
cborDecoder.readInt(); // uncompressed size
|
||||||
parseDict(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(cborDecoder.readByteString()))));
|
parseDict(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(cborDecoder.readByteString()))));
|
||||||
break;
|
break;
|
||||||
@@ -425,14 +428,14 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
case 11: { // directory compressed
|
case 11: { // directory compressed
|
||||||
long sz = cborDecoder.readArrayLength();
|
long sz = cborDecoder.readArrayLength();
|
||||||
assert(sz==2);
|
if (!(sz==2)) throw new IOException("Invalid FTR structure: sz==2");
|
||||||
cborDecoder.readInt(); // uncompressed size
|
cborDecoder.readInt(); // uncompressed size
|
||||||
parseDir(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(cborDecoder.readByteString()))));
|
parseDir(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(cborDecoder.readByteString()))));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 12: { //tx chunk uncompressed
|
case 12: { //tx chunk uncompressed
|
||||||
long len = cborDecoder.readArrayLength();
|
long len = cborDecoder.readArrayLength();
|
||||||
assert(len==4);
|
if (!(len==4)) throw new IOException("Invalid FTR structure: len==4");
|
||||||
long stream_id = cborDecoder.readInt();
|
long stream_id = cborDecoder.readInt();
|
||||||
cborDecoder.readInt(); // start time of block
|
cborDecoder.readInt(); // start time of block
|
||||||
long end_time = cborDecoder.readInt()*time_scale_factor;
|
long end_time = cborDecoder.readInt()*time_scale_factor;
|
||||||
@@ -443,7 +446,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
case 13: { //tx chunk compressed
|
case 13: { //tx chunk compressed
|
||||||
long len = cborDecoder.readArrayLength();
|
long len = cborDecoder.readArrayLength();
|
||||||
assert(len==5);
|
if (!(len==5)) throw new IOException("Invalid FTR structure: len==5");
|
||||||
long stream_id = cborDecoder.readInt();
|
long stream_id = cborDecoder.readInt();
|
||||||
cborDecoder.readInt(); // start time of block
|
cborDecoder.readInt(); // start time of block
|
||||||
long end_time = cborDecoder.readInt()*time_scale_factor;
|
long end_time = cborDecoder.readInt()*time_scale_factor;
|
||||||
@@ -459,7 +462,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
case 15: { // relations uncompressed
|
case 15: { // relations uncompressed
|
||||||
long sz = cborDecoder.readArrayLength();
|
long sz = cborDecoder.readArrayLength();
|
||||||
assert(sz==2);
|
if (!(sz==2)) throw new IOException("Invalid FTR structure: sz==2");
|
||||||
cborDecoder.readInt(); // uncompressed size
|
cborDecoder.readInt(); // uncompressed size
|
||||||
parseRel(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(cborDecoder.readByteString()))));
|
parseRel(new CborDecoder(new BlockLZ4CompressorInputStream(new ByteArrayInputStream(cborDecoder.readByteString()))));
|
||||||
break;
|
break;
|
||||||
@@ -467,11 +470,6 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
}
|
}
|
||||||
next = cborDecoder.peekType();
|
next = cborDecoder.peekType();
|
||||||
}
|
}
|
||||||
} catch(IOException e) {
|
|
||||||
long pos = 0;
|
|
||||||
try {pos=channel.position(); } catch (Exception ee) {}
|
|
||||||
LOG.error("Error parsing file input stream at position" + pos, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseDict(CborDecoder cborDecoder) throws IOException {
|
private void parseDict(CborDecoder cborDecoder) throws IOException {
|
||||||
@@ -479,7 +477,7 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
ArrayList<String> lst = new ArrayList<>((int)size);
|
ArrayList<String> lst = new ArrayList<>((int)size);
|
||||||
for(long i = 0; i<size; ++i) {
|
for(long i = 0; i<size; ++i) {
|
||||||
long idx = cborDecoder.readInt();
|
long idx = cborDecoder.readInt();
|
||||||
assert(idx==strDict.size()+lst.size());
|
if (!(idx==strDict.size()+lst.size())) throw new IOException("Invalid FTR structure: idx==strDict.size()+lst.size()");
|
||||||
lst.add(cborDecoder.readTextString());
|
lst.add(cborDecoder.readTextString());
|
||||||
}
|
}
|
||||||
strDict.addAll(lst);
|
strDict.addAll(lst);
|
||||||
@@ -503,14 +501,14 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
long id = cborDecoder.readTag();
|
long id = cborDecoder.readTag();
|
||||||
if(id==16) { // a stream
|
if(id==16) { // a stream
|
||||||
long len = cborDecoder.readArrayLength();
|
long len = cborDecoder.readArrayLength();
|
||||||
assert(len==3);
|
if (!(len==3)) throw new IOException("Invalid FTR structure: len==3");
|
||||||
long stream_id = cborDecoder.readInt();
|
long stream_id = cborDecoder.readInt();
|
||||||
long name_id = cborDecoder.readInt();
|
long name_id = cborDecoder.readInt();
|
||||||
long kind_id = cborDecoder.readInt();
|
long kind_id = cborDecoder.readInt();
|
||||||
add(stream_id, new TxStream(this, stream_id, strDict.get((int)name_id), strDict.get((int)kind_id)));
|
add(stream_id, new TxStream(this, stream_id, strDict.get((int)name_id), strDict.get((int)kind_id)));
|
||||||
} else if(id==17) { // a generator
|
} else if(id==17) { // a generator
|
||||||
long len = cborDecoder.readArrayLength();
|
long len = cborDecoder.readArrayLength();
|
||||||
assert(len==3);
|
if (!(len==3)) throw new IOException("Invalid FTR structure: len==3");
|
||||||
long gen_id = cborDecoder.readInt();
|
long gen_id = cborDecoder.readInt();
|
||||||
long name_id = cborDecoder.readInt();
|
long name_id = cborDecoder.readInt();
|
||||||
long stream_id = cborDecoder.readInt();
|
long stream_id = cborDecoder.readInt();
|
||||||
@@ -523,18 +521,18 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
|||||||
|
|
||||||
private void parseRel(CborDecoder cborDecoder) throws IOException {
|
private void parseRel(CborDecoder cborDecoder) throws IOException {
|
||||||
long size = cborDecoder.readArrayLength();
|
long size = cborDecoder.readArrayLength();
|
||||||
assert(size==-1);
|
if (!(size==-1)) throw new IOException("Invalid FTR structure: size==-1");
|
||||||
CborType next = cborDecoder.peekType();
|
CborType next = cborDecoder.peekType();
|
||||||
while(next != null && !break_type.isEqualType(next)) {
|
while(next != null && !break_type.isEqualType(next)) {
|
||||||
long sz = cborDecoder.readArrayLength();
|
long sz = cborDecoder.readArrayLength();
|
||||||
assert(sz==5 || sz==3);
|
if (!(sz==5 || sz==3)) throw new IOException("Invalid FTR structure: sz==5 || sz==3");
|
||||||
long type_id = cborDecoder.readInt();
|
long type_id = cborDecoder.readInt();
|
||||||
long from_id = cborDecoder.readInt();
|
long from_id = cborDecoder.readInt();
|
||||||
long to_id = cborDecoder.readInt();
|
long to_id = cborDecoder.readInt();
|
||||||
long from_fiber = sz>3?cborDecoder.readInt():-1;
|
long from_fiber = sz>3?cborDecoder.readInt():-1;
|
||||||
long to_fiber = sz>3?cborDecoder.readInt():-1;
|
long to_fiber = sz>3?cborDecoder.readInt():-1;
|
||||||
String rel_name = strDict.get((int)type_id);
|
String rel_name = strDict.get((int)type_id);
|
||||||
FtrRelation ftrRel = new FtrRelation(relationTypes.getOrDefault(rel_name, RelationTypeFactory.create(rel_name)), from_id, to_id, from_fiber, to_fiber);
|
FtrRelation ftrRel = new FtrRelation(relationTypes.computeIfAbsent(rel_name, RelationTypeFactory::create), from_id, to_id, from_fiber, to_fiber);
|
||||||
relationsOut.put(from_id, ftrRel);
|
relationsOut.put(from_id, ftrRel);
|
||||||
relationsIn.put(to_id, ftrRel);
|
relationsIn.put(to_id, ftrRel);
|
||||||
next = cborDecoder.peekType();
|
next = cborDecoder.peekType();
|
||||||
|
|||||||
+8
-9
@@ -11,10 +11,10 @@
|
|||||||
package com.minres.scviewer.database.ftr;
|
package com.minres.scviewer.database.ftr;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.minres.scviewer.database.InputFormatException;
|
import com.minres.scviewer.database.InputFormatException;
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
import com.minres.scviewer.database.tx.ITxAttribute;
|
import com.minres.scviewer.database.tx.ITxAttribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +41,7 @@ class FtrTx implements Serializable {
|
|||||||
long endTime;
|
long endTime;
|
||||||
|
|
||||||
/** The attributes. */
|
/** The attributes. */
|
||||||
final List<ITxAttribute> attributes = new ArrayList<>();
|
private final LazyValue<List<ITxAttribute>> attributes = new LazyValue<>();
|
||||||
|
|
||||||
final long blockId;
|
final long blockId;
|
||||||
|
|
||||||
@@ -75,15 +75,14 @@ class FtrTx implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<ITxAttribute> getAttributes(FtrDbLoader loader) {
|
public List<ITxAttribute> getAttributes(FtrDbLoader loader) {
|
||||||
if(attributes.size()==0)
|
return attributes.get(() -> {
|
||||||
try {
|
try {
|
||||||
final TxStream stream = loader.txStreams.get(streamId);
|
TxStream stream = loader.txStreams.get(streamId);
|
||||||
final byte[] chunk = stream.getChunks().get((int)blockId);
|
byte[] chunk = stream.getChunks().get((int) blockId);
|
||||||
attributes.addAll(loader.parseAtrributes(chunk, blockOffset));
|
return List.copyOf(loader.parseAtrributes(chunk, blockOffset));
|
||||||
} catch (InputFormatException e) {
|
} catch (InputFormatException e) {
|
||||||
// TODO Auto-generated catch block
|
throw new IllegalStateException("Cannot read attributes for transaction " + id, e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
return attributes;
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,9 @@ class Tx implements ITx {
|
|||||||
|
|
||||||
private final long streamId;
|
private final long streamId;
|
||||||
|
|
||||||
|
private volatile int concurrencyIndxInStream = -1;
|
||||||
|
private volatile int concurrencyIdxInGen = -1;
|
||||||
|
|
||||||
/** The begin time. */
|
/** The begin time. */
|
||||||
long beginTime = -1;
|
long beginTime = -1;
|
||||||
|
|
||||||
@@ -175,6 +178,26 @@ class Tx implements ITx {
|
|||||||
return loader.txGenerators.get(generatorId);
|
return loader.txGenerators.get(generatorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getConcurrencyIndxInStream() {
|
||||||
|
if (concurrencyIndxInStream < 0) getStream().getRowCount();
|
||||||
|
return concurrencyIndxInStream;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getConcurrencyIdxInGen() {
|
||||||
|
if (concurrencyIdxInGen < 0) getGenerator().getRowCount();
|
||||||
|
return concurrencyIdxInGen;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setConcurrencyIndxInStream(int index) {
|
||||||
|
concurrencyIndxInStream = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setConcurrencyIdxInGen(int index) {
|
||||||
|
concurrencyIdxInGen = index;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the begin time.
|
* Gets the begin time.
|
||||||
*
|
*
|
||||||
|
|||||||
+6
-12
@@ -26,6 +26,8 @@ class TxEvent implements ITxEvent {
|
|||||||
/** The kind. */
|
/** The kind. */
|
||||||
final EventKind kind;
|
final EventKind kind;
|
||||||
|
|
||||||
|
private final WaveformType waveformType;
|
||||||
|
|
||||||
/** The transaction. */
|
/** The transaction. */
|
||||||
final long transaction;
|
final long transaction;
|
||||||
|
|
||||||
@@ -40,12 +42,14 @@ class TxEvent implements ITxEvent {
|
|||||||
* @param kind the kind
|
* @param kind the kind
|
||||||
* @param transaction the transaction
|
* @param transaction the transaction
|
||||||
* @param time the time
|
* @param time the time
|
||||||
|
* @param waveformType the type of the owning waveform
|
||||||
*/
|
*/
|
||||||
TxEvent(FtrDbLoader loader, EventKind kind, Long transaction, Long time) {
|
TxEvent(FtrDbLoader loader, EventKind kind, Long transaction, Long time, WaveformType waveformType) {
|
||||||
this.loader = loader;
|
this.loader = loader;
|
||||||
this.kind = kind;
|
this.kind = kind;
|
||||||
this.transaction = transaction;
|
this.transaction = transaction;
|
||||||
this.time = time;
|
this.time = time;
|
||||||
|
this.waveformType = waveformType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +60,7 @@ class TxEvent implements ITxEvent {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ITxEvent duplicate() throws CloneNotSupportedException {
|
public ITxEvent duplicate() throws CloneNotSupportedException {
|
||||||
return new TxEvent(loader, kind, transaction, time);
|
return new TxEvent(loader, kind, transaction, time, waveformType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,16 +73,6 @@ class TxEvent implements ITxEvent {
|
|||||||
return kind.toString() + "@" + time + " of tx #" + transaction;
|
return kind.toString() + "@" + time + " of tx #" + transaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type.
|
|
||||||
*
|
|
||||||
* @return the type
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public WaveformType getType() {
|
|
||||||
return WaveformType.TRANSACTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the kind.
|
* Gets the kind.
|
||||||
*
|
*
|
||||||
|
|||||||
+7
-17
@@ -10,14 +10,13 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database.ftr;
|
package com.minres.scviewer.database.ftr;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.minres.scviewer.database.DirectionType;
|
import com.minres.scviewer.database.DirectionType;
|
||||||
import com.minres.scviewer.database.IEventList;
|
import com.minres.scviewer.database.IEventList;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.InputFormatException;
|
import com.minres.scviewer.database.WaveformType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class TxGenerator.
|
* The Class TxGenerator.
|
||||||
@@ -47,6 +46,11 @@ class TxGenerator extends AbstractTxStream {
|
|||||||
stream.addChild(this);
|
stream.addChild(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WaveformType getType() {
|
||||||
|
return WaveformType.GENERATOR;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is same.
|
* Checks if is same.
|
||||||
*
|
*
|
||||||
@@ -65,21 +69,7 @@ class TxGenerator extends AbstractTxStream {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IEventList getEvents() {
|
public IEventList getEvents() {
|
||||||
if(events.size()==0) {
|
stream.loadStream();
|
||||||
try {
|
|
||||||
List<byte[]> chunks = stream.getChunks();
|
|
||||||
int blockid = 0;
|
|
||||||
for (byte[] bs : chunks) {
|
|
||||||
loader.parseTx(stream, blockid++, bs);
|
|
||||||
}
|
|
||||||
} catch (InputFormatException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return events;
|
return events;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
+44
-20
@@ -10,11 +10,11 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database.ftr;
|
package com.minres.scviewer.database.ftr;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
import com.minres.scviewer.database.RelationType;
|
import com.minres.scviewer.database.RelationType;
|
||||||
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;
|
||||||
@@ -82,7 +82,29 @@ class TxRelation implements ITxRelation {
|
|||||||
|
|
||||||
final long txId;
|
final long txId;
|
||||||
|
|
||||||
ITx tx = null;
|
private final LazyValue<ITx> resolved = new LazyValue<>();
|
||||||
|
|
||||||
|
private ITx resolve() {
|
||||||
|
return resolved.get(() -> {
|
||||||
|
ITx transaction = loader.getTransaction(txId);
|
||||||
|
if (transaction != null) return transaction;
|
||||||
|
TxStream stream = loader.txStreams.get(fiberId);
|
||||||
|
if (stream != null) {
|
||||||
|
stream.loadStream();
|
||||||
|
transaction = loader.getTransaction(txId);
|
||||||
|
} else if (fiberId < 0) {
|
||||||
|
// Older FTR relations do not record the endpoint stream.
|
||||||
|
for (TxStream candidate : loader.txStreams.values()) {
|
||||||
|
candidate.loadStream();
|
||||||
|
transaction = loader.getTransaction(txId);
|
||||||
|
if (transaction != null) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (transaction == null)
|
||||||
|
throw new IllegalStateException("Missing related transaction " + txId + " in stream " + fiberId);
|
||||||
|
return transaction;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public TxFacade(long fiberId, long txId) {
|
public TxFacade(long fiberId, long txId) {
|
||||||
this.fiberId = fiberId;
|
this.fiberId = fiberId;
|
||||||
@@ -91,7 +113,9 @@ class TxRelation implements ITxRelation {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ITx o) {
|
public int compareTo(ITx o) {
|
||||||
return tx==null?-1:tx.compareTo(o);
|
if (this == o) return 0;
|
||||||
|
int cmp = Long.compare(getBeginTime(), o.getBeginTime());
|
||||||
|
return cmp != 0 ? cmp : Long.compare(getId(), o.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -101,52 +125,52 @@ class TxRelation implements ITxRelation {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWaveform getStream() {
|
public IWaveform getStream() {
|
||||||
if(tx==null) {
|
return resolve().getStream();
|
||||||
TxStream fiber = loader.txStreams.get(fiberId);
|
|
||||||
fiber.loadStream();
|
|
||||||
tx = loader.getTransaction(txId);
|
|
||||||
return loader.txStreams.get(fiberId);
|
|
||||||
} else
|
|
||||||
return tx.getStream();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWaveform getGenerator() {
|
public IWaveform getGenerator() {
|
||||||
if(tx==null) {
|
return resolve().getGenerator();
|
||||||
loader.txStreams.get(fiberId).loadStream();
|
|
||||||
tx = loader.getTransaction(txId);
|
|
||||||
}
|
}
|
||||||
return tx.getGenerator();
|
|
||||||
|
@Override
|
||||||
|
public int getConcurrencyIndxInStream() {
|
||||||
|
return resolve().getConcurrencyIndxInStream();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getConcurrencyIdxInGen() {
|
||||||
|
return resolve().getConcurrencyIdxInGen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getBeginTime() {
|
public long getBeginTime() {
|
||||||
return tx==null?-1:tx.getBeginTime();
|
return resolve().getBeginTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getEndTime() {
|
public long getEndTime() {
|
||||||
return tx==null?-1:tx.getBeginTime();
|
return resolve().getEndTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ITxAttribute> getAttributes() {
|
public List<ITxAttribute> getAttributes() {
|
||||||
return tx==null?new ArrayList<>():tx.getAttributes();
|
return resolve().getAttributes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ITxRelation> getIncomingRelations() {
|
public Collection<ITxRelation> getIncomingRelations() {
|
||||||
return tx==null?new ArrayList<>():tx.getIncomingRelations();
|
return resolve().getIncomingRelations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ITxRelation> getOutgoingRelations() {
|
public Collection<ITxRelation> getOutgoingRelations() {
|
||||||
return tx==null?new ArrayList<>():tx.getOutgoingRelations();
|
return resolve().getOutgoingRelations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return tx==null?("tx#" + getId() + "[not available]"):tx.toString();
|
return "tx#" + txId + "[related transaction]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+20
-19
@@ -17,6 +17,7 @@ import java.util.List;
|
|||||||
import com.minres.scviewer.database.DirectionType;
|
import com.minres.scviewer.database.DirectionType;
|
||||||
import com.minres.scviewer.database.IEventList;
|
import com.minres.scviewer.database.IEventList;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
import com.minres.scviewer.database.InputFormatException;
|
import com.minres.scviewer.database.InputFormatException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +30,8 @@ class TxStream extends AbstractTxStream {
|
|||||||
|
|
||||||
final ArrayList<Long> fileOffsets = new ArrayList<>();
|
final ArrayList<Long> fileOffsets = new ArrayList<>();
|
||||||
|
|
||||||
final ArrayList<byte[]> chunks = new ArrayList<>();
|
private final LazyValue<List<byte[]>> chunks = new LazyValue<>();
|
||||||
|
private final LazyValue<Boolean> parsed = new LazyValue<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new tx stream.
|
* Instantiates a new tx stream.
|
||||||
@@ -66,34 +68,33 @@ class TxStream extends AbstractTxStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<byte[]> getChunks() throws InputFormatException {
|
public List<byte[]> getChunks() throws InputFormatException {
|
||||||
if(chunks.size()==0) {
|
return chunks.get(() -> {
|
||||||
chunks.addAll(loader.getChunksAtOffsets(fileOffsets));
|
try {
|
||||||
|
return List.copyOf(loader.getChunksAtOffsets(fileOffsets));
|
||||||
|
} catch (InputFormatException e) {
|
||||||
|
throw new IllegalStateException("Cannot read stream " + getFullName(), e);
|
||||||
}
|
}
|
||||||
return chunks;
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadStream() {
|
public void loadStream() {
|
||||||
|
parsed.get(() -> {
|
||||||
try {
|
try {
|
||||||
List<byte[]> chunks = getChunks();
|
int blockId = 0;
|
||||||
int blockid = 0;
|
for (byte[] chunk : getChunks()) loader.parseTx(this, blockId++, chunk);
|
||||||
for (byte[] bs : chunks) {
|
finishEvents();
|
||||||
loader.parseTx(this, blockid, bs);
|
for (com.minres.scviewer.database.IHierNode child : getChildNodes())
|
||||||
blockid++;
|
((TxGenerator) child).finishEvents();
|
||||||
|
return Boolean.TRUE;
|
||||||
|
} catch (InputFormatException | IOException e) {
|
||||||
|
throw new IllegalStateException("Cannot parse stream " + getFullName(), e);
|
||||||
}
|
}
|
||||||
} catch (InputFormatException e) {
|
});
|
||||||
} catch (IOException e) {
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Gets the events.
|
|
||||||
*
|
|
||||||
* @return the events
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IEventList getEvents() {
|
public IEventList getEvents() {
|
||||||
if(events.size()==0) {
|
|
||||||
loadStream();
|
loadStream();
|
||||||
}
|
|
||||||
return events;
|
return events;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" output="target/classes" path="src">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry exported="true" kind="lib" path="sqlite-jdbc-3.8.7.jar"/>
|
<classpathentry exported="true" kind="lib" path="sqlite-jdbc-3.8.7.jar"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
@@ -36,4 +36,15 @@
|
|||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997703</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||||
org.eclipse.jdt.core.compiler.compliance=11
|
org.eclipse.jdt.core.compiler.compliance=17
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=11
|
org.eclipse.jdt.core.compiler.source=17
|
||||||
@@ -4,7 +4,7 @@ Bundle-Name: SQLite transaction database
|
|||||||
Bundle-SymbolicName: com.minres.scviewer.database.sqlite
|
Bundle-SymbolicName: com.minres.scviewer.database.sqlite
|
||||||
Bundle-Version: 1.1.0.qualifier
|
Bundle-Version: 1.1.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0"
|
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0"
|
||||||
Bundle-ClassPath: .,sqlite-jdbc-3.8.7.jar
|
Bundle-ClassPath: .,sqlite-jdbc-3.8.7.jar
|
||||||
Service-Component: OSGI-INF/component.xml
|
Service-Component: OSGI-INF/component.xml
|
||||||
@@ -13,3 +13,6 @@ Embed-Dependency: sqlite-jdbc
|
|||||||
Embedded-Artifacts: sqlite-jdbc-3.8.7.jar;g="org.xerial";
|
Embedded-Artifacts: sqlite-jdbc-3.8.7.jar;g="org.xerial";
|
||||||
a="sqlite-jdbc";v="3.8.7"
|
a="sqlite-jdbc";v="3.8.7"
|
||||||
Automatic-Module-Name: com.minres.scviewer.database.sqlite
|
Automatic-Module-Name: com.minres.scviewer.database.sqlite
|
||||||
|
Export-Package: com.minres.scviewer.database.sqlite;x-friends:="com.minres.scviewer.database.test",
|
||||||
|
com.minres.scviewer.database.sqlite.db;x-friends:="com.minres.scviewer.database.test",
|
||||||
|
com.minres.scviewer.database.sqlite.tables;x-friends:="com.minres.scviewer.database.test"
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|||||||
+43
-16
@@ -10,10 +10,12 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database.sqlite;
|
package com.minres.scviewer.database.sqlite;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
|
import com.minres.scviewer.database.tx.TransactionLists;
|
||||||
|
import com.minres.scviewer.database.tx.ITransactionProvider;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import com.minres.scviewer.database.EventEntry;
|
import com.minres.scviewer.database.EventEntry;
|
||||||
import com.minres.scviewer.database.EventKind;
|
import com.minres.scviewer.database.EventKind;
|
||||||
@@ -27,8 +29,21 @@ import com.minres.scviewer.database.RelationTypeFactory;
|
|||||||
import com.minres.scviewer.database.WaveformType;
|
import com.minres.scviewer.database.WaveformType;
|
||||||
import com.minres.scviewer.database.sqlite.db.IDatabase;
|
import com.minres.scviewer.database.sqlite.db.IDatabase;
|
||||||
import com.minres.scviewer.database.tx.ITx;
|
import com.minres.scviewer.database.tx.ITx;
|
||||||
|
import com.minres.scviewer.database.tx.TxRowAllocator;
|
||||||
|
|
||||||
abstract class AbstractTxStream extends HierNode implements IWaveform {
|
abstract class AbstractTxStream extends HierNode implements IWaveform, ITransactionProvider {
|
||||||
|
|
||||||
|
private final LazyValue<List<ITx>> transactionList = new LazyValue<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ITx> getTransactionList() {
|
||||||
|
return transactionList.get(() -> TransactionLists.sorted(getTransactions().values()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ITx getTransaction(long id) {
|
||||||
|
return id < Integer.MIN_VALUE || id > Integer.MAX_VALUE ? null : getTransactions().get((int) id);
|
||||||
|
}
|
||||||
|
|
||||||
protected IDatabase database;
|
protected IDatabase database;
|
||||||
|
|
||||||
@@ -47,7 +62,11 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRowCount() {
|
public synchronized int getRowCount() {
|
||||||
|
if (this instanceof TxGenerator) {
|
||||||
|
getEvents();
|
||||||
|
return maxConcurrency;
|
||||||
|
}
|
||||||
if(maxConcurrency==null){
|
if(maxConcurrency==null){
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("SELECT MAX(concurrencyLevel) as concurrencyLevel FROM ScvTx where stream=");
|
sb.append("SELECT MAX(concurrencyLevel) as concurrencyLevel FROM ScvTx where stream=");
|
||||||
@@ -77,21 +96,29 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEventList getEvents(){
|
public synchronized IEventList getEvents() {
|
||||||
if(events==null){
|
if (events == null) {
|
||||||
events=new EventList();
|
EventList.Builder builder = new EventList.Builder();
|
||||||
for(Entry<Integer, ITx> entry:getTransactions().entrySet()){
|
for (ITx tx : getTransactions().values()) {
|
||||||
putEvent(new TxEvent(EventKind.BEGIN, entry.getValue()));
|
if (tx.getBeginTime() == tx.getEndTime()) {
|
||||||
putEvent(new TxEvent(EventKind.END, entry.getValue()));
|
TxEvent single = new TxEvent(EventKind.SINGLE, tx, this instanceof TxGenerator);
|
||||||
|
builder.add(single.getTime(), single);
|
||||||
|
} else {
|
||||||
|
TxEvent begin = new TxEvent(EventKind.BEGIN, tx, this instanceof TxGenerator);
|
||||||
|
TxEvent end = new TxEvent(EventKind.END, tx, this instanceof TxGenerator);
|
||||||
|
builder.add(begin.getTime(), begin);
|
||||||
|
builder.add(end.getTime(), end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
IEventList loaded = builder.build();
|
||||||
|
if (this instanceof TxGenerator)
|
||||||
|
maxConcurrency = TxRowAllocator.assign(loaded,
|
||||||
|
(event, row) -> ((Tx) event.getTransaction()).setConcurrencyIdxInGen(row));
|
||||||
|
events = loaded;
|
||||||
|
}
|
||||||
return events;
|
return events;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void putEvent(TxEvent ev){
|
|
||||||
events.put(ev.getTime(), ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract Map<Integer, ITx> getTransactions();
|
protected abstract Map<Integer, ITx> getTransactions();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -111,16 +138,16 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEvent[] getEventsBeforeTime(long time) {
|
public IEvent[] getEventsBeforeTime(long time) {
|
||||||
EventEntry e = events.floorEntry(time);
|
EventEntry e = getEvents().floorEntry(time);
|
||||||
if(e==null)
|
if(e==null)
|
||||||
return new IEvent[]{};
|
return new IEvent[]{};
|
||||||
else
|
else
|
||||||
return events.floorEntry(time).events;
|
return e.events;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WaveformType getType() {
|
public WaveformType getType() {
|
||||||
return WaveformType.TRANSACTION;
|
return WaveformType.STREAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+19
-32
@@ -17,14 +17,12 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.minres.scviewer.database.AssociationType;
|
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.sqlite.db.IDatabase;
|
import com.minres.scviewer.database.sqlite.db.IDatabase;
|
||||||
import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler;
|
import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler;
|
||||||
import com.minres.scviewer.database.sqlite.tables.ScvStream;
|
import com.minres.scviewer.database.sqlite.tables.ScvStream;
|
||||||
import com.minres.scviewer.database.sqlite.tables.ScvTx;
|
import com.minres.scviewer.database.sqlite.tables.ScvTx;
|
||||||
import com.minres.scviewer.database.sqlite.tables.ScvTxAttribute;
|
import com.minres.scviewer.database.sqlite.tables.ScvTxAttribute;
|
||||||
import com.minres.scviewer.database.sqlite.tables.ScvTxEvent;
|
|
||||||
import com.minres.scviewer.database.sqlite.tables.ScvTxRelation;
|
import com.minres.scviewer.database.sqlite.tables.ScvTxRelation;
|
||||||
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;
|
||||||
@@ -36,9 +34,10 @@ public class Tx implements ITx {
|
|||||||
private TxStream trStream;
|
private TxStream trStream;
|
||||||
private TxGenerator trGenerator;
|
private TxGenerator trGenerator;
|
||||||
private ScvTx scvTx;
|
private ScvTx scvTx;
|
||||||
|
private volatile int concurrencyIdxInGen = -1;
|
||||||
private List<ITxAttribute> attributes;
|
private List<ITxAttribute> attributes;
|
||||||
private long begin=-1;
|
private final long begin;
|
||||||
private long end=-1;
|
private final long end;
|
||||||
private List<ITxRelation> incoming;
|
private List<ITxRelation> incoming;
|
||||||
private List<ITxRelation> outgoing;
|
private List<ITxRelation> outgoing;
|
||||||
|
|
||||||
@@ -47,6 +46,9 @@ public class Tx implements ITx {
|
|||||||
this.trStream=trStream;
|
this.trStream=trStream;
|
||||||
this.trGenerator=trGenerator;
|
this.trGenerator=trGenerator;
|
||||||
this.scvTx=scvTx;
|
this.scvTx=scvTx;
|
||||||
|
long[] times = trStream.getTransactionTimes(scvTx.getId());
|
||||||
|
begin = times[0];
|
||||||
|
end = times[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,44 +66,29 @@ public class Tx implements ITx {
|
|||||||
return trGenerator;
|
return trGenerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getConcurrencyIndex() {
|
@Override
|
||||||
|
public int getConcurrencyIndxInStream() {
|
||||||
return scvTx.getConcurrencyLevel();
|
return scvTx.getConcurrencyLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getBeginTime() {
|
public int getConcurrencyIdxInGen() {
|
||||||
if(begin<0){
|
if (concurrencyIdxInGen < 0) trGenerator.getRowCount();
|
||||||
SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class,
|
return concurrencyIdxInGen;
|
||||||
database, "tx="+scvTx.getId()+" AND type="+ AssociationType.BEGIN.ordinal());
|
|
||||||
try {
|
|
||||||
for(ScvTxEvent scvEvent:handler.selectObjects()){
|
|
||||||
begin= scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION");
|
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
|
||||||
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
void setConcurrencyIdxInGen(int index) {
|
||||||
}
|
concurrencyIdxInGen = index;
|
||||||
}
|
|
||||||
return begin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getEndTime() {
|
public long getBeginTime() { return begin; }
|
||||||
if(end<0){
|
|
||||||
SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class,
|
|
||||||
database, "tx="+scvTx.getId()+" AND type="+ AssociationType.END.ordinal());
|
|
||||||
try {
|
|
||||||
for(ScvTxEvent scvEvent:handler.selectObjects()){
|
|
||||||
end = scvEvent.getTime()*(Long)database.getData("TIMERESOLUTION");
|
|
||||||
}
|
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
|
||||||
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return end;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ITxAttribute> getAttributes() {
|
public long getEndTime() { return end; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized List<ITxAttribute> getAttributes() {
|
||||||
if(attributes==null){
|
if(attributes==null){
|
||||||
SQLiteDatabaseSelectHandler<ScvTxAttribute> handler = new SQLiteDatabaseSelectHandler<>(
|
SQLiteDatabaseSelectHandler<ScvTxAttribute> handler = new SQLiteDatabaseSelectHandler<>(
|
||||||
ScvTxAttribute.class, database, "tx="+scvTx.getId());
|
ScvTxAttribute.class, database, "tx="+scvTx.getId());
|
||||||
|
|||||||
+8
-8
@@ -19,12 +19,17 @@ import com.minres.scviewer.database.tx.ITxEvent;
|
|||||||
public class TxEvent implements ITxEvent {
|
public class TxEvent implements ITxEvent {
|
||||||
|
|
||||||
private final EventKind type;
|
private final EventKind type;
|
||||||
|
private final boolean inGenerator;
|
||||||
private ITx tx;
|
private ITx tx;
|
||||||
|
|
||||||
public TxEvent(EventKind type, ITx tx) {
|
public TxEvent(EventKind type, ITx tx) {
|
||||||
super();
|
this(type, tx, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TxEvent(EventKind type, ITx tx, boolean inGenerator) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.tx = tx;
|
this.tx = tx;
|
||||||
|
this.inGenerator = inGenerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -34,7 +39,7 @@ public class TxEvent implements ITxEvent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEvent duplicate() throws CloneNotSupportedException {
|
public IEvent duplicate() throws CloneNotSupportedException {
|
||||||
return new TxEvent(type, tx);
|
return new TxEvent(type, tx, inGenerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -52,14 +57,9 @@ public class TxEvent implements ITxEvent {
|
|||||||
return type.toString()+"@"+getTime()+" of tx #"+tx.getId();
|
return type.toString()+"@"+getTime()+" of tx #"+tx.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public WaveformType getType() {
|
|
||||||
return WaveformType.TRANSACTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRowIndex() {
|
public int getRowIndex() {
|
||||||
return ((Tx)tx).getConcurrencyIndex();
|
return inGenerator ? tx.getConcurrencyIdxInGen() : tx.getConcurrencyIndxInStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+12
-13
@@ -18,6 +18,7 @@ import java.util.TreeMap;
|
|||||||
|
|
||||||
import com.minres.scviewer.database.DirectionType;
|
import com.minres.scviewer.database.DirectionType;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
|
import com.minres.scviewer.database.WaveformType;
|
||||||
import com.minres.scviewer.database.sqlite.db.IDatabase;
|
import com.minres.scviewer.database.sqlite.db.IDatabase;
|
||||||
import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler;
|
import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler;
|
||||||
import com.minres.scviewer.database.sqlite.tables.ScvGenerator;
|
import com.minres.scviewer.database.sqlite.tables.ScvGenerator;
|
||||||
@@ -39,6 +40,11 @@ public class TxGenerator extends AbstractTxStream {
|
|||||||
stream.addChild(this);
|
stream.addChild(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WaveformType getType() {
|
||||||
|
return WaveformType.GENERATOR;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getId() {
|
public long getId() {
|
||||||
return (long) scvGenerator.getId();
|
return (long) scvGenerator.getId();
|
||||||
@@ -60,19 +66,12 @@ public class TxGenerator extends AbstractTxStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<Integer, ITx> getTransactions() {
|
protected synchronized Map<Integer, ITx> getTransactions() {
|
||||||
if(transactions==null){
|
if (transactions == null) {
|
||||||
transactions = new TreeMap<>();
|
TreeMap<Integer, ITx> loaded = new TreeMap<>();
|
||||||
SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<>(ScvTx.class, database,
|
for (Map.Entry<Integer, ITx> entry : stream.getTransactions().entrySet())
|
||||||
"stream="+stream.getId()+" and generator="+scvGenerator.getId());
|
if (entry.getValue().getGenerator() == this) loaded.put(entry.getKey(), entry.getValue());
|
||||||
try {
|
transactions = loaded;
|
||||||
for(ScvTx scvTx:handler.selectObjects()){
|
|
||||||
transactions.put(scvTx.getId(), new Tx(database, (TxStream) stream, this, scvTx));
|
|
||||||
}
|
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
|
||||||
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return transactions;
|
return transactions;
|
||||||
}
|
}
|
||||||
|
|||||||
+56
-19
@@ -17,6 +17,12 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import com.minres.scviewer.database.AssociationType;
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
|
|
||||||
import com.minres.scviewer.database.DirectionType;
|
import com.minres.scviewer.database.DirectionType;
|
||||||
import com.minres.scviewer.database.IEvent;
|
import com.minres.scviewer.database.IEvent;
|
||||||
@@ -36,7 +42,39 @@ public class TxStream extends AbstractTxStream {
|
|||||||
|
|
||||||
private TreeMap<Integer, TxGenerator> generators;
|
private TreeMap<Integer, TxGenerator> generators;
|
||||||
|
|
||||||
private TreeMap<Integer, ITx> transactions;
|
private final LazyValue<Map<Integer, ITx>> transactions = new LazyValue<>();
|
||||||
|
private final LazyValue<Map<Integer, long[]>> transactionTimes = new LazyValue<>();
|
||||||
|
|
||||||
|
long[] getTransactionTimes(int id) {
|
||||||
|
Map<Integer, long[]> times = transactionTimes.get(() -> {
|
||||||
|
String sql = "SELECT e.tx, MIN(CASE WHEN e.type=? THEN e.time END) AS beginTime, "
|
||||||
|
+ "MAX(CASE WHEN e.type=? THEN e.time END) AS endTime "
|
||||||
|
+ "FROM ScvTxEvent e JOIN ScvTx t ON t.id=e.tx WHERE t.stream=? GROUP BY e.tx";
|
||||||
|
Map<Integer, long[]> loaded = new HashMap<>();
|
||||||
|
long scale = ((Number) database.getData("TIMERESOLUTION")).longValue();
|
||||||
|
try (Connection connection = database.createConnection();
|
||||||
|
PreparedStatement statement = connection.prepareStatement(sql)) {
|
||||||
|
statement.setInt(1, AssociationType.BEGIN.ordinal());
|
||||||
|
statement.setInt(2, AssociationType.END.ordinal());
|
||||||
|
statement.setLong(3, getId());
|
||||||
|
try (ResultSet rows = statement.executeQuery()) {
|
||||||
|
while (rows.next()) {
|
||||||
|
if (rows.getObject("beginTime") == null || rows.getObject("endTime") == null)
|
||||||
|
throw new SQLException("Missing timestamps for transaction " + rows.getInt("tx"));
|
||||||
|
loaded.put(rows.getInt("tx"), new long[] {
|
||||||
|
Math.multiplyExact(rows.getLong("beginTime"), scale),
|
||||||
|
Math.multiplyExact(rows.getLong("endTime"), scale)});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new IllegalStateException("Cannot load timestamps for stream " + getFullName(), e);
|
||||||
|
}
|
||||||
|
return loaded;
|
||||||
|
});
|
||||||
|
long[] result = times.get(id);
|
||||||
|
if (result == null) throw new IllegalStateException("Missing timestamps for transaction " + id);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public TxStream(IDatabase database, ScvStream scvStream) {
|
public TxStream(IDatabase database, ScvStream scvStream) {
|
||||||
super(database, scvStream.getName(), scvStream.getId());
|
super(database, scvStream.getName(), scvStream.getId());
|
||||||
@@ -54,39 +92,38 @@ public class TxStream extends AbstractTxStream {
|
|||||||
return (long) scvStream.getId();
|
return (long) scvStream.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IWaveform> getGenerators() {
|
public synchronized List<IWaveform> getGenerators() {
|
||||||
if(generators==null){
|
if(generators==null){
|
||||||
SQLiteDatabaseSelectHandler<ScvGenerator> handler = new SQLiteDatabaseSelectHandler<>(
|
SQLiteDatabaseSelectHandler<ScvGenerator> handler = new SQLiteDatabaseSelectHandler<>(
|
||||||
ScvGenerator.class, database, "stream="+scvStream.getId());
|
ScvGenerator.class, database, "stream="+scvStream.getId());
|
||||||
generators=new TreeMap<>();
|
TreeMap<Integer, TxGenerator> loaded = new TreeMap<>();
|
||||||
try {
|
try {
|
||||||
for(ScvGenerator scvGenerator:handler.selectObjects()){
|
for(ScvGenerator scvGenerator:handler.selectObjects()){
|
||||||
generators.put(scvGenerator.getId(), new TxGenerator(database, this, scvGenerator));
|
loaded.put(scvGenerator.getId(), new TxGenerator(database, this, scvGenerator));
|
||||||
}
|
}
|
||||||
|
generators = loaded;
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
||||||
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
||||||
e.printStackTrace();
|
throw new IllegalStateException("Cannot load generators for " + getFullName(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ArrayList<>(generators.values());
|
return new ArrayList<>(generators.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Map<Integer, ITx> getTransactions() {
|
protected synchronized Map<Integer, ITx> getTransactions() {
|
||||||
if(transactions==null){
|
return transactions.get(() -> {
|
||||||
if(generators==null) getGenerators();
|
if (generators == null) getGenerators();
|
||||||
transactions = new TreeMap<>();
|
TreeMap<Integer, ITx> loaded = new TreeMap<>();
|
||||||
SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<>(ScvTx.class, database,
|
SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<>(ScvTx.class,
|
||||||
"stream="+scvStream.getId());
|
database, "stream=" + scvStream.getId());
|
||||||
try {
|
try {
|
||||||
for(ScvTx scvTx:handler.selectObjects()){
|
for (ScvTx row : handler.selectObjects())
|
||||||
transactions.put(scvTx.getId(), new Tx(database, this, generators.get(scvTx.getGenerator()), scvTx));
|
loaded.put(row.getId(), new Tx(database, this, generators.get(row.getGenerator()), row));
|
||||||
|
} catch (ReflectiveOperationException | SQLException | IntrospectionException e) {
|
||||||
|
throw new IllegalStateException("Cannot load transactions for " + getFullName(), e);
|
||||||
}
|
}
|
||||||
} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException
|
return loaded;
|
||||||
| InvocationTargetException | SQLException | IntrospectionException | NoSuchMethodException e) {
|
});
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return transactions;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src/"/>
|
<classpathentry kind="src" output="target/classes" path="src">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry exported="true" kind="lib" path="lib/mapdb-3.0.7.jar" sourcepath="lib/mapdb-3.0.7-sources.jar">
|
<classpathentry exported="true" kind="lib" path="lib/mapdb-3.0.7.jar" sourcepath="lib/mapdb-3.0.7-sources.jar">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="javadoc_location" value="jar:platform:/resource/com.minres.scviewer.database.text/lib/mapdb-3.0.7-javadoc.jar!/"/>
|
<attribute name="javadoc_location" value="jar:platform:/resource/com.minres.scviewer.database.text/lib/mapdb-3.0.7-javadoc.jar!/"/>
|
||||||
@@ -11,5 +20,10 @@
|
|||||||
<classpathentry exported="true" kind="lib" path="lib/kotlin-stdlib-1.2.42.jar"/>
|
<classpathentry exported="true" kind="lib" path="lib/kotlin-stdlib-1.2.42.jar"/>
|
||||||
<classpathentry exported="true" kind="lib" path="lib/lz4-1.3.0.jar"/>
|
<classpathentry exported="true" kind="lib" path="lib/lz4-1.3.0.jar"/>
|
||||||
<classpathentry exported="true" kind="lib" path="lib/elsa-3.0.0-M5.jar"/>
|
<classpathentry exported="true" kind="lib" path="lib/elsa-3.0.0-M5.jar"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
@@ -36,4 +36,15 @@
|
|||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997711</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||||
org.eclipse.jdt.core.compiler.compliance=11
|
org.eclipse.jdt.core.compiler.compliance=17
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=11
|
org.eclipse.jdt.core.compiler.source=17
|
||||||
@@ -4,7 +4,7 @@ Bundle-Name: Textual transaction database
|
|||||||
Bundle-SymbolicName: com.minres.scviewer.database.text
|
Bundle-SymbolicName: com.minres.scviewer.database.text
|
||||||
Bundle-Version: 4.0.1.qualifier
|
Bundle-Version: 4.0.1.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
Import-Package: org.osgi.framework;version="1.3.0"
|
Import-Package: org.osgi.framework;version="1.3.0"
|
||||||
Require-Bundle: com.minres.scviewer.database,
|
Require-Bundle: com.minres.scviewer.database,
|
||||||
org.eclipse.osgi.services;bundle-version="3.4.0",
|
org.eclipse.osgi.services;bundle-version="3.4.0",
|
||||||
@@ -19,3 +19,4 @@ Bundle-ClassPath: .,
|
|||||||
lib/kotlin-stdlib-1.2.42.jar,
|
lib/kotlin-stdlib-1.2.42.jar,
|
||||||
lib/lz4-1.3.0.jar,
|
lib/lz4-1.3.0.jar,
|
||||||
lib/elsa-3.0.0-M5.jar
|
lib/elsa-3.0.0-M5.jar
|
||||||
|
Export-Package: com.minres.scviewer.database.text;x-friends:="com.minres.scviewer.database.test"
|
||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|||||||
+44
-46
@@ -11,9 +11,12 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database.text;
|
package com.minres.scviewer.database.text;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.minres.scviewer.database.LazyValue;
|
||||||
|
import com.minres.scviewer.database.tx.ITx;
|
||||||
|
import com.minres.scviewer.database.tx.TransactionLists;
|
||||||
|
import com.minres.scviewer.database.tx.ITransactionProvider;
|
||||||
import com.minres.scviewer.database.EventEntry;
|
import com.minres.scviewer.database.EventEntry;
|
||||||
import com.minres.scviewer.database.EventList;
|
import com.minres.scviewer.database.EventList;
|
||||||
import com.minres.scviewer.database.HierNode;
|
import com.minres.scviewer.database.HierNode;
|
||||||
@@ -21,13 +24,28 @@ import com.minres.scviewer.database.IEvent;
|
|||||||
import com.minres.scviewer.database.IEventList;
|
import com.minres.scviewer.database.IEventList;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.WaveformType;
|
import com.minres.scviewer.database.WaveformType;
|
||||||
import com.minres.scviewer.database.tx.ITx;
|
import com.minres.scviewer.database.tx.TxRowAllocator;
|
||||||
import com.minres.scviewer.database.tx.ITxEvent;
|
import com.minres.scviewer.database.tx.ITxEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class AbstractTxStream.
|
* The Class AbstractTxStream.
|
||||||
*/
|
*/
|
||||||
abstract class AbstractTxStream extends HierNode implements IWaveform {
|
abstract class AbstractTxStream extends HierNode implements IWaveform, ITransactionProvider {
|
||||||
|
|
||||||
|
private final LazyValue<List<ITx>> transactionList = new LazyValue<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ITx> getTransactionList() {
|
||||||
|
return transactionList.get(() -> TransactionLists.fromEvents(getEvents(), () -> false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ITx getTransaction(long id) {
|
||||||
|
ITx transaction;
|
||||||
|
try { transaction = loader.getTransaction(id); }
|
||||||
|
catch (IllegalArgumentException missing) { return null; }
|
||||||
|
return transaction != null && (transaction.getStream() == this || transaction.getGenerator() == this) ? transaction : null;
|
||||||
|
}
|
||||||
|
|
||||||
private final String fullName;
|
private final String fullName;
|
||||||
|
|
||||||
@@ -39,6 +57,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
|
|
||||||
/** The events. */
|
/** The events. */
|
||||||
IEventList events = new EventList();
|
IEventList events = new EventList();
|
||||||
|
private EventList.Builder eventBuilder = new EventList.Builder();
|
||||||
|
|
||||||
/** The max concurrency. */
|
/** The max concurrency. */
|
||||||
private int rowCount = -1;
|
private int rowCount = -1;
|
||||||
@@ -72,7 +91,14 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
* @param evt the evt
|
* @param evt the evt
|
||||||
*/
|
*/
|
||||||
public void addEvent(ITxEvent evt) {
|
public void addEvent(ITxEvent evt) {
|
||||||
events.put(evt.getTime(), evt);
|
eventBuilder.add(evt.getTime(), evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void finishEvents() {
|
||||||
|
if (eventBuilder != null) {
|
||||||
|
events = eventBuilder.build();
|
||||||
|
eventBuilder = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,7 +144,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public WaveformType getType() {
|
public WaveformType getType() {
|
||||||
return WaveformType.TRANSACTION;
|
return WaveformType.STREAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,7 +163,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
* @return the width
|
* @return the width
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getRowCount() {
|
public synchronized int getRowCount() {
|
||||||
if (rowCount<0)
|
if (rowCount<0)
|
||||||
calculateConcurrency();
|
calculateConcurrency();
|
||||||
return rowCount;
|
return rowCount;
|
||||||
@@ -150,44 +176,16 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
|
|||||||
/**
|
/**
|
||||||
* Calculate concurrency.
|
* Calculate concurrency.
|
||||||
*/
|
*/
|
||||||
void calculateConcurrency() {
|
synchronized void calculateConcurrency() {
|
||||||
if (rowCount>=0)
|
if (rowCount >= 0) return;
|
||||||
return;
|
int count = TxRowAllocator.assign(getEvents(), (event, row) -> {
|
||||||
ArrayList<Long> rowEndTime = new ArrayList<>();
|
((TxEvent) event).setConcurrencyIndex(row);
|
||||||
HashMap<Long, Integer> rowByTxId = new HashMap<>();
|
Tx tx = (Tx) event.getTransaction();
|
||||||
for(EventEntry entry: events) {
|
if (this instanceof TxGenerator) tx.setConcurrencyIdxInGen(row);
|
||||||
for(IEvent evt:entry.events) {
|
else tx.setConcurrencyIndxInStream(row);
|
||||||
TxEvent txEvt = (TxEvent) evt;
|
});
|
||||||
ITx tx = txEvt.getTransaction();
|
for (com.minres.scviewer.database.IHierNode child : getChildNodes())
|
||||||
int rowIdx = 0;
|
((TxGenerator) child).calculateConcurrency();
|
||||||
switch(evt.getKind()) {
|
rowCount = count;
|
||||||
case END:
|
|
||||||
Long txId = txEvt.getTransaction().getId();
|
|
||||||
txEvt.setConcurrencyIndex(rowByTxId.get(txId));
|
|
||||||
rowByTxId.remove(txId);
|
|
||||||
break;
|
|
||||||
case SINGLE:
|
|
||||||
for (; rowIdx < rowEndTime.size() && rowEndTime.get(rowIdx)>tx.getBeginTime(); rowIdx++);
|
|
||||||
if (rowEndTime.size() <= rowIdx)
|
|
||||||
rowEndTime.add(tx.getEndTime());
|
|
||||||
else
|
|
||||||
rowEndTime.set(rowIdx, tx.getEndTime());
|
|
||||||
((TxEvent) evt).setConcurrencyIndex(rowIdx);
|
|
||||||
break;
|
|
||||||
case BEGIN:
|
|
||||||
for (; rowIdx < rowEndTime.size() && rowEndTime.get(rowIdx)>tx.getBeginTime(); rowIdx++);
|
|
||||||
if (rowEndTime.size() <= rowIdx)
|
|
||||||
rowEndTime.add(tx.getEndTime());
|
|
||||||
else
|
|
||||||
rowEndTime.set(rowIdx, tx.getEndTime());
|
|
||||||
((TxEvent) evt).setConcurrencyIndex(rowIdx);
|
|
||||||
rowByTxId.put(tx.getId(), rowIdx);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rowCount=rowEndTime.size()>0?rowEndTime.size():1;
|
|
||||||
//getChildNodes().parallelStream().forEach(c -> ((TxGenerator)c).calculateConcurrency());
|
|
||||||
getChildNodes().stream().forEach(c -> ((TxGenerator)c).calculateConcurrency());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+10
-7
@@ -144,7 +144,7 @@ public class TextDbLoader implements IWaveformDbLoader {
|
|||||||
* @param txId the tx id
|
* @param txId the tx id
|
||||||
* @return the transaction
|
* @return the transaction
|
||||||
*/
|
*/
|
||||||
public ITx getTransaction(long txId) {
|
public synchronized ITx getTransaction(long txId) {
|
||||||
if (txCache.containsKey(txId))
|
if (txCache.containsKey(txId))
|
||||||
return txCache.get(txId);
|
return txCache.get(txId);
|
||||||
if(transactions.containsKey(txId)) {
|
if(transactions.containsKey(txId)) {
|
||||||
@@ -252,6 +252,8 @@ public class TextDbLoader implements IWaveformDbLoader {
|
|||||||
} finally {
|
} finally {
|
||||||
transactions = parser.txSink;
|
transactions = parser.txSink;
|
||||||
}
|
}
|
||||||
|
txStreams.values().forEach(TxStream::finishEvents);
|
||||||
|
txGenerators.values().forEach(TxGenerator::finishEvents);
|
||||||
txStreams.values().parallelStream().forEach(TxStream::calculateConcurrency);
|
txStreams.values().parallelStream().forEach(TxStream::calculateConcurrency);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,6 +267,7 @@ public class TextDbLoader implements IWaveformDbLoader {
|
|||||||
txStreams.clear();
|
txStreams.clear();
|
||||||
txGenerators.clear();
|
txGenerators.clear();
|
||||||
transactions = null;
|
transactions = null;
|
||||||
|
txCache.clear();
|
||||||
attributeTypes.clear();
|
attributeTypes.clear();
|
||||||
relationsIn.clear();
|
relationsIn.clear();
|
||||||
relationsOut.clear();
|
relationsOut.clear();
|
||||||
@@ -418,13 +421,13 @@ public class TextDbLoader implements IWaveformDbLoader {
|
|||||||
TxGenerator gen = loader.txGenerators.get(scvTx.generatorId);
|
TxGenerator gen = loader.txGenerators.get(scvTx.generatorId);
|
||||||
TxStream stream = loader.txStreams.get(gen.stream.getId());
|
TxStream stream = loader.txStreams.get(gen.stream.getId());
|
||||||
if (scvTx.beginTime == scvTx.endTime) {
|
if (scvTx.beginTime == scvTx.endTime) {
|
||||||
stream.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
|
stream.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime, stream.getType()));
|
||||||
gen.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
|
gen.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime, gen.getType()));
|
||||||
} else {
|
} else {
|
||||||
stream.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
|
stream.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime, stream.getType()));
|
||||||
gen.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
|
gen.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime, gen.getType()));
|
||||||
stream.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
|
stream.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime, stream.getType()));
|
||||||
gen.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
|
gen.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime, gen.getType()));
|
||||||
}
|
}
|
||||||
if (nextLine != null && nextLine.charAt(0) == 'a') {
|
if (nextLine != null && nextLine.charAt(0) == 'a') {
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|||||||
+23
@@ -38,6 +38,9 @@ class Tx implements ITx {
|
|||||||
|
|
||||||
private final long streamId;
|
private final long streamId;
|
||||||
|
|
||||||
|
private volatile int concurrencyIndxInStream = -1;
|
||||||
|
private volatile int concurrencyIdxInGen = -1;
|
||||||
|
|
||||||
/** The begin time. */
|
/** The begin time. */
|
||||||
long beginTime = -1;
|
long beginTime = -1;
|
||||||
|
|
||||||
@@ -174,6 +177,26 @@ class Tx implements ITx {
|
|||||||
return loader.txGenerators.get(generatorId);
|
return loader.txGenerators.get(generatorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getConcurrencyIndxInStream() {
|
||||||
|
if (concurrencyIndxInStream < 0) getStream().getRowCount();
|
||||||
|
return concurrencyIndxInStream;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getConcurrencyIdxInGen() {
|
||||||
|
if (concurrencyIdxInGen < 0) getGenerator().getRowCount();
|
||||||
|
return concurrencyIdxInGen;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setConcurrencyIndxInStream(int index) {
|
||||||
|
concurrencyIndxInStream = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setConcurrencyIdxInGen(int index) {
|
||||||
|
concurrencyIdxInGen = index;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the begin time.
|
* Gets the begin time.
|
||||||
*
|
*
|
||||||
|
|||||||
+6
-12
@@ -26,6 +26,8 @@ class TxEvent implements ITxEvent {
|
|||||||
/** The kind. */
|
/** The kind. */
|
||||||
final EventKind kind;
|
final EventKind kind;
|
||||||
|
|
||||||
|
private final WaveformType waveformType;
|
||||||
|
|
||||||
/** The transaction. */
|
/** The transaction. */
|
||||||
final long transaction;
|
final long transaction;
|
||||||
|
|
||||||
@@ -40,12 +42,14 @@ class TxEvent implements ITxEvent {
|
|||||||
* @param kind the kind
|
* @param kind the kind
|
||||||
* @param transaction the transaction
|
* @param transaction the transaction
|
||||||
* @param time the time
|
* @param time the time
|
||||||
|
* @param waveformType the type of the owning waveform
|
||||||
*/
|
*/
|
||||||
TxEvent(TextDbLoader loader, EventKind kind, Long transaction, Long time) {
|
TxEvent(TextDbLoader loader, EventKind kind, Long transaction, Long time, WaveformType waveformType) {
|
||||||
this.loader = loader;
|
this.loader = loader;
|
||||||
this.kind = kind;
|
this.kind = kind;
|
||||||
this.transaction = transaction;
|
this.transaction = transaction;
|
||||||
this.time = time;
|
this.time = time;
|
||||||
|
this.waveformType = waveformType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +60,7 @@ class TxEvent implements ITxEvent {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ITxEvent duplicate() throws CloneNotSupportedException {
|
public ITxEvent duplicate() throws CloneNotSupportedException {
|
||||||
return new TxEvent(loader, kind, transaction, time);
|
return new TxEvent(loader, kind, transaction, time, waveformType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,16 +73,6 @@ class TxEvent implements ITxEvent {
|
|||||||
return kind.toString() + "@" + time + " of tx #" + transaction;
|
return kind.toString() + "@" + time + " of tx #" + transaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type.
|
|
||||||
*
|
|
||||||
* @return the type
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public WaveformType getType() {
|
|
||||||
return WaveformType.TRANSACTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the kind.
|
* Gets the kind.
|
||||||
*
|
*
|
||||||
|
|||||||
+6
@@ -16,6 +16,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.minres.scviewer.database.DirectionType;
|
import com.minres.scviewer.database.DirectionType;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
|
import com.minres.scviewer.database.WaveformType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class TxGenerator.
|
* The Class TxGenerator.
|
||||||
@@ -45,6 +46,11 @@ class TxGenerator extends AbstractTxStream {
|
|||||||
stream.addChild(this);
|
stream.addChild(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WaveformType getType() {
|
||||||
|
return WaveformType.GENERATOR;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is same.
|
* Checks if is same.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" output="target/classes" path="src">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
@@ -31,4 +31,15 @@
|
|||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997716</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -9,8 +9,8 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul
|
|||||||
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
|
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
|
||||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||||
org.eclipse.jdt.core.compiler.compliance=11
|
org.eclipse.jdt.core.compiler.compliance=17
|
||||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||||
@@ -29,7 +29,7 @@ org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
|||||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||||
@@ -101,4 +101,4 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
|||||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=11
|
org.eclipse.jdt.core.compiler.source=17
|
||||||
@@ -4,7 +4,7 @@ Bundle-Name: SWT database widget
|
|||||||
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
|
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
|
||||||
Bundle-Version: 4.0.0.qualifier
|
Bundle-Version: 4.0.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
|
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
|
||||||
com.minres.scviewer.database;bundle-version="1.0.0",
|
com.minres.scviewer.database;bundle-version="1.0.0",
|
||||||
com.google.guava;bundle-version="15.0.0",
|
com.google.guava;bundle-version="15.0.0",
|
||||||
|
|||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>4.0.0-SNAPSHOT</version>
|
<version>4.0.0-SNAPSHOT</version>
|
||||||
|
|||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package com.minres.scviewer.database.ui;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
|
import org.eclipse.jface.viewers.StructuredSelection;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.tx.ITx;
|
||||||
|
|
||||||
|
/** The selected transaction and tracks, with JFace conversion at the UI boundary. */
|
||||||
|
public record WaveformSelection(ITx transaction, List<TrackEntry> tracks) {
|
||||||
|
public WaveformSelection {
|
||||||
|
tracks = tracks.stream().filter(java.util.Objects::nonNull).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WaveformSelection from(ISelection selection) {
|
||||||
|
if (!(selection instanceof IStructuredSelection structured)) return new WaveformSelection(null, List.of());
|
||||||
|
ITx transaction = null;
|
||||||
|
List<TrackEntry> tracks = new ArrayList<>();
|
||||||
|
for (Object element : structured.toArray()) {
|
||||||
|
if (element instanceof ITx tx && transaction == null) transaction = tx;
|
||||||
|
if (element instanceof TrackEntry track) tracks.add(track);
|
||||||
|
}
|
||||||
|
return new WaveformSelection(transaction, tracks);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TrackEntry track() {
|
||||||
|
if (transaction == null) return tracks.isEmpty() ? null : tracks.get(0);
|
||||||
|
return tracks.stream().filter(t -> t.waveform == transaction.getStream()
|
||||||
|
|| t.waveform == transaction.getGenerator()).findFirst().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IStructuredSelection toSelection() {
|
||||||
|
List<Object> elements = new ArrayList<>();
|
||||||
|
if (transaction != null) elements.add(transaction);
|
||||||
|
TrackEntry primary = track();
|
||||||
|
if (primary != null) elements.add(primary);
|
||||||
|
for (TrackEntry track : tracks) if (track != primary) elements.add(track);
|
||||||
|
return new StructuredSelection(elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IStructuredSelection of(ITx transaction, TrackEntry track) {
|
||||||
|
return new WaveformSelection(transaction, track == null ? List.of() : List.of(track)).toSelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
+46
-33
@@ -41,9 +41,9 @@ public class ArrowPainter implements IPainter {
|
|||||||
|
|
||||||
private ITx tx;
|
private ITx tx;
|
||||||
|
|
||||||
private List<LinkEntry> iRect;
|
private List<LinkEntry> iRect = new LinkedList<>();
|
||||||
|
|
||||||
private List<LinkEntry> oRect;
|
private List<LinkEntry> oRect = new LinkedList<>();
|
||||||
|
|
||||||
private Rectangle txRectangle;
|
private Rectangle txRectangle;
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ public class ArrowPainter implements IPainter {
|
|||||||
public ArrowPainter(WaveformCanvas waveCanvas, RelationType relationType) {
|
public ArrowPainter(WaveformCanvas waveCanvas, RelationType relationType) {
|
||||||
this.waveCanvas = waveCanvas;
|
this.waveCanvas = waveCanvas;
|
||||||
highlightType=relationType;
|
highlightType=relationType;
|
||||||
setTx(null);
|
updateSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public RelationType getHighlightType() {
|
public RelationType getHighlightType() {
|
||||||
@@ -71,10 +71,8 @@ public class ArrowPainter implements IPainter {
|
|||||||
return tx;
|
return tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTx(ITx newTx) {
|
public void updateSelection() {
|
||||||
this.tx = newTx;
|
tx = waveCanvas.currentSelectedTx;
|
||||||
iRect = new LinkedList<>();
|
|
||||||
oRect = new LinkedList<>();
|
|
||||||
scaleFactor = waveCanvas.getScale();
|
scaleFactor = waveCanvas.getScale();
|
||||||
if (tx != null) {
|
if (tx != null) {
|
||||||
calculateGeometries();
|
calculateGeometries();
|
||||||
@@ -83,29 +81,40 @@ public class ArrowPainter implements IPainter {
|
|||||||
|
|
||||||
private int getConcurrencyIndex(ITx tx) {
|
private int getConcurrencyIndex(ITx tx) {
|
||||||
IEvent[] eventList = tx.getStream().getEventsBeforeTime(tx.getBeginTime());
|
IEvent[] eventList = tx.getStream().getEventsBeforeTime(tx.getBeginTime());
|
||||||
Optional<Integer> res = Arrays.stream(eventList).map(e -> ((ITxEvent)e).getRowIndex()).findFirst();
|
Optional<Integer> res = Arrays.stream(eventList).filter(e -> ((ITxEvent)e).getTransaction()== tx).map(e -> ((ITxEvent)e).getRowIndex()).findFirst();
|
||||||
if(res.isPresent() && res.get()>0) {
|
if(res.isPresent() && res.get()>0) {
|
||||||
return res.get();
|
return res.get();
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Rectangle getBoundingBox(IWaveformPainter painter, ITx itx, IWaveform stream) {
|
||||||
|
int laneHeight = painter.getHeight() / stream.getRowCount();
|
||||||
|
//TODO: it needs to take the concurrency index within the current waveform (stream or generator) into account
|
||||||
|
int concIdx=getConcurrencyIndex(itx);
|
||||||
|
int laneOffset = laneHeight * (concIdx>=stream.getRowCount()?stream.getRowCount()-1:concIdx);
|
||||||
|
int rulerHeight = waveCanvas.rulerHeight;
|
||||||
|
Rectangle bb = new Rectangle((int) (itx.getBeginTime() / scaleFactor),
|
||||||
|
rulerHeight + painter.getVerticalOffset() + laneOffset,
|
||||||
|
(int) ((itx.getEndTime() - itx.getBeginTime()) / scaleFactor), laneHeight);
|
||||||
|
return bb;
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean calculateGeometries() {
|
protected boolean calculateGeometries() {
|
||||||
iRect.clear();
|
iRect.clear();
|
||||||
oRect.clear();
|
oRect.clear();
|
||||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(tx.getStream());
|
IWaveformPainter painter = null;
|
||||||
|
if(waveCanvas.currentSelectedTrack != null)
|
||||||
|
painter = waveCanvas.trackAreaPainter.getPainterFor(waveCanvas.currentSelectedTrack);
|
||||||
if(painter == null)
|
if(painter == null)
|
||||||
painter = waveCanvas.wave2painterMap.get(tx.getGenerator());
|
painter = waveCanvas.wave2painterMap.get(tx.getGenerator());
|
||||||
if (painter == null) { // stream has been added but painter not yet
|
if(painter==null)
|
||||||
// created
|
painter = waveCanvas.wave2painterMap.get(tx.getStream());
|
||||||
|
if (painter == null) { // stream has been added but painter not yet created
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int laneHeight = painter.getHeight() / tx.getStream().getRowCount();
|
Rectangle bb = getBoundingBox(painter, tx, painter instanceof StreamPainter? ((StreamPainter)painter).getStream() : tx.getStream());
|
||||||
int laneOffset = laneHeight * getConcurrencyIndex(tx);
|
txRectangle = bb;
|
||||||
int rulerHeight = waveCanvas.rulerHeight;
|
|
||||||
txRectangle = new Rectangle((int) (tx.getBeginTime() / scaleFactor),
|
|
||||||
rulerHeight + painter.getVerticalOffset() + laneOffset,
|
|
||||||
(int) ((tx.getEndTime() - tx.getBeginTime()) / scaleFactor), laneHeight);
|
|
||||||
deriveGeom(tx.getIncomingRelations(), iRect, false);
|
deriveGeom(tx.getIncomingRelations(), iRect, false);
|
||||||
deriveGeom(tx.getOutgoingRelations(), oRect, true);
|
deriveGeom(tx.getOutgoingRelations(), oRect, true);
|
||||||
return false;
|
return false;
|
||||||
@@ -114,18 +123,14 @@ public class ArrowPainter implements IPainter {
|
|||||||
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) {
|
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) {
|
||||||
for (ITxRelation iTxRelation : relations) {
|
for (ITxRelation iTxRelation : relations) {
|
||||||
ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource();
|
ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource();
|
||||||
if(otherTx!=null && otherTx.getBeginTime()>=0)
|
if (otherTx != null && otherTx.getBeginTime() >= 0)
|
||||||
for(IWaveform iWaveform: new IWaveform[]{otherTx.getStream(), otherTx.getGenerator()}) {
|
for (IWaveform iWaveform : new IWaveform[] { otherTx.getStream(), otherTx.getGenerator() }) {
|
||||||
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
|
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
|
||||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform);
|
IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform);
|
||||||
if(painter!=null) {
|
if (painter != null) {
|
||||||
int laneHeight = waveCanvas.styleProvider.getTrackHeight();
|
Rectangle bb = getBoundingBox(painter, otherTx,
|
||||||
int laneOffset = laneHeight * getConcurrencyIndex(tx);
|
painter instanceof StreamPainter ? ((StreamPainter) painter).getStream()
|
||||||
Rectangle bb = new Rectangle(
|
: otherTx.getStream());
|
||||||
(int) (otherTx.getBeginTime() / scaleFactor),
|
|
||||||
waveCanvas.rulerHeight + painter.getVerticalOffset() + laneOffset,
|
|
||||||
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
|
|
||||||
laneHeight);
|
|
||||||
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,28 +165,36 @@ public class ArrowPainter implements IPainter {
|
|||||||
protected void drawArrow(Projection proj, Color fgColor, Rectangle srcRectangle, Rectangle tgtRectangle) {
|
protected void drawArrow(Projection proj, Color fgColor, Rectangle srcRectangle, Rectangle tgtRectangle) {
|
||||||
Point point1 = proj.project(new Point(srcRectangle.x, srcRectangle.y + srcRectangle.height / 2));
|
Point point1 = proj.project(new Point(srcRectangle.x, srcRectangle.y + srcRectangle.height / 2));
|
||||||
Point point2 = proj.project(new Point(tgtRectangle.x, tgtRectangle.y + tgtRectangle.height / 2));
|
Point point2 = proj.project(new Point(tgtRectangle.x, tgtRectangle.y + tgtRectangle.height / 2));
|
||||||
|
int arrowTipOffset=yCtrlOffset/2;
|
||||||
|
|
||||||
if (point2.x > point1.x + srcRectangle.width)
|
if (point2.x > point1.x + srcRectangle.width)
|
||||||
point1.x += srcRectangle.width;
|
point1.x += srcRectangle.width;
|
||||||
if (point1.x > point2.x + tgtRectangle.width)
|
if (point1.x > point2.x + tgtRectangle.width)
|
||||||
point2.x += tgtRectangle.width;
|
point2.x += tgtRectangle.width;
|
||||||
|
|
||||||
|
Point endPoint = new Point(point2.x-arrowTipOffset, point2.y);
|
||||||
Path path = new Path(Display.getCurrent());
|
Path path = new Path(Display.getCurrent());
|
||||||
path.moveTo(point1.x, point1.y);
|
path.moveTo(point1.x, point1.y);
|
||||||
if (point1.y == point2.y) {
|
if (point1.y == point2.y) {
|
||||||
Point center = new Point((point1.x + point2.x) / 2, point1.y - yCtrlOffset);
|
Point center = new Point((point1.x + endPoint.x) / 2, point1.y - yCtrlOffset);
|
||||||
path.cubicTo(point1.x + X_CTRL_OFFSET, point1.y, center.x - X_CTRL_OFFSET, center.y, center.x, center.y);
|
path.cubicTo(point1.x + X_CTRL_OFFSET, point1.y, center.x - X_CTRL_OFFSET, center.y, center.x, center.y);
|
||||||
path.cubicTo(center.x + X_CTRL_OFFSET, center.y, point2.x - X_CTRL_OFFSET, point2.y, point2.x, point2.y);
|
path.cubicTo(center.x + X_CTRL_OFFSET, center.y, endPoint.x - X_CTRL_OFFSET, endPoint.y, endPoint.x, endPoint.y);
|
||||||
} else
|
} else
|
||||||
path.cubicTo(point1.x + X_CTRL_OFFSET, point1.y, point2.x - X_CTRL_OFFSET, point2.y, point2.x, point2.y);
|
path.cubicTo(point1.x + X_CTRL_OFFSET, point1.y, endPoint.x - X_CTRL_OFFSET, endPoint.y, endPoint.x, endPoint.y);
|
||||||
|
path.lineTo(point2.x, point2.y);
|
||||||
proj.setAntialias(SWT.ON);
|
proj.setAntialias(SWT.ON);
|
||||||
proj.setForeground(fgColor);
|
proj.setForeground(fgColor);
|
||||||
proj.getGC().drawPath(path);
|
proj.getGC().drawPath(path);
|
||||||
path.dispose();
|
path.dispose();
|
||||||
// now draw the arrow head
|
// now draw the arrow head
|
||||||
proj.getGC().drawLine(point2.x - 8, point2.y - 5, point2.x, point2.y);
|
Color background = proj.getGC().getBackground();
|
||||||
proj.getGC().drawLine(point2.x - 8, point2.y + 5, point2.x, point2.y);
|
proj.setBackground(fgColor);
|
||||||
|
proj.getGC().fillPolygon(new int[] {
|
||||||
|
point2.x, point2.y,
|
||||||
|
point2.x - arrowTipOffset, point2.y - 3*arrowTipOffset/5,
|
||||||
|
point2.x - 3*arrowTipOffset/5, point2.y,
|
||||||
|
point2.x - arrowTipOffset, point2.y + 3*arrowTipOffset/5 });
|
||||||
|
proj.setBackground(background);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
@@ -106,11 +106,13 @@ public class SignalPainter extends TrackPainter {
|
|||||||
EventEntry first = signal.getEvents().floorEntry(beginTime);
|
EventEntry first = signal.getEvents().floorEntry(beginTime);
|
||||||
if (first == null)
|
if (first == null)
|
||||||
first = signal.getEvents().firstEntry();
|
first = signal.getEvents().firstEntry();
|
||||||
|
if (first == null || Long.compareUnsigned(first.timestamp, endTime) > 0) return;
|
||||||
beginTime = first.timestamp;
|
beginTime = first.timestamp;
|
||||||
proj.setForeground(this.waveCanvas.styleProvider.getColor(WaveformColors.LINE));
|
proj.setForeground(this.waveCanvas.styleProvider.getColor(WaveformColors.LINE));
|
||||||
proj.setLineStyle(SWT.LINE_SOLID);
|
proj.setLineStyle(SWT.LINE_SOLID);
|
||||||
proj.setLineWidth(1);
|
proj.setLineWidth(1);
|
||||||
IEventList entries = signal.getEvents().subMap(beginTime, true, endTime);
|
IEventList entries = signal.getEvents().subMap(beginTime, true, endTime);
|
||||||
|
if (entries.isEmpty()) return;
|
||||||
SignalChange left = new SignalChange(entries.firstEntry());
|
SignalChange left = new SignalChange(entries.firstEntry());
|
||||||
SignalChange right = new SignalChange(entries.size() > 1 ? entries.higherEntry(left.time) : entries.firstEntry());
|
SignalChange right = new SignalChange(entries.size() > 1 ? entries.higherEntry(left.time) : entries.firstEntry());
|
||||||
maxPosX = area.x + area.width;
|
maxPosX = area.x + area.width;
|
||||||
|
|||||||
+35
-50
@@ -10,20 +10,19 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database.ui.swt.internal;
|
package com.minres.scviewer.database.ui.swt.internal;
|
||||||
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.graphics.Color;
|
import org.eclipse.swt.graphics.Color;
|
||||||
import org.eclipse.swt.graphics.Point;
|
import org.eclipse.swt.graphics.Point;
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
|
|
||||||
import com.minres.scviewer.database.EventEntry;
|
|
||||||
import com.minres.scviewer.database.EventKind;
|
import com.minres.scviewer.database.EventKind;
|
||||||
import com.minres.scviewer.database.IEvent;
|
import com.minres.scviewer.database.IEvent;
|
||||||
import com.minres.scviewer.database.IEventList;
|
import com.minres.scviewer.database.IEventList;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.tx.ITx;
|
import com.minres.scviewer.database.tx.ITx;
|
||||||
import com.minres.scviewer.database.tx.ITxEvent;
|
import com.minres.scviewer.database.tx.ITxEvent;
|
||||||
|
import com.minres.scviewer.database.tx.TxIntervalIndex;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.WaveformColors;
|
import com.minres.scviewer.database.ui.WaveformColors;
|
||||||
|
|
||||||
@@ -36,14 +35,14 @@ public class StreamPainter extends TrackPainter{
|
|||||||
private IWaveform stream;
|
private IWaveform stream;
|
||||||
private int txBase;
|
private int txBase;
|
||||||
private int txHeight;
|
private int txHeight;
|
||||||
// TODO: remove TreeMap usage
|
private TxIntervalIndex intervalIndex;
|
||||||
private TreeMap<ITx, ITxEvent> seenTx;
|
private IEventList indexedEvents;
|
||||||
|
private int indexedSize = -1;
|
||||||
|
|
||||||
public StreamPainter(WaveformCanvas waveCanvas, boolean even, TrackEntry trackEntry) {
|
public StreamPainter(WaveformCanvas waveCanvas, boolean even, TrackEntry trackEntry) {
|
||||||
super(trackEntry, even);
|
super(trackEntry, even);
|
||||||
this.waveCanvas = waveCanvas;
|
this.waveCanvas = waveCanvas;
|
||||||
this.stream=trackEntry.waveform;
|
this.stream=trackEntry.waveform;
|
||||||
this.seenTx=new TreeMap<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void paintArea(Projection proj, Rectangle area) {
|
public void paintArea(Projection proj, Rectangle area) {
|
||||||
@@ -72,11 +71,6 @@ public class StreamPainter extends TrackPainter{
|
|||||||
long beginTime = beginPos*scaleFactor;
|
long beginTime = beginPos*scaleFactor;
|
||||||
long endTime = beginTime + area.width*scaleFactor;
|
long endTime = beginTime + area.width*scaleFactor;
|
||||||
|
|
||||||
IEventList events = stream.getEvents();
|
|
||||||
EventEntry firstTx = events.floorEntry(beginTime);
|
|
||||||
EventEntry lastTx = events.ceilingEntry(endTime);
|
|
||||||
if(firstTx==null) firstTx = events.firstEntry();
|
|
||||||
if(lastTx==null) lastTx = events.lastEntry();
|
|
||||||
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
||||||
proj.setLineStyle(SWT.LINE_SOLID);
|
proj.setLineStyle(SWT.LINE_SOLID);
|
||||||
proj.setLineWidth(1);
|
proj.setLineWidth(1);
|
||||||
@@ -84,47 +78,34 @@ public class StreamPainter extends TrackPainter{
|
|||||||
|
|
||||||
for( int y1=area.y+trackHeight/2; y1<area.y+trackEntry.height; y1+=trackHeight)
|
for( int y1=area.y+trackHeight/2; y1<area.y+trackEntry.height; y1+=trackHeight)
|
||||||
proj.drawLine(area.x, y1, area.x+area.width, y1);
|
proj.drawLine(area.x, y1, area.x+area.width, y1);
|
||||||
if(firstTx==lastTx) {
|
ITxEvent highlighted = null;
|
||||||
for(IEvent txEvent: firstTx.events)
|
for (ITxEvent event : getIntervalIndex().overlapping(beginTime, endTime)) {
|
||||||
drawTx(proj, area, ((ITxEvent)txEvent).getTransaction(), ((ITxEvent)txEvent).getRowIndex(), false);
|
ITx tx = event.getTransaction();
|
||||||
}else{
|
drawTx(proj, area, tx, event.getRowIndex(), false);
|
||||||
seenTx.clear();
|
if (waveCanvas.currentSelectedTx != null && waveCanvas.currentSelectedTx.getId() == tx.getId())
|
||||||
ITxEvent highlighed=null;
|
highlighted = event;
|
||||||
proj.setForeground(this.waveCanvas.styleProvider.getColor(WaveformColors.LINE));
|
}
|
||||||
long selectedId=waveCanvas.currentSelection!=null? waveCanvas.currentSelection.getId():-1;
|
if (highlighted != null) {
|
||||||
for(EventEntry entry: events.subMap(firstTx.timestamp, true, lastTx.timestamp))
|
proj.setForeground(waveCanvas.styleProvider.getColor(WaveformColors.LINE_HIGHLITE));
|
||||||
for(IEvent e:entry.events){
|
drawTx(proj, area, highlighted.getTransaction(), highlighted.getRowIndex(), true);
|
||||||
ITxEvent evt = (ITxEvent) e;
|
|
||||||
ITx tx = evt.getTransaction();
|
|
||||||
if(selectedId==tx.getId())
|
|
||||||
highlighed=evt;
|
|
||||||
switch(evt.getKind()) {
|
|
||||||
case BEGIN:
|
|
||||||
seenTx.put(tx, evt);
|
|
||||||
break;
|
|
||||||
case END:
|
|
||||||
drawTx(proj, area, tx, evt.getRowIndex(), false);
|
|
||||||
seenTx.remove(tx);
|
|
||||||
break;
|
|
||||||
case SINGLE:
|
|
||||||
drawTx(proj, area, tx, evt.getRowIndex(), false);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
seenTx.entrySet().stream().forEach(e -> {
|
|
||||||
drawTx(proj, area, e.getKey(), e.getValue().getRowIndex(), false);
|
|
||||||
});
|
|
||||||
|
|
||||||
if(highlighed!=null){
|
private TxIntervalIndex getIntervalIndex() {
|
||||||
proj.setForeground(this.waveCanvas.styleProvider.getColor(WaveformColors.LINE_HIGHLITE));
|
stream.getRowCount();
|
||||||
drawTx(proj, area, highlighed.getTransaction(), highlighed.getRowIndex(), true);
|
IEventList events = stream.getEvents();
|
||||||
}
|
if (intervalIndex == null || indexedEvents != events || indexedSize != events.size()) {
|
||||||
|
intervalIndex = new TxIntervalIndex(events);
|
||||||
|
indexedEvents = events;
|
||||||
|
indexedSize = events.size();
|
||||||
}
|
}
|
||||||
|
return intervalIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawTx(Projection proj, Rectangle area, ITx tx, int concurrencyIndex, boolean highlighted ) {
|
protected void drawTx(Projection proj, Rectangle area, ITx tx, int concurrencyIndex, boolean highlighted ) {
|
||||||
// compute colors
|
// compute colors
|
||||||
Color[] transColor = waveCanvas.styleProvider.computeColor( tx.getGenerator().getName());
|
IWaveform generator = tx.getGenerator();
|
||||||
|
Color[] transColor = waveCanvas.styleProvider.computeColor( generator!=null?generator.getName():"unknown");
|
||||||
|
|
||||||
proj.setBackground(transColor[highlighted?1:0]);
|
proj.setBackground(transColor[highlighted?1:0]);
|
||||||
|
|
||||||
@@ -155,13 +136,15 @@ public class StreamPainter extends TrackPainter{
|
|||||||
|
|
||||||
public ITx getClicked(Point point) {
|
public ITx getClicked(Point point) {
|
||||||
int lane=point.y/waveCanvas.styleProvider.getTrackHeight();
|
int lane=point.y/waveCanvas.styleProvider.getTrackHeight();
|
||||||
EventEntry firstTx=stream.getEvents().floorEntry(point.x*waveCanvas.getScale());
|
long scale = waveCanvas.getScale();
|
||||||
if(firstTx!=null){
|
long time = (long) point.x * scale;
|
||||||
do {
|
long low = Math.max(0L, (long) point.x - 5) * scale;
|
||||||
ITx tx = getTxFromEntry(lane, point.x, firstTx.events);
|
long high = ((long) point.x + 5) * scale;
|
||||||
if(tx!=null) return tx;
|
for (ITxEvent event : getIntervalIndex().overlapping(low, high)) {
|
||||||
firstTx=stream.getEvents().lowerEntry(firstTx.timestamp);
|
if (event.getRowIndex() != lane) continue;
|
||||||
}while(firstTx!=null);
|
ITx tx = event.getTransaction();
|
||||||
|
if (event.getKind() == EventKind.SINGLE ||
|
||||||
|
(tx.getBeginTime() <= time && tx.getEndTime() >= time)) return tx;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -172,6 +155,8 @@ public class StreamPainter extends TrackPainter{
|
|||||||
|
|
||||||
public void setStream(IWaveform stream) {
|
public void setStream(IWaveform stream) {
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
|
intervalIndex = null;
|
||||||
|
indexedEvents = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ITx getTxFromEntry(int lane, int offset, IEvent[] firstTx) {
|
protected ITx getTxFromEntry(int lane, int offset, IEvent[] firstTx) {
|
||||||
|
|||||||
+10
@@ -10,12 +10,14 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database.ui.swt.internal;
|
package com.minres.scviewer.database.ui.swt.internal;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.WaveformColors;
|
import com.minres.scviewer.database.ui.WaveformColors;
|
||||||
|
|
||||||
public class TrackAreaPainter implements IPainter {
|
public class TrackAreaPainter implements IPainter {
|
||||||
@@ -60,6 +62,14 @@ public class TrackAreaPainter implements IPainter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IWaveformPainter getPainterFor(TrackEntry e) {
|
||||||
|
for (Entry<Integer,IWaveformPainter> entry : trackVerticalOffset.entrySet()) {
|
||||||
|
if(entry.getValue().getTrackEntry() == e)
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void addTrackPainter(IWaveformPainter trackPainter){
|
public void addTrackPainter(IWaveformPainter trackPainter){
|
||||||
trackVerticalOffset.put(trackPainter.getVerticalOffset()+waveCanvas.rulerHeight, trackPainter);
|
trackVerticalOffset.put(trackPainter.getVerticalOffset()+waveCanvas.rulerHeight, trackPainter);
|
||||||
|
|
||||||
|
|||||||
+31
-13
@@ -18,6 +18,7 @@ import java.util.List;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.ControlAdapter;
|
import org.eclipse.swt.events.ControlAdapter;
|
||||||
import org.eclipse.swt.events.ControlEvent;
|
import org.eclipse.swt.events.ControlEvent;
|
||||||
@@ -44,6 +45,7 @@ import com.minres.scviewer.database.ui.IWaveformStyleProvider;
|
|||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.IWaveformZoom;
|
import com.minres.scviewer.database.ui.IWaveformZoom;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
|
import com.minres.scviewer.database.ui.WaveformSelection;
|
||||||
import com.minres.scviewer.database.ui.ZoomKind;
|
import com.minres.scviewer.database.ui.ZoomKind;
|
||||||
import com.minres.scviewer.database.ui.swt.Constants;
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
import com.minres.scviewer.database.ui.swt.internal.slider.ZoomBar;
|
import com.minres.scviewer.database.ui.swt.internal.slider.ZoomBar;
|
||||||
@@ -72,13 +74,15 @@ public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
|||||||
|
|
||||||
protected List<IPainter> painterList;
|
protected List<IPainter> painterList;
|
||||||
|
|
||||||
ITx currentSelection;
|
ITx currentSelectedTx;
|
||||||
|
|
||||||
|
TrackEntry currentSelectedTrack;
|
||||||
|
|
||||||
private List<SelectionAdapter> selectionListeners;
|
private List<SelectionAdapter> selectionListeners;
|
||||||
|
|
||||||
private RulerPainter rulerPainter;
|
private RulerPainter rulerPainter;
|
||||||
|
|
||||||
private TrackAreaPainter trackAreaPainter;
|
TrackAreaPainter trackAreaPainter;
|
||||||
|
|
||||||
private ArrowPainter arrowPainter;
|
private ArrowPainter arrowPainter;
|
||||||
|
|
||||||
@@ -214,8 +218,9 @@ public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
|||||||
factor=maxFactor;
|
factor=maxFactor;
|
||||||
if(factor!=getScale() || (getMaxVisibleTime()+getMinVisibleTime()/2) != centerTime) {
|
if(factor!=getScale() || (getMaxVisibleTime()+getMinVisibleTime()/2) != centerTime) {
|
||||||
updateScaleFactor(factor);
|
updateScaleFactor(factor);
|
||||||
ITx tx = arrowPainter.getTx();
|
ITx tx = currentSelectedTx;
|
||||||
arrowPainter.setTx(null);
|
currentSelectedTx=null;
|
||||||
|
arrowPainter.updateSelection();
|
||||||
/*
|
/*
|
||||||
* xc = tc/oldScaleFactor
|
* xc = tc/oldScaleFactor
|
||||||
* xoffs = xc+origin.x
|
* xoffs = xc+origin.x
|
||||||
@@ -231,7 +236,8 @@ public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
|||||||
origin.x=0;
|
origin.x=0;
|
||||||
}
|
}
|
||||||
syncSb();
|
syncSb();
|
||||||
arrowPainter.setTx(tx);
|
currentSelectedTx=tx;
|
||||||
|
arrowPainter.updateSelection();
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,12 +457,13 @@ public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSelected(ITx currentSelection) {
|
public void setSelected(ISelection selection) {
|
||||||
this.currentSelection = currentSelection;
|
WaveformSelection selected = WaveformSelection.from(selection);
|
||||||
if (currentSelection != null)
|
currentSelectedTrack = selected.track();
|
||||||
reveal(currentSelection);
|
currentSelectedTx = selected.transaction();
|
||||||
arrowPainter.setTx(currentSelection);
|
if (currentSelectedTx != null) reveal(currentSelectedTx);
|
||||||
redraw();
|
arrowPainter.updateSelection();
|
||||||
|
if (!isDisposed()) redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reveal(ITx tx) {
|
public void reveal(ITx tx) {
|
||||||
@@ -470,9 +477,21 @@ public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
|||||||
} else if (higher > (size.x - origin.x)) {
|
} else if (higher > (size.x - origin.x)) {
|
||||||
setOrigin(size.x - higher, origin.y);
|
setOrigin(size.x - higher, origin.y);
|
||||||
}
|
}
|
||||||
|
if(currentSelectedTrack != null) {
|
||||||
|
EventEntry entry = currentSelectedTrack.waveform.getEvents().floorEntry(tx.getBeginTime());
|
||||||
|
IWaveformPainter painter = trackAreaPainter.getPainterFor(currentSelectedTrack);
|
||||||
|
if (painter != null && painter instanceof StreamPainter)
|
||||||
|
reveal(tx, size, painter, entry);
|
||||||
|
} else
|
||||||
for (IWaveformPainter painter : wave2painterMap.values()) {
|
for (IWaveformPainter painter : wave2painterMap.values()) {
|
||||||
if (painter instanceof StreamPainter && ((StreamPainter) painter).getStream() == tx.getStream()) {
|
if (painter instanceof StreamPainter && ((StreamPainter) painter).getStream() == tx.getStream()) {
|
||||||
EventEntry entry = tx.getStream().getEvents().floorEntry(tx.getBeginTime());
|
EventEntry entry = tx.getStream().getEvents().floorEntry(tx.getBeginTime());
|
||||||
|
reveal(tx, size, painter, entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void reveal(ITx tx, Point size, IWaveformPainter painter, EventEntry entry) {
|
||||||
Optional<IEvent> res = Arrays.stream(entry.events).filter(e -> ((ITxEvent)e).getTransaction().equals(tx)).findFirst();
|
Optional<IEvent> res = Arrays.stream(entry.events).filter(e -> ((ITxEvent)e).getTransaction().equals(tx)).findFirst();
|
||||||
if(res.isPresent()) {
|
if(res.isPresent()) {
|
||||||
int top = painter.getVerticalOffset() + styleProvider.getTrackHeight() * ((ITxEvent)res.get()).getRowIndex();
|
int top = painter.getVerticalOffset() + styleProvider.getTrackHeight() * ((ITxEvent)res.get()).getRowIndex();
|
||||||
@@ -484,8 +503,6 @@ public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reveal(IWaveform waveform) {
|
public void reveal(IWaveform waveform) {
|
||||||
for (IWaveformPainter painter : wave2painterMap.values()) {
|
for (IWaveformPainter painter : wave2painterMap.values()) {
|
||||||
@@ -601,6 +618,7 @@ public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
|||||||
|
|
||||||
public void setStyleProvider(IWaveformStyleProvider styleProvider) {
|
public void setStyleProvider(IWaveformStyleProvider styleProvider) {
|
||||||
this.styleProvider=styleProvider;
|
this.styleProvider=styleProvider;
|
||||||
|
if(!isDisposed())
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+45
-56
@@ -91,6 +91,7 @@ import com.minres.scviewer.database.ui.IWaveformView;
|
|||||||
import com.minres.scviewer.database.ui.IWaveformZoom;
|
import com.minres.scviewer.database.ui.IWaveformZoom;
|
||||||
import com.minres.scviewer.database.ui.IWaveformviewEventListener;
|
import com.minres.scviewer.database.ui.IWaveformviewEventListener;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
|
import com.minres.scviewer.database.ui.WaveformSelection;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry.HierState;
|
import com.minres.scviewer.database.ui.TrackEntry.HierState;
|
||||||
import com.minres.scviewer.database.ui.swt.internal.slider.ZoomBar;
|
import com.minres.scviewer.database.ui.swt.internal.slider.ZoomBar;
|
||||||
|
|
||||||
@@ -531,6 +532,16 @@ public class WaveformView implements IWaveformView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
getControl().addListener(SWT.Resize, (evt) -> {
|
||||||
|
int y = waveformCanvas.getVerticalBar().getSelection();
|
||||||
|
nameListScrolled.setOrigin(nameListScrolled.getOrigin().x, y);
|
||||||
|
valueListScrolled.setOrigin(valueListScrolled.getOrigin().x, y);
|
||||||
|
});
|
||||||
|
getControl().addListener(SWT.Move, (evt) -> {
|
||||||
|
int y = waveformCanvas.getVerticalBar().getSelection();
|
||||||
|
nameListScrolled.setOrigin(nameListScrolled.getOrigin().x, y);
|
||||||
|
valueListScrolled.setOrigin(valueListScrolled.getOrigin().x, y);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private Control createFill(Composite pane) {
|
private Control createFill(Composite pane) {
|
||||||
@@ -623,7 +634,7 @@ public class WaveformView implements IWaveformView {
|
|||||||
private void addPainter(boolean even, TrackEntry streamEntry) {
|
private void addPainter(boolean even, TrackEntry streamEntry) {
|
||||||
streamEntry.height = styleProvider.getTrackHeight();
|
streamEntry.height = styleProvider.getTrackHeight();
|
||||||
streamEntry.vOffset = tracksVerticalHeight;
|
streamEntry.vOffset = tracksVerticalHeight;
|
||||||
if (streamEntry.waveform.getType() == WaveformType.TRANSACTION) {
|
if (streamEntry.waveform.getType().isTransaction()) {
|
||||||
streamEntry.currentValue = "";
|
streamEntry.currentValue = "";
|
||||||
streamEntry.height *= streamEntry.waveform.getRowCount();
|
streamEntry.height *= streamEntry.waveform.getRowCount();
|
||||||
IWaveformPainter painter = new StreamPainter(waveformCanvas, even, streamEntry);
|
IWaveformPainter painter = new StreamPainter(waveformCanvas, even, streamEntry);
|
||||||
@@ -680,7 +691,7 @@ public class WaveformView implements IWaveformView {
|
|||||||
else
|
else
|
||||||
entry.currentValue = Double.toString(val);
|
entry.currentValue = Double.toString(val);
|
||||||
}
|
}
|
||||||
} else if (entry.waveform.getType() == WaveformType.TRANSACTION) {
|
} else if (entry.waveform.getType().isTransaction()) {
|
||||||
ITx[] resultsList = new ITx[entry.waveform.getRowCount()];
|
ITx[] resultsList = new ITx[entry.waveform.getRowCount()];
|
||||||
EventEntry firstTx = entry.waveform.getEvents().floorEntry(time);
|
EventEntry firstTx = entry.waveform.getEvents().floorEntry(time);
|
||||||
if (firstTx != null) {
|
if (firstTx != null) {
|
||||||
@@ -796,12 +807,7 @@ public class WaveformView implements IWaveformView {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ISelection getSelection() {
|
public ISelection getSelection() {
|
||||||
ArrayList<Object> sel = new ArrayList<>();
|
return new WaveformSelection(currentTxSelection, currentWaveformSelection).toSelection();
|
||||||
if (currentTxSelection != null) {
|
|
||||||
sel.add(currentTxSelection);
|
|
||||||
}
|
|
||||||
sel.addAll(currentWaveformSelection);
|
|
||||||
return new StructuredSelection(sel.toArray());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -841,59 +847,39 @@ public class WaveformView implements IWaveformView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setSelection(ISelection selection, boolean add, boolean addIfNeeded) {
|
public void setSelection(ISelection selection, boolean add, boolean addIfNeeded) {
|
||||||
boolean selectionChanged = false;
|
WaveformSelection requested = WaveformSelection.from(selection);
|
||||||
currentWaveformSelection.forEach(e -> e.selected = false);
|
currentWaveformSelection.forEach(e -> e.selected = false);
|
||||||
if (selection instanceof IStructuredSelection) {
|
if (!add || (requested.transaction() == null && requested.tracks().isEmpty())) {
|
||||||
IStructuredSelection sel = (IStructuredSelection) selection;
|
currentWaveformSelection.clear();
|
||||||
if (sel.size() == 0) {
|
|
||||||
selectionChanged = currentTxSelection != null || currentWaveformSelection != null;
|
|
||||||
currentTxSelection = null;
|
currentTxSelection = null;
|
||||||
|
}
|
||||||
|
if (requested.transaction() != null) {
|
||||||
|
ITx transaction = requested.transaction();
|
||||||
|
TrackEntry track = requested.track();
|
||||||
|
if (track == null) track = getEntryFor(transaction);
|
||||||
|
if (track == null && addIfNeeded) {
|
||||||
|
track = getEntryFor(transaction.getStream());
|
||||||
|
if (track == null) {
|
||||||
|
track = new TrackEntry(transaction.getStream(), styleProvider);
|
||||||
|
streams.add(track);
|
||||||
|
}
|
||||||
|
}
|
||||||
currentWaveformSelection.clear();
|
currentWaveformSelection.clear();
|
||||||
|
if (track != null) currentWaveformSelection.add(track);
|
||||||
|
currentTxSelection = track == null ? null : transaction;
|
||||||
} else {
|
} else {
|
||||||
if (!add)
|
for (TrackEntry track : requested.tracks())
|
||||||
currentWaveformSelection.clear();
|
if (!currentWaveformSelection.contains(track)) currentWaveformSelection.add(track);
|
||||||
List<?> selList = sel.toList();
|
|
||||||
for(Object o: selList) {
|
|
||||||
if (o instanceof ITx) {
|
|
||||||
ITx txSel = (ITx) o;
|
|
||||||
TrackEntry trackEntry = selList.size() == 2 && selList.get(1) instanceof TrackEntry
|
|
||||||
? (TrackEntry) selList.get(1)
|
|
||||||
: null;
|
|
||||||
if (trackEntry == null) {
|
|
||||||
trackEntry = getEntryFor(txSel);
|
|
||||||
if (trackEntry == null && addIfNeeded) {
|
|
||||||
trackEntry = new TrackEntry(txSel.getStream(), styleProvider);
|
|
||||||
streams.add(trackEntry);
|
|
||||||
}
|
}
|
||||||
}
|
currentWaveformSelection.forEach(e -> {
|
||||||
currentTxSelection = txSel;
|
e.selected = true;
|
||||||
currentWaveformSelection.clear();
|
waveformCanvas.reveal(e.waveform);
|
||||||
currentWaveformSelection.add(trackEntry);
|
});
|
||||||
selectionChanged = true;
|
waveformCanvas.setSelected(getSelection());
|
||||||
} else if (o instanceof TrackEntry) {
|
|
||||||
TrackEntry e = (TrackEntry)o;
|
|
||||||
if(!currentWaveformSelection.contains(e))
|
|
||||||
currentWaveformSelection.add(e);
|
|
||||||
selectionChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (currentTxSelection != null || !currentWaveformSelection.isEmpty())
|
|
||||||
selectionChanged = true;
|
|
||||||
currentTxSelection = null;
|
|
||||||
currentWaveformSelection.clear();
|
|
||||||
}
|
|
||||||
currentWaveformSelection.forEach(e -> e.selected = true);
|
|
||||||
if (selectionChanged) {
|
|
||||||
currentWaveformSelection.forEach(e -> waveformCanvas.reveal(e.waveform));
|
|
||||||
waveformCanvas.setSelected(currentTxSelection);
|
|
||||||
valueList.redraw();
|
valueList.redraw();
|
||||||
nameList.redraw();
|
nameList.redraw();
|
||||||
fireSelectionChanged();
|
fireSelectionChanged();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected void fireSelectionChanged() {
|
protected void fireSelectionChanged() {
|
||||||
if (currentWaveformSelection == null)
|
if (currentWaveformSelection == null)
|
||||||
@@ -942,7 +928,7 @@ public class WaveformView implements IWaveformView {
|
|||||||
return;
|
return;
|
||||||
TrackEntry selectedWaveform = currentWaveformSelection.size() == 1 ? currentWaveformSelection.get(0)
|
TrackEntry selectedWaveform = currentWaveformSelection.size() == 1 ? currentWaveformSelection.get(0)
|
||||||
: getEntryFor(currentTxSelection);
|
: getEntryFor(currentTxSelection);
|
||||||
if (selectedWaveform.waveform.getType() == WaveformType.TRANSACTION && currentTxSelection != null) {
|
if (selectedWaveform.waveform.getType().isTransaction() && currentTxSelection != null) {
|
||||||
if (relationType.equals(IWaveformView.NEXT_PREV_IN_STREAM)) {
|
if (relationType.equals(IWaveformView.NEXT_PREV_IN_STREAM)) {
|
||||||
ITx transaction = null;
|
ITx transaction = null;
|
||||||
if (direction == GotoDirection.NEXT) {
|
if (direction == GotoDirection.NEXT) {
|
||||||
@@ -1064,7 +1050,7 @@ public class WaveformView implements IWaveformView {
|
|||||||
TrackEntry sel = currentWaveformSelection.get(0);
|
TrackEntry sel = currentWaveformSelection.get(0);
|
||||||
long time = getCursorTime();
|
long time = getCursorTime();
|
||||||
IEventList map = null;
|
IEventList map = null;
|
||||||
if (sel.waveform.getType() == WaveformType.TRANSACTION || sel.waveform.getType() == WaveformType.SIGNAL) {
|
if (sel.waveform.getType().isTransaction() || sel.waveform.getType() == WaveformType.SIGNAL) {
|
||||||
map = sel.waveform.getEvents();
|
map = sel.waveform.getEvents();
|
||||||
}
|
}
|
||||||
if (map != null) {
|
if (map != null) {
|
||||||
@@ -1376,10 +1362,13 @@ public class WaveformView implements IWaveformView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TrackEntry getEntryFor(ITx source) {
|
public TrackEntry getEntryFor(ITx source) {
|
||||||
Optional<TrackEntry> optGen = streams.stream().filter(e -> source.getGenerator().equals(e.waveform))
|
if(source.getGenerator()==null) return null;
|
||||||
|
Optional<TrackEntry> optGen = streams.stream()
|
||||||
|
.filter(e -> source.getGenerator().equals(e.waveform))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
if (optGen.isPresent())
|
if (optGen.isPresent())
|
||||||
return optGen.get();
|
return optGen.get();
|
||||||
|
if(source.getStream()==null) return null;
|
||||||
Optional<TrackEntry> optStr = streams.stream().filter(e -> source.getStream().equals(e.waveform)).findFirst();
|
Optional<TrackEntry> optStr = streams.stream().filter(e -> source.getStream().equals(e.waveform)).findFirst();
|
||||||
if (optStr.isPresent())
|
if (optStr.isPresent())
|
||||||
return optStr.get();
|
return optStr.get();
|
||||||
@@ -1617,7 +1606,7 @@ public class WaveformView implements IWaveformView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean waveformsContainsTx() {
|
public boolean waveformsContainsTx() {
|
||||||
return streams.stream().filter(e -> e.waveform.getType() == WaveformType.TRANSACTION).findFirst().isPresent();
|
return streams.stream().filter(e -> e.waveform.getType().isTransaction()).findFirst().isPresent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+4
-4
@@ -21,7 +21,7 @@ enum Direction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ComponentDistribution calculateComponentDistribution( FlatScrollBar scrollBar, int buttonLength ) {
|
private ComponentDistribution calculateComponentDistribution( FlatScrollBar scrollBar, int buttonLength ) {
|
||||||
return calculateComponentDistribution( scrollBar, buttonLength, getControlBounds( scrollBar ).width );
|
return Direction.calculateComponentDistribution( scrollBar, buttonLength, getControlBounds( scrollBar ).width );
|
||||||
}
|
}
|
||||||
|
|
||||||
private Rectangle[] calculateComponentBounds( ComponentDistribution distribution, FlatScrollBar scrollBar ) {
|
private Rectangle[] calculateComponentBounds( ComponentDistribution distribution, FlatScrollBar scrollBar ) {
|
||||||
@@ -61,7 +61,7 @@ enum Direction {
|
|||||||
@Override
|
@Override
|
||||||
protected void expand( Control control, int maxExpansion ) {
|
protected void expand( Control control, int maxExpansion ) {
|
||||||
Rectangle bounds = control.getBounds();
|
Rectangle bounds = control.getBounds();
|
||||||
int expand = expand( bounds.height, maxExpansion );
|
int expand = super.expand( bounds.height, maxExpansion );
|
||||||
control.setBounds( bounds.x, bounds.y - expand, bounds.width, bounds.height + expand );
|
control.setBounds( bounds.x, bounds.y - expand, bounds.width, bounds.height + expand );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -75,7 +75,7 @@ enum Direction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ComponentDistribution calculateComponentDistribution( FlatScrollBar scrollBar, int buttonLength ) {
|
private ComponentDistribution calculateComponentDistribution( FlatScrollBar scrollBar, int buttonLength ) {
|
||||||
return calculateComponentDistribution( scrollBar, buttonLength, getControlBounds( scrollBar ).height );
|
return Direction.calculateComponentDistribution( scrollBar, buttonLength, getControlBounds( scrollBar ).height );
|
||||||
}
|
}
|
||||||
|
|
||||||
private Rectangle[] calculateComponentBounds( ComponentDistribution distribution, FlatScrollBar scrollBar ) {
|
private Rectangle[] calculateComponentBounds( ComponentDistribution distribution, FlatScrollBar scrollBar ) {
|
||||||
@@ -115,7 +115,7 @@ enum Direction {
|
|||||||
@Override
|
@Override
|
||||||
protected void expand( Control control, int maxExpansion ) {
|
protected void expand( Control control, int maxExpansion ) {
|
||||||
Rectangle bounds = control.getBounds();
|
Rectangle bounds = control.getBounds();
|
||||||
int expand = expand( bounds.width, maxExpansion );
|
int expand = super.expand( bounds.width, maxExpansion );
|
||||||
control.setBounds( bounds.x - expand, bounds.y, bounds.width + expand, bounds.height );
|
control.setBounds( bounds.x - expand, bounds.y, bounds.width + expand, bounds.height );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" output="target/classes" path="src">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
@@ -36,4 +36,15 @@
|
|||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997720</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||||
org.eclipse.jdt.core.compiler.compliance=11
|
org.eclipse.jdt.core.compiler.compliance=17
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=11
|
org.eclipse.jdt.core.compiler.source=17
|
||||||
@@ -4,7 +4,7 @@ Bundle-Name: VCD signal database
|
|||||||
Bundle-SymbolicName: com.minres.scviewer.database.vcd
|
Bundle-SymbolicName: com.minres.scviewer.database.vcd
|
||||||
Bundle-Version: 4.0.0.qualifier
|
Bundle-Version: 4.0.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
||||||
org.eclipse.osgi.services;bundle-version="3.4.0",
|
org.eclipse.osgi.services;bundle-version="3.4.0",
|
||||||
com.google.guava;bundle-version="15.0.0"
|
com.google.guava;bundle-version="15.0.0"
|
||||||
|
|||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" output="target/classes" path="src">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
@@ -36,4 +36,15 @@
|
|||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1793520997684</id>
|
||||||
|
<name></name>
|
||||||
|
<type>30</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||||
|
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=11
|
org.eclipse.jdt.core.compiler.compliance=17
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=11
|
org.eclipse.jdt.core.compiler.source=17
|
||||||
@@ -4,9 +4,10 @@ Bundle-Name: Waveform database
|
|||||||
Bundle-SymbolicName: com.minres.scviewer.database
|
Bundle-SymbolicName: com.minres.scviewer.database
|
||||||
Bundle-Version: 4.0.0.qualifier
|
Bundle-Version: 4.0.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||||
Export-Package: com.minres.scviewer.database,
|
Export-Package: com.minres.scviewer.database,
|
||||||
com.minres.scviewer.database.tx
|
com.minres.scviewer.database.tx,
|
||||||
|
com.minres.scviewer.database.internal;x-friends:="com.minres.scviewer.database.test"
|
||||||
Import-Package: org.slf4j
|
Import-Package: org.slf4j
|
||||||
Require-Bundle: javax.inject;bundle-version="1.0.0"
|
Require-Bundle: javax.inject;bundle-version="1.0.0"
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
|
|||||||
@@ -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.19.3</version>
|
<version>2.20.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|||||||
@@ -238,16 +238,6 @@ public class BitVector implements IEvent {
|
|||||||
return EventKind.SINGLE;
|
return EventKind.SINGLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type.
|
|
||||||
*
|
|
||||||
* @return the type
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public WaveformType getType() {
|
|
||||||
return WaveformType.SIGNAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate.
|
* Duplicate.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -37,16 +37,6 @@ public class DoubleVal implements IEvent {
|
|||||||
return EventKind.SINGLE;
|
return EventKind.SINGLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type.
|
|
||||||
*
|
|
||||||
* @return the type
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public WaveformType getType() {
|
|
||||||
return WaveformType.SIGNAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate.
|
* Duplicate.
|
||||||
*
|
*
|
||||||
|
|||||||
+79
-130
@@ -3,193 +3,142 @@ package com.minres.scviewer.database;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
/** Sorted timestamp buckets. Range views are read-only and bounded by their parent. */
|
||||||
public class EventList implements IEventList {
|
public class EventList implements IEventList {
|
||||||
|
/** Accumulates unsorted events and freezes timestamp buckets with one sort and one allocation per bucket. */
|
||||||
|
public static final class Builder {
|
||||||
|
private record TimedEvent(long time, IEvent event) { }
|
||||||
|
private final ArrayList<TimedEvent> pending = new ArrayList<>();
|
||||||
|
private boolean built;
|
||||||
|
|
||||||
ArrayList<EventEntry> store = new ArrayList<>();
|
public void add(long time, IEvent event) {
|
||||||
int start = 0;
|
if (built) throw new IllegalStateException("Event list has already been built");
|
||||||
int end = store.size();
|
pending.add(new TimedEvent(time, event));
|
||||||
boolean unmodifiable = false;
|
|
||||||
|
|
||||||
public class Iterator implements java.util.Iterator<EventEntry> {
|
|
||||||
|
|
||||||
EventList list;
|
|
||||||
|
|
||||||
private int pos;
|
|
||||||
|
|
||||||
public Iterator(EventList list) {
|
|
||||||
this.list=list;
|
|
||||||
this.pos=-1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public EventList build() {
|
||||||
public boolean hasNext() {
|
if (built) throw new IllegalStateException("Event list has already been built");
|
||||||
return pos<(list.end-1);
|
pending.sort((a, b) -> Long.compareUnsigned(a.time(), b.time()));
|
||||||
|
ArrayList<EventEntry> entries = new ArrayList<>();
|
||||||
|
for (int first = 0; first < pending.size();) {
|
||||||
|
long time = pending.get(first).time();
|
||||||
|
int next = first + 1;
|
||||||
|
while (next < pending.size() && pending.get(next).time() == time) next++;
|
||||||
|
IEvent[] events = new IEvent[next - first];
|
||||||
|
for (int i = first; i < next; ++i) events[i - first] = pending.get(i).event();
|
||||||
|
entries.add(new EventEntry(time, events));
|
||||||
|
first = next;
|
||||||
|
}
|
||||||
|
built = true;
|
||||||
|
pending.clear();
|
||||||
|
return new EventList(entries, 0, entries.size(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private final ArrayList<EventEntry> store;
|
||||||
public EventEntry next() {
|
private final int start;
|
||||||
if(hasNext()) {
|
private int end;
|
||||||
pos++;
|
private final boolean unmodifiable;
|
||||||
return list.store.get(pos);
|
|
||||||
} else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void remove() {
|
|
||||||
list.store.remove(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public EventList() {
|
public EventList() {
|
||||||
|
this(new ArrayList<>(), 0, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private EventList(ArrayList<EventEntry> store , int start, int end) {
|
private EventList(ArrayList<EventEntry> store, int start, int end, boolean unmodifiable) {
|
||||||
this.store=store;
|
this.store = store;
|
||||||
this.start=start;
|
this.start = start;
|
||||||
this.end=end;
|
this.end = end;
|
||||||
this.unmodifiable=true;
|
this.unmodifiable = unmodifiable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Index of the first timestamp >= key (or > key when exclusive). */
|
||||||
|
private int bound(long key, boolean exclusive) {
|
||||||
|
int low = start, high = end;
|
||||||
|
while (low < high) {
|
||||||
|
int mid = (low + high) >>> 1;
|
||||||
|
int cmp = Long.compareUnsigned(store.get(mid).timestamp, key);
|
||||||
|
if (cmp < 0 || (exclusive && cmp == 0)) low = mid + 1;
|
||||||
|
else high = mid;
|
||||||
|
}
|
||||||
|
return low;
|
||||||
|
}
|
||||||
|
|
||||||
|
private EventEntry entry(int index) {
|
||||||
|
return index < start || index >= end ? null : store.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEventList subMap(long from, boolean includeFrom, long to) {
|
public IEventList subMap(long from, boolean includeFrom, long to) {
|
||||||
//the index of the first element greater than the key, or list.size()
|
if (Long.compareUnsigned(from, to) > 0) throw new IllegalArgumentException("Reversed time range");
|
||||||
int beginIndex = Collections.binarySearch(store, new EventEntry(from));
|
int first = bound(from, !includeFrom);
|
||||||
int startIndex = beginIndex < 0? -(beginIndex + 1): beginIndex;
|
return new EventList(store, first, Math.max(first, bound(to, true)), true);
|
||||||
int endIndex = Collections.binarySearch(store, new EventEntry(to));
|
|
||||||
endIndex = endIndex < 0? -(endIndex + 1): endIndex+1;
|
|
||||||
if(beginIndex>0 && !includeFrom)
|
|
||||||
return new EventList(store, startIndex+1, endIndex);
|
|
||||||
else
|
|
||||||
return new EventList(store, startIndex, endIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() { return end - start; }
|
||||||
return end-start;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean containsKey(long key) {
|
public boolean containsKey(long key) {
|
||||||
int index = Collections.binarySearch(store, new EventEntry(key));
|
EventEntry e = entry(bound(key, false));
|
||||||
return index>=0 && index>=start && index<end;
|
return e != null && e.timestamp == key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IEvent[] get(long key) {
|
public IEvent[] get(long key) {
|
||||||
int index = Collections.binarySearch(store, new EventEntry(key));
|
EventEntry e = entry(bound(key, false));
|
||||||
if(index<0) return null;
|
return e != null && e.timestamp == key ? e.events : null;
|
||||||
return index>=start && index<end? store.get(index).events: null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void put(long key, IEvent value) {
|
public void put(long key, IEvent value) {
|
||||||
if(unmodifiable) throw new UnsupportedOperationException();
|
if (unmodifiable) throw new UnsupportedOperationException();
|
||||||
if(store.size()==0 || store.get(store.size()-1).timestamp < key) {
|
int index = store.isEmpty() || Long.compareUnsigned(store.get(end - 1).timestamp, key) < 0
|
||||||
store.add(new EventEntry(key, new IEvent[] {value}));
|
? end : bound(key, false);
|
||||||
} else {
|
if (index < end && store.get(index).timestamp == key) store.get(index).append(value);
|
||||||
int index = Collections.binarySearch(store, new EventEntry(key));
|
else store.add(index, new EventEntry(key, new IEvent[] {value}));
|
||||||
// < 0 if element is not in the list, see Collections.binarySearch
|
end = store.size();
|
||||||
if (index < 0) {
|
|
||||||
EventEntry e = new EventEntry(key, new IEvent[] {value});
|
|
||||||
index = -(index + 1);
|
|
||||||
store.add(index, e);
|
|
||||||
} else {
|
|
||||||
// Insertion index is index of existing element, to add new element behind it increase index
|
|
||||||
store.get(index).append(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end=store.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<EventEntry> entrySet() {
|
public Collection<EventEntry> entrySet() {
|
||||||
if(start != 0 || end != store.size())
|
|
||||||
return Collections.unmodifiableList(store.subList(start, end));
|
return Collections.unmodifiableList(store.subList(start, end));
|
||||||
else
|
|
||||||
return Collections.unmodifiableList(store);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() { return start == end; }
|
||||||
return start==end || store.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long firstKey() {
|
public long firstKey() {
|
||||||
|
if (isEmpty()) throw new NoSuchElementException();
|
||||||
return store.get(start).timestamp;
|
return store.get(start).timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long lastKey() {
|
public long lastKey() {
|
||||||
return store.get(end-1).timestamp;
|
if (isEmpty()) throw new NoSuchElementException();
|
||||||
}
|
return store.get(end - 1).timestamp;
|
||||||
|
|
||||||
// Navigable map functions
|
|
||||||
@Override
|
|
||||||
public EventEntry firstEntry() {
|
|
||||||
return store.get(start);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventEntry lastEntry() {
|
public EventEntry firstEntry() { return entry(start); }
|
||||||
return store.get(end-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventEntry floorEntry(long key) {
|
public EventEntry lastEntry() { return entry(end - 1); }
|
||||||
int index = Collections.binarySearch(store, new EventEntry(key));
|
|
||||||
if(index==-1) return null;
|
|
||||||
// < 0 if element is not in the list, see Collections.binarySearch
|
|
||||||
if (index < 0) {
|
|
||||||
index = -(index + 2);
|
|
||||||
}
|
|
||||||
if(index>=end)
|
|
||||||
return store.get(end-1);
|
|
||||||
return index<start? null: store.get(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventEntry ceilingEntry(long key) {
|
public EventEntry floorEntry(long key) { return entry(bound(key, true) - 1); }
|
||||||
int index = Collections.binarySearch(store, new EventEntry(key));
|
|
||||||
// < 0 if element is not in the list, see Collections.binarySearch
|
|
||||||
if (index < 0)
|
|
||||||
index = -(index + 1);
|
|
||||||
if(index<start)
|
|
||||||
return store.get(start);
|
|
||||||
return index>=end? null: store.get(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventEntry lowerEntry(long key) {
|
public EventEntry ceilingEntry(long key) { return entry(bound(key, false)); }
|
||||||
int index = Collections.binarySearch(store, new EventEntry(key));
|
|
||||||
// < 0 if element is not in the list, see Collections.binarySearch
|
|
||||||
if (index < 0)
|
|
||||||
index = -(index + 1);
|
|
||||||
index--;
|
|
||||||
if(index>=end)
|
|
||||||
return store.get(end-1);
|
|
||||||
return index>=end || index<start ?null:store.get(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventEntry higherEntry(long key) {
|
public EventEntry lowerEntry(long key) { return entry(bound(key, false) - 1); }
|
||||||
int index = Collections.binarySearch(store, new EventEntry(key));
|
|
||||||
// < 0 if element is not in the list, see Collections.binarySearch
|
|
||||||
if (index < 0)
|
|
||||||
index = -(index + 1);
|
|
||||||
else
|
|
||||||
index++;
|
|
||||||
if(index<start)
|
|
||||||
return store.get(start);
|
|
||||||
return index>=end || index<start ?null:store.get(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public java.util.Iterator<EventEntry> iterator() {
|
public EventEntry higherEntry(long key) { return entry(bound(key, true)); }
|
||||||
return new Iterator(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public java.util.Iterator<EventEntry> iterator() { return entrySet().iterator(); }
|
||||||
}
|
}
|
||||||
@@ -30,11 +30,4 @@ public interface IEvent {
|
|||||||
*/
|
*/
|
||||||
public EventKind getKind();
|
public EventKind getKind();
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type.
|
|
||||||
*
|
|
||||||
* @return the type
|
|
||||||
*/
|
|
||||||
public WaveformType getType();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+3
-3
@@ -70,9 +70,9 @@ public interface IEventList extends Iterable<EventEntry> {
|
|||||||
* {@code fromKey} to {@code toKey}. If {@code fromKey} and
|
* {@code fromKey} to {@code toKey}. If {@code fromKey} and
|
||||||
* {@code toKey} are equal, the returned map is empty unless
|
* {@code toKey} are equal, the returned map is empty unless
|
||||||
* {@code fromInclusive} is true. The
|
* {@code fromInclusive} is true. The
|
||||||
* returned map is backed by this map, so changes in the returned map are
|
* returned view is read-only. Do not structurally modify a mutable source
|
||||||
* reflected in this map, and vice-versa. The returned map supports all
|
* while a view is in use. EventList.Builder produces frozen sources suitable
|
||||||
* optional map operations that this map supports.
|
* for sharing range views.
|
||||||
*
|
*
|
||||||
* @param fromKey low endpoint of the keys in the returned map
|
* @param fromKey low endpoint of the keys in the returned map
|
||||||
* @param fromInclusive {@code true} if the low endpoint
|
* @param fromInclusive {@code true} if the low endpoint
|
||||||
|
|||||||
+6
@@ -24,9 +24,15 @@ public class InputFormatException extends Exception {
|
|||||||
* @param string the string
|
* @param string the string
|
||||||
*/
|
*/
|
||||||
public InputFormatException(String string) {
|
public InputFormatException(String string) {
|
||||||
|
super(string);
|
||||||
message=string;
|
message=string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InputFormatException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
/** The Constant serialVersionUID. */
|
/** The Constant serialVersionUID. */
|
||||||
private static final long serialVersionUID = 8676129878197783368L;
|
private static final long serialVersionUID = 8676129878197783368L;
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 202 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user