Compare commits
	
		
			118 Commits
		
	
	
		
			2.6.0
			...
			tx_end_tim
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 25170d0d83 | |||
| ba6446378a | |||
| ec9eb17ee3 | |||
| 7775f5978b | |||
| 8c031e7649 | |||
| 6b2eae7f26 | |||
| 69805a423f | |||
| f1178157c8 | |||
| 1ebc6eb03a | |||
| 916215c0c2 | |||
| 6c8e149be2 | |||
| bd08b69747 | |||
| 33e0061147 | |||
| 45e1031e5e | |||
| 73b21cb80b | |||
| 15fb825548 | |||
| 0d448368cc | |||
| abacae42d7 | |||
| 9d2e2e7f64 | |||
| eb64cc60c5 | |||
| 5ea0d6446a | |||
| d970d07048 | |||
| 90f45c698f | |||
| af388b2462 | |||
| 8700e2fdde | |||
| 23ad84ef30 | |||
| 0d074ea6ae | |||
| 351a246238 | |||
| 841b5fe2b2 | |||
| 85ce07f11f | |||
| b44f3418f4 | |||
| bfbc40c282 | |||
| 2c66bf3edd | |||
| a51f922ea4 | |||
| 4d8e7a3cd1 | |||
| 70ccf35fe4 | |||
| 6c5032da10 | |||
| b2e269b67c | |||
| cd01c6a808 | |||
| 179d40ac8d | |||
| 754a61e989 | |||
| bedf4c5c4d | |||
| 7c27bcec47 | |||
| 90f09cc222 | |||
| 21d83f93dc | |||
| db838efc65 | |||
| 929af41dd3 | |||
| 979a7672e6 | |||
| 67818ff4dd | |||
| 0c7631e912 | |||
| a06b888365 | |||
| ded10e1c22 | |||
| 2f3bc0d892 | |||
| 184f1b2d2c | |||
| 90249dadb9 | |||
| c88eb32db8 | |||
| d47db29b93 | |||
| e8148af10f | |||
| b298a4ca6c | |||
| f474e38687 | |||
| 2e806f7b86 | |||
| b7a8d99e2d | |||
| 2a09fc7e6f | |||
| e36abb8d55 | |||
| 5746b9f758 | |||
| 6be1f018b1 | |||
| 38a046aaef | |||
| fdbd6f8402 | |||
| 1dad204494 | |||
| 54661c51ce | |||
| b34fe0d0ba | |||
| 868eceddc5 | |||
| b642c396c7 | |||
| f3d8e34ed0 | |||
| 401c760e01 | |||
| 5add0e385d | |||
| 2ba6822f2b | |||
| 54124d13bf | |||
| 5b949a9d37 | |||
| 9a9b25622c | |||
| dd6a8669b1 | |||
| b483897769 | |||
| bd24c4dd05 | |||
| 664e99d09e | |||
| 675b2ed972 | |||
| e6f19311b1 | |||
| 4a8034191c | |||
| 9d4e5bf636 | |||
| cc9be70708 | |||
| 2dcc72f679 | |||
| 563b6e2b01 | |||
| 6161c0e0ec | |||
| 61c2102ab7 | |||
| 796a04b981 | |||
| 2a71ab94f5 | |||
| 923b89c038 | |||
| 3de6c9900c | |||
| ef1f2a758a | |||
| 3e6d5bd33e | |||
| 26968b8521 | |||
| 611cfc7b46 | |||
| 8cb77a555b | |||
| b4a7f032f5 | |||
| 62e0ec2008 | |||
| f6cc12e8c3 | |||
| b38b268fcb | |||
| 55a14edc9d | |||
| 45c23564b5 | |||
| b170fb3c2a | |||
| ab975eadd1 | |||
| 7ad70411f3 | |||
| 24720340be | |||
| ad51066f1c | |||
| 95e2db60b6 | |||
| db1d377da6 | |||
| 230e8dcc7a | |||
| ab2146102f | |||
| b1148922d8 | 
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -6,5 +6,6 @@ | ||||
| SCViewer initiator_target.launch | ||||
| SCViewer.xcf | ||||
| SCViewer_1.png | ||||
| *.launch | ||||
| copyrightLog.txt | ||||
| /workspace | ||||
| ?*.launch | ||||
							
								
								
									
										17
									
								
								.launch/Build SCViewer.launch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								.launch/Build SCViewer.launch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType"> | ||||
|     <booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/> | ||||
|     <stringAttribute key="M2_GOALS" value="package"/> | ||||
|     <booleanAttribute key="M2_NON_RECURSIVE" value="false"/> | ||||
|     <booleanAttribute key="M2_OFFLINE" value="false"/> | ||||
|     <stringAttribute key="M2_PROFILES" value=""/> | ||||
|     <listAttribute key="M2_PROPERTIES"/> | ||||
|     <stringAttribute key="M2_RUNTIME" value="EMBEDDED"/> | ||||
|     <booleanAttribute key="M2_SKIP_TESTS" value="false"/> | ||||
|     <intAttribute key="M2_THREADS" value="1"/> | ||||
|     <booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/> | ||||
|     <stringAttribute key="M2_USER_SETTINGS" value=""/> | ||||
|     <booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/> | ||||
| </launchConfiguration> | ||||
							
								
								
									
										18
									
								
								.launch/Build and deploy SCViewer.launch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								.launch/Build and deploy SCViewer.launch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType"> | ||||
|     <booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/> | ||||
|     <stringAttribute key="M2_GOALS" value="package"/> | ||||
|     <booleanAttribute key="M2_NON_RECURSIVE" value="false"/> | ||||
|     <booleanAttribute key="M2_OFFLINE" value="false"/> | ||||
|     <stringAttribute key="M2_PROFILES" value="release-composite"/> | ||||
|     <listAttribute key="M2_PROPERTIES"/> | ||||
|     <stringAttribute key="M2_RUNTIME" value="EMBEDDED"/> | ||||
|     <booleanAttribute key="M2_SKIP_TESTS" value="false"/> | ||||
|     <intAttribute key="M2_THREADS" value="1"/> | ||||
|     <booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/> | ||||
|     <stringAttribute key="M2_USER_SETTINGS" value=""/> | ||||
|     <booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/AdoptOpenJDK 8 [1.8.0_232]"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/> | ||||
| </launchConfiguration> | ||||
							
								
								
									
										20
									
								
								.launch/Set SCViewer version.launch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.launch/Set SCViewer version.launch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <launchConfiguration type="org.eclipse.m2e.Maven2LaunchConfigurationType"> | ||||
|     <booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/> | ||||
|     <stringAttribute key="M2_GOALS" value="tycho-versions:set-version tycho-versions:update-pom"/> | ||||
|     <booleanAttribute key="M2_NON_RECURSIVE" value="false"/> | ||||
|     <booleanAttribute key="M2_OFFLINE" value="false"/> | ||||
|     <stringAttribute key="M2_PROFILES" value=""/> | ||||
|     <listAttribute key="M2_PROPERTIES"> | ||||
|         <listEntry value="newVersion=${string_prompt:new version number}"/> | ||||
|     </listAttribute> | ||||
|     <stringAttribute key="M2_RUNTIME" value="EMBEDDED"/> | ||||
|     <booleanAttribute key="M2_SKIP_TESTS" value="false"/> | ||||
|     <intAttribute key="M2_THREADS" value="1"/> | ||||
|     <booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/> | ||||
|     <stringAttribute key="M2_USER_SETTINGS" value=""/> | ||||
|     <booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/> | ||||
|     <stringAttribute key="bad_container_name" value="/com.minres.scviewer.parent/.launch"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/> | ||||
| </launchConfiguration> | ||||
							
								
								
									
										64
									
								
								.project
									
									
									
									
									
								
							
							
						
						
									
										64
									
								
								.project
									
									
									
									
									
								
							| @@ -1,67 +1,17 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <projectDescription> | ||||
| 	<name>scviewer.parent</name> | ||||
| 	<name>com.minres.scviewer.parent</name> | ||||
| 	<comment></comment> | ||||
| 	<projects> | ||||
| 	</projects> | ||||
| 	<buildSpec> | ||||
| 		<buildCommand> | ||||
| 			<name>org.eclipse.m2e.core.maven2Builder</name> | ||||
| 			<arguments> | ||||
| 			</arguments> | ||||
| 		</buildCommand> | ||||
| 	</buildSpec> | ||||
| 	<natures> | ||||
| 		<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||||
| 	</natures> | ||||
| 	<filteredResources> | ||||
| 		<filter> | ||||
| 			<id>1591076960924</id> | ||||
| 			<name></name> | ||||
| 			<type>10</type> | ||||
| 			<matcher> | ||||
| 				<id>org.eclipse.ui.ide.multiFilter</id> | ||||
| 				<arguments>1.0-name-matches-false-false-features</arguments> | ||||
| 			</matcher> | ||||
| 		</filter> | ||||
| 		<filter> | ||||
| 			<id>1591076960932</id> | ||||
| 			<name></name> | ||||
| 			<type>10</type> | ||||
| 			<matcher> | ||||
| 				<id>org.eclipse.ui.ide.multiFilter</id> | ||||
| 				<arguments>1.0-name-matches-false-false-plugins</arguments> | ||||
| 			</matcher> | ||||
| 		</filter> | ||||
| 		<filter> | ||||
| 			<id>1591076960936</id> | ||||
| 			<name></name> | ||||
| 			<type>10</type> | ||||
| 			<matcher> | ||||
| 				<id>org.eclipse.ui.ide.multiFilter</id> | ||||
| 				<arguments>1.0-name-matches-false-false-com.minres.*</arguments> | ||||
| 			</matcher> | ||||
| 		</filter> | ||||
| 		<filter> | ||||
| 			<id>1591076960939</id> | ||||
| 			<name></name> | ||||
| 			<type>10</type> | ||||
| 			<matcher> | ||||
| 				<id>org.eclipse.ui.ide.multiFilter</id> | ||||
| 				<arguments>1.0-name-matches-false-false-product</arguments> | ||||
| 			</matcher> | ||||
| 		</filter> | ||||
| 		<filter> | ||||
| 			<id>1591076960950</id> | ||||
| 			<name></name> | ||||
| 			<type>10</type> | ||||
| 			<matcher> | ||||
| 				<id>org.eclipse.ui.ide.multiFilter</id> | ||||
| 				<arguments>1.0-name-matches-false-false-tests</arguments> | ||||
| 			</matcher> | ||||
| 		</filter> | ||||
| 		<filter> | ||||
| 			<id>1591076960954</id> | ||||
| 			<name></name> | ||||
| 			<type>10</type> | ||||
| 			<matcher> | ||||
| 				<id>org.eclipse.ui.ide.multiFilter</id> | ||||
| 				<arguments>1.0-name-matches-false-false-p2repositories</arguments> | ||||
| 			</matcher> | ||||
| 		</filter> | ||||
| 	</filteredResources> | ||||
| </projectDescription> | ||||
|   | ||||
							
								
								
									
										4
									
								
								.settings/org.eclipse.m2e.core.prefs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								.settings/org.eclipse.m2e.core.prefs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| activeProfiles= | ||||
| eclipse.preferences.version=1 | ||||
| resolveWorkspaceProjects=true | ||||
| version=1 | ||||
| @@ -1,104 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> | ||||
|     <booleanAttribute key="append.args" value="true"/> | ||||
|     <stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/> | ||||
|     <booleanAttribute key="askclear" value="false"/> | ||||
|     <booleanAttribute key="automaticAdd" value="true"/> | ||||
|     <booleanAttribute key="automaticValidate" value="false"/> | ||||
|     <stringAttribute key="bootstrap" value=""/> | ||||
|     <stringAttribute key="checked" value="[NONE]"/> | ||||
|     <booleanAttribute key="clearConfig" value="true"/> | ||||
|     <booleanAttribute key="clearws" value="true"/> | ||||
|     <booleanAttribute key="clearwslog" value="false"/> | ||||
|     <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/> | ||||
|     <booleanAttribute key="default" value="true"/> | ||||
|     <setAttribute key="deselected_workspace_bundles"> | ||||
|         <setEntry value="com.minres.scviewer.e4.application"/> | ||||
|         <setEntry value="com.minres.scviewer.ui"/> | ||||
|     </setAttribute> | ||||
|     <booleanAttribute key="includeOptional" value="true"/> | ||||
|     <stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/> | ||||
|     <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | ||||
|         <listEntry value="/com.minres.scviewer.database.test"/> | ||||
|     </listAttribute> | ||||
|     <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | ||||
|         <listEntry value="4"/> | ||||
|     </listAttribute> | ||||
|     <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.minres.scviewer.database.test"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> | ||||
|     <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.minres.scviewer.database.test"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/> | ||||
|     <stringAttribute key="pde.version" value="3.3"/> | ||||
|     <stringAttribute key="product" value="com.minres.scviewer.e4.product"/> | ||||
|     <booleanAttribute key="run_in_ui_thread" value="true"/> | ||||
|     <setAttribute key="selected_target_bundles"> | ||||
|         <setEntry value="com.google.guava@default:default"/> | ||||
|         <setEntry value="javax.annotation@default:default"/> | ||||
|         <setEntry value="javax.inject@default:default"/> | ||||
|         <setEntry value="javax.servlet@default:default"/> | ||||
|         <setEntry value="org.apache.ant@default:default"/> | ||||
|         <setEntry value="org.apache.commons.jxpath@default:default"/> | ||||
|         <setEntry value="org.apache.felix.gogo.command@default:default"/> | ||||
|         <setEntry value="org.apache.felix.gogo.runtime@default:default"/> | ||||
|         <setEntry value="org.codehaus.groovy@default:default"/> | ||||
|         <setEntry value="org.eclipse.ant.core@default:default"/> | ||||
|         <setEntry value="org.eclipse.core.commands@default:default"/> | ||||
|         <setEntry value="org.eclipse.core.contenttype@default:default"/> | ||||
|         <setEntry value="org.eclipse.core.expressions@default:default"/> | ||||
|         <setEntry value="org.eclipse.core.filesystem.macosx@default:false"/> | ||||
|         <setEntry value="org.eclipse.core.filesystem@default:default"/> | ||||
|         <setEntry value="org.eclipse.core.jobs@default:default"/> | ||||
|         <setEntry value="org.eclipse.core.resources@default:default"/> | ||||
|         <setEntry value="org.eclipse.core.runtime@default:true"/> | ||||
|         <setEntry value="org.eclipse.core.variables@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.core.contexts@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.core.di.annotations@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.core.di.extensions@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.core.di@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.core.services@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.emf.xpath@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.ui.di@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.ui.model.workbench@default:default"/> | ||||
|         <setEntry value="org.eclipse.e4.ui.services@default:default"/> | ||||
|         <setEntry value="org.eclipse.emf.common@default:default"/> | ||||
|         <setEntry value="org.eclipse.emf.ecore@default:default"/> | ||||
|         <setEntry value="org.eclipse.equinox.app@default:default"/> | ||||
|         <setEntry value="org.eclipse.equinox.bidi@default:default"/> | ||||
|         <setEntry value="org.eclipse.equinox.common@2:true"/> | ||||
|         <setEntry value="org.eclipse.equinox.ds@1:true"/> | ||||
|         <setEntry value="org.eclipse.equinox.preferences@default:default"/> | ||||
|         <setEntry value="org.eclipse.equinox.registry@default:default"/> | ||||
|         <setEntry value="org.eclipse.equinox.util@default:default"/> | ||||
|         <setEntry value="org.eclipse.jface@default:default"/> | ||||
|         <setEntry value="org.eclipse.osgi.compatibility.state@default:false"/> | ||||
|         <setEntry value="org.eclipse.osgi.services@default:default"/> | ||||
|         <setEntry value="org.eclipse.osgi@-1:true"/> | ||||
|         <setEntry value="org.eclipse.swt.cocoa.macosx.x86_64@default:false"/> | ||||
|         <setEntry value="org.eclipse.swt@default:default"/> | ||||
|         <setEntry value="org.hamcrest.core@default:default"/> | ||||
|         <setEntry value="org.junit@default:default"/> | ||||
|     </setAttribute> | ||||
|     <setAttribute key="selected_workspace_bundles"> | ||||
|         <setEntry value="com.minres.scviewer.database.sqlite@default:true"/> | ||||
|         <setEntry value="com.minres.scviewer.database.test@default:default"/> | ||||
|         <setEntry value="com.minres.scviewer.database.text@default:true"/> | ||||
|         <setEntry value="com.minres.scviewer.database.ui.swt@default:default"/> | ||||
|         <setEntry value="com.minres.scviewer.database.ui@default:default"/> | ||||
|         <setEntry value="com.minres.scviewer.database.vcd@default:default"/> | ||||
|         <setEntry value="com.minres.scviewer.database@default:true"/> | ||||
|         <setEntry value="com.opcoach.e4.preferences@default:default"/> | ||||
|     </setAttribute> | ||||
|     <booleanAttribute key="show_selected_only" value="false"/> | ||||
|     <booleanAttribute key="tracing" value="false"/> | ||||
|     <booleanAttribute key="useCustomFeatures" value="false"/> | ||||
|     <booleanAttribute key="useDefaultConfig" value="true"/> | ||||
|     <booleanAttribute key="useDefaultConfigArea" value="false"/> | ||||
|     <booleanAttribute key="useProduct" value="false"/> | ||||
| </launchConfiguration> | ||||
| @@ -8,8 +8,9 @@ | ||||
| 		<unit id="org.eclipse.equinox.p2.sdk.feature.jar" version="0.0.0"/> <!-- needed by Linux exectable--> | ||||
| 		<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/> | ||||
| 		<unit id="org.eclipse.platform.sdk" version="0.0.0"/> | ||||
| 		<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/> <!-- org.junit for testing --> | ||||
| 		<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/> <!-- org.eclipse.equinox.p2.iu --> | ||||
| 		<unit id="org.eclipse.rcptt.core.feature.group" version="0.0.0"/><!-- com.google.guave--> | ||||
| 		<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>	<!-- org.junit for testing --> | ||||
| 	</location> | ||||
| 	<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> | ||||
| 		<repository location="https://www.opcoach.com/repository/2020-03/"/> | ||||
| @@ -19,6 +20,22 @@ | ||||
| 		<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.15/"/> | ||||
| 		<unit id="org.codehaus.groovy25.feature.feature.group" version="0.0.0"/> | ||||
| 	</location> | ||||
| 	<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> | ||||
| 		<repository location="http://download.eclipse.org/nattable/releases/1.6.0/repository/"/> | ||||
| 		<unit id="org.eclipse.nebula.widgets.nattable.core.feature.feature.group" version="1.6.0.201909181823"/> | ||||
| 		<unit id="org.eclipse.nebula.widgets.nattable.extension.e4.feature.feature.group" version="1.2.0.201909181823"/> | ||||
| 		<unit id="org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature.feature.group" version="1.6.0.201909181823"/> | ||||
| 		<unit id="org.eclipse.nebula.widgets.nattable.extension.poi.feature.feature.group" version="1.5.1.201909181823"/> | ||||
| 	</location> | ||||
| 	<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> | ||||
| 		<repository location="http://download.eclipse.org/nebula/releases/latest"/> | ||||
| 		<unit id="org.eclipse.nebula.widgets.xviewer.feature.feature.group" version="1.1.0.202011020719"/> | ||||
| 	</location> | ||||
| 	<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit"> | ||||
| 		<repository location="http://download.eclipse.org/collections/10.4.0/repository"/> | ||||
| 		<unit id="org.eclipse.collections.feature.feature.group" version="0.0.0"/> | ||||
| 		<unit id="org.eclipse.collections.feature.source.feature.group" version="0.0.0"/> | ||||
| 	</location> | ||||
| </locations> | ||||
| <targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||||
| <launcherArgs> | ||||
|   | ||||
| @@ -12,7 +12,7 @@ | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
|   	<relativePath>..</relativePath> | ||||
|   </parent> | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,4 @@ | ||||
| activeProfiles= | ||||
| eclipse.preferences.version=1 | ||||
| resolveWorkspaceProjects=true | ||||
| version=1 | ||||
| @@ -1,2 +1,4 @@ | ||||
| bin.includes = feature.xml,\ | ||||
|                feature.properties | ||||
| src.includes = feature.properties,\ | ||||
|                feature.xml | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| featureName=SystemC simulation results viewer | ||||
| featureName=SystemC simulation results viewer database loaders | ||||
| providerName=MINRES Technologies GmbH | ||||
| updateSiteName=SC Viewer Database Updates | ||||
| updateSiteName=SC Viewer Database Loader Updates | ||||
| description=A viewer for SystemC Verification Library transactions and VCD signals. | ||||
| licenseURL=license.html | ||||
| license=\ | ||||
|   | ||||
| @@ -2,17 +2,15 @@ | ||||
| <feature | ||||
|       id="com.minres.scviewer.database.feature" | ||||
|       label="%featureName" | ||||
|       version="1.0.0.qualifier" | ||||
|       version="3.0.0.qualifier" | ||||
|       provider-name="%providerName"> | ||||
|  | ||||
|    <description> | ||||
|       A viewer for SystemC Verification Library transactions and VCD  | ||||
| signals. It supports a SQLite based recording as well as the built-in | ||||
| text base recording. | ||||
|       The database loaders for SystemC Verification Library transactions and VCD signals. They support SQLite based recording as well as the built-in text base recording. | ||||
|    </description> | ||||
|  | ||||
|    <copyright> | ||||
|       Copyright (c) 2015 MINRES Technologies GmbH. | ||||
|       Copyright (c) 2015-2021 MINRES Technologies GmbH. | ||||
| All rights reserved. This program and the accompanying materials | ||||
| are made available under the terms of the Eclipse Public License | ||||
| v1.0 which accompanies this distribution, and is available at  | ||||
| @@ -29,26 +27,12 @@ http://www.eclipse.org/legal/epl-v10.html | ||||
|    </url> | ||||
|  | ||||
|    <requires> | ||||
|       <import plugin="org.codehaus.groovy" version="2.5.8" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.osgi.services" version="3.4.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.osgi"/> | ||||
|       <import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.minres.scviewer.database.ui" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.core.runtime"/> | ||||
|       <import plugin="org.eclipse.core.resources"/> | ||||
|       <import plugin="org.eclipse.jface.text"/> | ||||
|       <import plugin="org.eclipse.ui"/> | ||||
|       <import plugin="org.eclipse.ui.editors"/> | ||||
|       <import plugin="org.eclipse.ui.ide"/> | ||||
|       <import plugin="org.eclipse.ui.views.properties.tabbed"/> | ||||
|       <import plugin="org.eclipse.swt"/> | ||||
|       <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.jface"/> | ||||
|       <import plugin="org.eclipse.swt" version="3.103.1" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.equinox.registry"/> | ||||
|       <import plugin="org.codehaus.groovy" version="2.5.8" match="greaterOrEqual"/> | ||||
|       <import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/> | ||||
|    </requires> | ||||
|  | ||||
|    <plugin | ||||
| @@ -72,12 +56,6 @@ http://www.eclipse.org/legal/epl-v10.html | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
|    <plugin | ||||
|          id="org.codehaus.groovy" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <plugin | ||||
|          id="com.minres.scviewer.database.vcd" | ||||
|          download-size="0" | ||||
| @@ -85,4 +63,11 @@ http://www.eclipse.org/legal/epl-v10.html | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
|    <plugin | ||||
|          id="com.google.guava" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
| </feature> | ||||
|   | ||||
| @@ -5,8 +5,8 @@ | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
| 	<relativePath>../..</relativePath> | ||||
|   </parent> | ||||
|   <version>1.0.0-SNAPSHOT</version> | ||||
|   <version>3.0.0-SNAPSHOT</version> | ||||
| </project> | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
| <feature | ||||
|       id="com.minres.scviewer.e4.feature" | ||||
|       label="SCViewer Feature" | ||||
|       version="1.0.0.qualifier" | ||||
|       version="1.1.0.qualifier" | ||||
|       provider-name="MINRES Technologies GmbH"> | ||||
|  | ||||
|    <description url="http://www.example.com/description"> | ||||
| @@ -21,14 +21,6 @@ | ||||
|       <update label="SC Viewer Updates" url="http://www.minres.com/scviewer/update"/> | ||||
|    </url> | ||||
|  | ||||
|    <includes | ||||
|          id="com.minres.scviewer.database.feature" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <includes | ||||
|          id="com.minres.scviewer.ui.feature" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <requires> | ||||
|       <import plugin="javax.inject" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.core.runtime" version="3.11.1" match="greaterOrEqual"/> | ||||
| @@ -40,28 +32,22 @@ | ||||
|       <import plugin="org.eclipse.e4.core.di" version="1.5.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.e4.ui.di" version="1.1.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.e4.core.contexts" version="1.4.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.minres.scviewer.database.ui"/> | ||||
|       <import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.osgi.services" version="3.5.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.e4.core.services" version="2.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.core.jobs"/> | ||||
|       <import plugin="org.eclipse.osgi"/> | ||||
|       <import plugin="com.google.guava"/> | ||||
|       <import plugin="org.eclipse.equinox.preferences"/> | ||||
|       <import plugin="org.eclipse.core.expressions"/> | ||||
|       <import plugin="org.eclipse.e4.core.commands" version="0.11.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.e4.ui.workbench.addons.swt"/> | ||||
|       <import plugin="com.opcoach.e4.preferences"/> | ||||
|       <import plugin="org.eclipse.e4.core.di.extensions"/> | ||||
|       <import plugin="org.eclipse.e4.ui.css.swt.theme" version="0.10.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.core.resources" version="3.13.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.opcoach.e4.preferences.mainmenu" version="1.2.0" match="greaterOrEqual"/> | ||||
|       <import feature="com.opcoach.e4.preferences.feature" version="1.3.0.202004072127"/> | ||||
|       <import feature="org.eclipse.equinox.executable" version="3.8.700.v20200207-2156"/> | ||||
|       <import feature="org.eclipse.equinox.sdk" version="3.20.100.v20200303-1901"/> | ||||
|       <import feature="org.eclipse.sdk" version="4.15.0.v20200305-0155"/> | ||||
|       <import feature="org.eclipse.rcptt.core" version="2.5.1.M3"/> | ||||
|       <import plugin="org.eclipse.core.commands"/> | ||||
|       <import feature="com.minres.scviewer.database.feature" version="3.0.0.qualifier"/> | ||||
|       <import feature="com.minres.scviewer.ui.feature" version="1.1.0.qualifier"/> | ||||
|    </requires> | ||||
|  | ||||
|    <plugin | ||||
| @@ -71,4 +57,11 @@ | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
|    <plugin | ||||
|          id="com.opcoach.e4.preferences" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
| </feature> | ||||
|   | ||||
| @@ -5,8 +5,8 @@ | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
| 	<relativePath>../..</relativePath> | ||||
|   </parent> | ||||
|   <version>1.0.0-SNAPSHOT</version> | ||||
|   <version>1.1.0-SNAPSHOT</version> | ||||
| </project> | ||||
|   | ||||
							
								
								
									
										17
									
								
								features/com.minres.scviewer.e4.platform.feature/.project
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								features/com.minres.scviewer.e4.platform.feature/.project
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <projectDescription> | ||||
| 	<name>com.minres.scviewer.e4.platform.feature</name> | ||||
| 	<comment></comment> | ||||
| 	<projects> | ||||
| 	</projects> | ||||
| 	<buildSpec> | ||||
| 		<buildCommand> | ||||
| 			<name>org.eclipse.pde.FeatureBuilder</name> | ||||
| 			<arguments> | ||||
| 			</arguments> | ||||
| 		</buildCommand> | ||||
| 	</buildSpec> | ||||
| 	<natures> | ||||
| 		<nature>org.eclipse.pde.FeatureNature</nature> | ||||
| 	</natures> | ||||
| </projectDescription> | ||||
| @@ -0,0 +1 @@ | ||||
| bin.includes = feature.xml | ||||
							
								
								
									
										75
									
								
								features/com.minres.scviewer.e4.platform.feature/feature.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								features/com.minres.scviewer.e4.platform.feature/feature.xml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,75 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <feature | ||||
|       id="com.minres.scviewer.e4.platform.feature" | ||||
|       label="SCViewer Platform Feature" | ||||
|       version="1.0.0.qualifier" | ||||
|       provider-name="MINRES Technologies GmbH"> | ||||
|  | ||||
|    <description url="http://www.example.com/description"> | ||||
|       [Enter Feature Description here.] | ||||
|    </description> | ||||
|  | ||||
|    <copyright url="http://www.example.com/copyright"> | ||||
|       [Enter Copyright Description here.] | ||||
|    </copyright> | ||||
|  | ||||
|    <license url="http://www.example.com/license"> | ||||
|       [Enter License Description here.] | ||||
|    </license> | ||||
|  | ||||
|    <includes | ||||
|          id="org.eclipse.e4.rcp" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <includes | ||||
|          id="org.eclipse.emf.ecore" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <includes | ||||
|          id="org.eclipse.emf.common" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <requires> | ||||
|       <import plugin="org.eclipse.core.expressions" version="3.2.0" match="compatible"/> | ||||
|       <import plugin="org.eclipse.core.filesystem" version="1.3.0" match="compatible"/> | ||||
|       <import plugin="org.eclipse.core.runtime" version="3.12.0" match="compatible"/> | ||||
|       <import plugin="org.eclipse.equinox.common" version="3.2.0" match="compatible"/> | ||||
|       <import plugin="org.eclipse.equinox.registry" version="3.2.0" match="compatible"/> | ||||
|       <import plugin="org.eclipse.osgi" version="3.2.0" match="compatible"/> | ||||
|    </requires> | ||||
|  | ||||
|    <plugin | ||||
|          id="org.eclipse.core.resources" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
|    <plugin | ||||
|          id="org.eclipse.core.filesystem" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
|    <plugin | ||||
|          id="org.eclipse.core.filesystem.linux.x86_64" | ||||
|          os="linux" | ||||
|          arch="x86_64" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0" | ||||
|          fragment="true" | ||||
|          unpack="false"/> | ||||
|  | ||||
|    <plugin | ||||
|          id="org.eclipse.core.filesystem.win32.x86_64" | ||||
|          os="win32" | ||||
|          arch="x86_64" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0" | ||||
|          fragment="true" | ||||
|          unpack="false"/> | ||||
|  | ||||
| </feature> | ||||
| @@ -1,12 +1,12 @@ | ||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||
|   <modelVersion>4.0.0</modelVersion> | ||||
|   <artifactId>com.minres.scviewer.database.ui</artifactId> | ||||
|   <version>2.0.0-SNAPSHOT</version> | ||||
|   <packaging>eclipse-plugin</packaging> | ||||
|   <artifactId>com.minres.scviewer.e4.platform.feature</artifactId> | ||||
|   <packaging>eclipse-feature</packaging> | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
| 	<relativePath>../..</relativePath> | ||||
|   </parent> | ||||
|   </project> | ||||
|   <version>1.0.0-SNAPSHOT</version> | ||||
| </project> | ||||
| @@ -1,2 +1,4 @@ | ||||
| bin.includes = feature.xml,\ | ||||
|                feature.properties | ||||
| src.includes = feature.properties,\ | ||||
|                feature.xml | ||||
|   | ||||
| @@ -2,17 +2,17 @@ | ||||
| <feature | ||||
|       id="com.minres.scviewer.feature" | ||||
|       label="%featureName" | ||||
|       version="1.0.0.qualifier" | ||||
|       version="1.1.0.qualifier" | ||||
|       provider-name="%providerName"> | ||||
|  | ||||
|    <description> | ||||
|       A viewer for SystemC Verification Library transactions and VCD  | ||||
| signals. It supports a SQLite based recording as well as the built-in | ||||
| text base recording. | ||||
|       A viewer for SystemC Verification Library transactions and VCD | ||||
| signals. It supports a SQLite based recording as well as the | ||||
| built-in text base recording. | ||||
|    </description> | ||||
|  | ||||
|    <copyright> | ||||
|       Copyright (c) 2015 MINRES Technologies GmbH. | ||||
|       Copyright (c) 2015-2021 MINRES Technologies GmbH. | ||||
| All rights reserved. This program and the accompanying materials | ||||
| are made available under the terms of the Eclipse Public License | ||||
| v1.0 which accompanies this distribution, and is available at  | ||||
| @@ -24,22 +24,11 @@ http://www.eclipse.org/legal/epl-v10.html | ||||
|    </license> | ||||
|  | ||||
|    <url> | ||||
|       <update label="%updateSiteName" url="http://www.minres.com/scviewer/update"/> | ||||
|       <discovery label="MINRES Website" url="http://www.minres.com"/> | ||||
|    </url> | ||||
|  | ||||
|    <includes | ||||
|          id="com.minres.scviewer.database.feature" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <includes | ||||
|          id="com.minres.scviewer.ui.feature" | ||||
|          version="0.0.0"/> | ||||
|  | ||||
|    <requires> | ||||
|       <import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.minres.scviewer.database.ui" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.core.runtime"/> | ||||
|       <import plugin="org.eclipse.core.resources"/> | ||||
|       <import plugin="org.eclipse.jface.text"/> | ||||
| @@ -51,8 +40,8 @@ http://www.eclipse.org/legal/epl-v10.html | ||||
|       <import plugin="org.eclipse.osgi"/> | ||||
|       <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.jface"/> | ||||
|       <import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/> | ||||
|       <import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/> | ||||
|       <import feature="com.minres.scviewer.database.feature" version="3.0.0.qualifier"/> | ||||
|       <import feature="com.minres.scviewer.ui.feature" version="1.1.0.qualifier"/> | ||||
|    </requires> | ||||
|  | ||||
|    <plugin | ||||
|   | ||||
| @@ -5,8 +5,8 @@ | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
| 	<relativePath>../..</relativePath> | ||||
|   </parent> | ||||
|   <version>1.0.0-SNAPSHOT</version> | ||||
|   <version>1.1.0-SNAPSHOT</version> | ||||
| </project> | ||||
|   | ||||
| @@ -1 +1,4 @@ | ||||
| bin.includes = feature.xml | ||||
| bin.includes = feature.xml,\ | ||||
|                feature.properties | ||||
| src.includes = feature.properties,\ | ||||
|                feature.xml | ||||
|   | ||||
							
								
								
									
										102
									
								
								features/com.minres.scviewer.ui.feature/feature.properties
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								features/com.minres.scviewer.ui.feature/feature.properties
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,102 @@ | ||||
| featureName=SCViewer UI elements | ||||
| providerName=MINRES Technologies GmbH | ||||
| updateSiteName=SC Viewer UI Updates | ||||
| description=A viewer for SystemC Verification Library transactions and VCD signals. | ||||
| licenseURL=license.html | ||||
| license=\ | ||||
| ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\ | ||||
| March 17, 2005\n\ | ||||
| \n\ | ||||
| Usage Of Content\n\ | ||||
| \n\ | ||||
| THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ | ||||
| OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ | ||||
| USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ | ||||
| AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ | ||||
| NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ | ||||
| AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ | ||||
| AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ | ||||
| OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ | ||||
| TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ | ||||
| OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ | ||||
| BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ | ||||
| \n\ | ||||
| Applicable Licenses\n\ | ||||
| \n\ | ||||
| Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\ | ||||
| is provided to you under the terms and conditions of the Eclipse Public\n\ | ||||
| License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\ | ||||
| Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ | ||||
| For purposes of the EPL, "Program" will mean the Content.\n\ | ||||
| \n\ | ||||
| Content includes, but is not limited to, source code, object code,\n\ | ||||
| documentation and other files maintained in the Eclipse.org CVS\n\ | ||||
| repository ("Repository") in CVS modules ("Modules") and made available\n\ | ||||
| as downloadable archives ("Downloads").\n\ | ||||
| \n\ | ||||
|    - Content may be structured and packaged into modules to facilitate delivering,\n\ | ||||
|      extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ | ||||
|      plug-in fragments ("Fragments"), and features ("Features").\n\ | ||||
|    - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\ | ||||
|      in a directory named "plugins".\n\ | ||||
|    - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ | ||||
|      Each Feature may be packaged as a sub-directory in a directory named "features".\n\ | ||||
|      Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ | ||||
|      numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ | ||||
|    - Features may also include other Features ("Included Features"). Within a Feature, files\n\ | ||||
|      named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ | ||||
| \n\ | ||||
| Features may also include other Features ("Included Features"). Files named\n\ | ||||
| "feature.xml" may contain a list of the names and version numbers of\n\ | ||||
| Included Features.\n\ | ||||
| \n\ | ||||
| The terms and conditions governing Plug-ins and Fragments should be\n\ | ||||
| contained in files named "about.html" ("Abouts"). The terms and\n\ | ||||
| conditions governing Features and Included Features should be contained\n\ | ||||
| in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ | ||||
| Licenses may be located in any directory of a Download or Module\n\ | ||||
| including, but not limited to the following locations:\n\ | ||||
| \n\ | ||||
|    - The top-level (root) directory\n\ | ||||
|    - Plug-in and Fragment directories\n\ | ||||
|    - Inside Plug-ins and Fragments packaged as JARs\n\ | ||||
|    - Sub-directories of the directory named "src" of certain Plug-ins\n\ | ||||
|    - Feature directories\n\ | ||||
| \n\ | ||||
| Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ | ||||
| Eclipse Update Manager, you must agree to a license ("Feature Update\n\ | ||||
| License") during the installation process. If the Feature contains\n\ | ||||
| Included Features, the Feature Update License should either provide you\n\ | ||||
| with the terms and conditions governing the Included Features or inform\n\ | ||||
| you where you can locate them. Feature Update Licenses may be found in\n\ | ||||
| the "license" property of files named "feature.properties". Such Abouts,\n\ | ||||
| Feature Licenses and Feature Update Licenses contain the terms and\n\ | ||||
| conditions (or references to such terms and conditions) that govern your\n\ | ||||
| use of the associated Content in that directory.\n\ | ||||
| \n\ | ||||
| THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\ | ||||
| TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ | ||||
| SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ | ||||
| \n\ | ||||
|     - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ | ||||
|     - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ | ||||
|     - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ | ||||
|     - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\ | ||||
|     - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\ | ||||
|     - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ | ||||
| \n\ | ||||
| IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ | ||||
| TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\ | ||||
| is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ | ||||
| govern that particular Content.\n\ | ||||
| \n\ | ||||
| Cryptography\n\ | ||||
| \n\ | ||||
| Content may contain encryption software. The country in which you are\n\ | ||||
| currently may have restrictions on the import, possession, and use,\n\ | ||||
| and/or re-export to another country, of encryption software. BEFORE\n\ | ||||
| using any encryption software, please check the country's laws,\n\ | ||||
| regulations and policies concerning the import, possession, or use,\n\ | ||||
| and re-export of encryption software, to see if this is permitted.\n\ | ||||
| \n\ | ||||
| Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n | ||||
| @@ -1,20 +1,44 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <feature | ||||
|       id="com.minres.scviewer.ui.feature" | ||||
|       label="SCViewer UI" | ||||
|       version="1.0.0.qualifier" | ||||
|       provider-name="MINRES Technologies GmbH"> | ||||
|       label="%featureName" | ||||
|       version="1.1.0.qualifier" | ||||
|       provider-name="%providerName"> | ||||
|  | ||||
|    <description url="http://www.example.com/description"> | ||||
|       [Enter Feature Description here.] | ||||
|    <description> | ||||
|       The UI for the SCViewer databases | ||||
|    </description> | ||||
|  | ||||
|    <copyright url="http://www.example.com/copyright"> | ||||
|       [Enter Copyright Description here.] | ||||
|    <copyright> | ||||
|       Copyright (c) 2015-2021 MINRES Technologies GmbH. | ||||
| All rights reserved. This program and the accompanying materials | ||||
| are made available under the terms of the Eclipse Public License | ||||
| v1.0 which accompanies this distribution, and is available at | ||||
| http://www.eclipse.org/legal/epl-v10.html | ||||
|    </copyright> | ||||
|  | ||||
|    <license url="http://www.example.com/license"> | ||||
|       [Enter License Description here.] | ||||
|    <license url="%licenseURL"> | ||||
|       %license | ||||
|    </license> | ||||
|  | ||||
|    <url> | ||||
|       <discovery label="MINRES Website" url="http://www.minres.com"/> | ||||
|    </url> | ||||
|  | ||||
|    <requires> | ||||
|       <import plugin="org.eclipse.swt" version="3.103.1" match="greaterOrEqual"/> | ||||
|       <import plugin="org.eclipse.jface"/> | ||||
|       <import plugin="org.eclipse.equinox.registry"/> | ||||
|       <import plugin="org.eclipse.core.runtime"/> | ||||
|       <import plugin="org.eclipse.osgi"/> | ||||
|       <import feature="com.minres.scviewer.database.feature" version="3.0.0.qualifier"/> | ||||
|    </requires> | ||||
|  | ||||
|    <plugin | ||||
|          id="com.minres.scviewer.database.ui.swt" | ||||
|          download-size="0" | ||||
|          install-size="0" | ||||
|          version="0.0.0" | ||||
|          unpack="false"/> | ||||
|  | ||||
| </feature> | ||||
|   | ||||
| @@ -5,8 +5,8 @@ | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
| 	<relativePath>../..</relativePath> | ||||
|   </parent> | ||||
|   <version>1.0.0-SNAPSHOT</version> | ||||
|   <version>1.1.0-SNAPSHOT</version> | ||||
| </project> | ||||
|   | ||||
| @@ -1,14 +1,32 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <site> | ||||
|    <feature url="features/com.minres.scviewer.feature_1.0.0.qualifier.jar" id="com.minres.scviewer.feature" version="1.0.0.qualifier"> | ||||
|       <category name="com.minres.scviewer"/> | ||||
|    <feature id="com.minres.scviewer.feature" version="0.0.0"> | ||||
|       <category name="ide_components"/> | ||||
|    </feature> | ||||
|    <feature url="features/com.minres.scviewer.feature.source_1.0.0.qualifier.jar" id="com.minres.scviewer.feature.source" version="1.0.0.qualifier"> | ||||
|       <category name="com.minres.scviewer"/> | ||||
|    <feature id="com.minres.scviewer.feature.source" version="0.0.0"> | ||||
|       <category name="ide_components"/> | ||||
|    </feature> | ||||
|    <category-def name="com.minres.scviewer" label="SCViewer"> | ||||
|    <feature id="com.minres.scviewer.ui.feature" version="0.0.0"> | ||||
|       <category name="devel_components"/> | ||||
|    </feature> | ||||
|    <feature id="com.minres.scviewer.ui.feature.source" version="0.0.0"> | ||||
|       <category name="devel_components.source"/> | ||||
|    </feature> | ||||
|    <feature id="com.minres.scviewer.database.feature" version="0.0.0"> | ||||
|       <category name="devel_components"/> | ||||
|    </feature> | ||||
|    <feature id="com.minres.scviewer.database.feature.source" version="0.0.0"> | ||||
|       <category name="devel_components.source"/> | ||||
|    </feature> | ||||
|    <category-def name="ide_components" label="SCViewer"> | ||||
|       <description> | ||||
|          Viewer for SystemC Verification (SCV) library's transaction recording | ||||
|          Viewer for transaction recording outputs of the SystemC Verification (SCV) library | ||||
|       </description> | ||||
|    </category-def> | ||||
|    <category-def name="devel_components" label="Developer Resources"> | ||||
|       <description> | ||||
|          Components to deal with the transaction recording outputs of the SystemC Verification (SCV) library | ||||
|       </description> | ||||
|    </category-def> | ||||
|    <category-def name="devel_components.source" label="Developer Resources (Source)"/> | ||||
| </site> | ||||
|   | ||||
| @@ -1,20 +1,86 @@ | ||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||||
| 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
| 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||
| 	<modelVersion>4.0.0</modelVersion> | ||||
| 	<artifactId>com.minres.scviewer.updateSite</artifactId> | ||||
| 	<version>2.11.0-SNAPSHOT</version> | ||||
| 	<packaging>eclipse-repository</packaging> | ||||
| 	<parent> | ||||
| 		<groupId>com.minres.scviewer</groupId> | ||||
| 		<artifactId>com.minres.scviewer.parent</artifactId> | ||||
| 		<version>2.0.0-SNAPSHOT</version> | ||||
| 		<version>2.11.0</version> | ||||
| 		<relativePath>../..</relativePath> | ||||
| 	</parent> | ||||
| <!--	<build> | ||||
|  		<finalName>resources</finalName> | ||||
| 		<resources> | ||||
| 			<resource> | ||||
| 				<directory>resources</directory> | ||||
| 			</resource> | ||||
| 		</resources> | ||||
| 	</build> --> | ||||
| 	</project> | ||||
|     <build> | ||||
|         <plugins> | ||||
|             <!-- make sure that zipped p2 repositories have the fully qualified version --> | ||||
|             <plugin> | ||||
|                 <groupId>org.eclipse.tycho</groupId> | ||||
|                 <artifactId>tycho-p2-repository-plugin</artifactId> | ||||
|                 <version>${tycho-version}</version> | ||||
|                 <configuration> | ||||
|                     <finalName>${project.artifactId}-${qualifiedVersion}</finalName> | ||||
|                 </configuration> | ||||
|             </plugin> | ||||
| 			<plugin> | ||||
| 				<groupId>org.codehaus.mojo</groupId> | ||||
| 				<artifactId>build-helper-maven-plugin</artifactId> | ||||
| 				<version>3.2.0</version> | ||||
| 				<executions> | ||||
| 					<execution> | ||||
| 						<id>parse-version</id> | ||||
| 						<goals> | ||||
| 							<goal>parse-version</goal> | ||||
| 						</goals> | ||||
| 					</execution> | ||||
| 				</executions> | ||||
| 			</plugin> | ||||
|         </plugins> | ||||
|     </build> | ||||
| 	<profiles> | ||||
| 		<profile> | ||||
| 			<!-- Activate this profile to perform the release to Bintray --> | ||||
| 			<id>release-composite</id> | ||||
| 			<activation> | ||||
| 				<activeByDefault>false</activeByDefault> | ||||
| 			</activation> | ||||
| 			<build> | ||||
| 				<plugins> | ||||
| 					<plugin> | ||||
| 						<groupId>com.carrotgarden.maven</groupId> | ||||
| 						<artifactId>bintray-maven-plugin</artifactId> | ||||
|     					<version>1.5.20191113165555</version> | ||||
|    						<configuration> | ||||
| 							<skip>false</skip> | ||||
| 							<!-- Bintray organization name. --> | ||||
| 							<subject>minres</subject> | ||||
| 							<!-- Bintray target repository. --> | ||||
| 							<repository>eclipse</repository> | ||||
| 							<!-- Bintray package name. --> | ||||
| 							<bintrayPackage>SCViewer</bintrayPackage> | ||||
| 							<bintrayVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</bintrayVersion> | ||||
| 							<packageVcsUrl>https://git.minres.com/VP-Tools/SCViewer.git</packageVcsUrl> | ||||
| 							<!-- Local folder content to sync to the remote repo. --> | ||||
| 							<sourceFolder>${project.build.directory}/repository</sourceFolder> | ||||
| 							<!-- Remote folder for local content upload, relative path. --> | ||||
| 							<targetFolder>scviewer-${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</targetFolder> | ||||
|  | ||||
| 							<!-- Bintray credentials in settings.xml. --> | ||||
| 							<serverId>bintray-minres-deploy</serverId> | ||||
| 						</configuration> | ||||
| 						<executions> | ||||
| 							<!-- Activate "bintray:upload" during "package" --> | ||||
| 							<execution> | ||||
| 								<phase>package</phase> | ||||
| 								<goals> | ||||
|                                     <goal>upload</goal> | ||||
|                                 </goals> | ||||
| 							</execution> | ||||
| 						</executions> | ||||
| 					</plugin> | ||||
| 				</plugins> | ||||
| 			</build> | ||||
| 		</profile> | ||||
| 	</profiles> | ||||
|  | ||||
| </project> | ||||
| @@ -1,6 +1,6 @@ | ||||
| <html> | ||||
| <head> | ||||
| <title>com.itjw.txviewer.updateSite</title> | ||||
| <title>SCViewer Update site</title> | ||||
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||||
| <style>@import url("web/site.css");</style> | ||||
| <script type="text/javascript"> | ||||
|   | ||||
| @@ -4,4 +4,5 @@ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||||
| org.eclipse.jdt.core.compiler.compliance=1.8 | ||||
| org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||||
| org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||||
| org.eclipse.jdt.core.compiler.release=disabled | ||||
| org.eclipse.jdt.core.compiler.source=1.8 | ||||
|   | ||||
| @@ -2,7 +2,7 @@ Manifest-Version: 1.0 | ||||
| Bundle-ManifestVersion: 2 | ||||
| Bundle-Name: SQLite transaction database | ||||
| Bundle-SymbolicName: com.minres.scviewer.database.sqlite | ||||
| Bundle-Version: 1.0.0.qualifier | ||||
| Bundle-Version: 1.1.0.qualifier | ||||
| Bundle-Vendor: MINRES Technologies GmbH | ||||
| Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||||
| Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0" | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| ############################################################################### | ||||
| # Copyright (c) 2014, 2015 MINRES Technologies GmbH and others. | ||||
| # Copyright (c) 2014, 2015-2021 MINRES Technologies GmbH and others. | ||||
| # All rights reserved. This program and the accompanying materials | ||||
| # are made available under the terms of the Eclipse Public License v1.0 | ||||
| # which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
| 	<relativePath>../..</relativePath> | ||||
|   </parent> | ||||
|   <packaging>eclipse-plugin</packaging> | ||||
| @@ -15,5 +15,5 @@ | ||||
|   		<version>3.8.7</version> | ||||
|   	</dependency> | ||||
|   </dependencies> | ||||
|   <version>1.0.0-SNAPSHOT</version> | ||||
|   <version>1.1.0-SNAPSHOT</version> | ||||
| </project> | ||||
|   | ||||
| @@ -0,0 +1,129 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     MINRES Technologies GmbH - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.sqlite; | ||||
|  | ||||
| import java.sql.SQLException; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Map.Entry; | ||||
| import java.util.NavigableMap; | ||||
| import java.util.TreeMap; | ||||
|  | ||||
| import com.minres.scviewer.database.EventKind; | ||||
| import com.minres.scviewer.database.HierNode; | ||||
| import com.minres.scviewer.database.IEvent; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.RelationType; | ||||
| import com.minres.scviewer.database.RelationTypeFactory; | ||||
| import com.minres.scviewer.database.WaveformType; | ||||
| import com.minres.scviewer.database.sqlite.db.IDatabase; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
|  | ||||
| abstract class AbstractTxStream extends HierNode implements IWaveform { | ||||
|  | ||||
| 	protected IDatabase database; | ||||
|  | ||||
| 	private long streamId; | ||||
| 	 | ||||
| 	private Integer maxConcurrency; | ||||
|  | ||||
| 	private TreeMap<Long, IEvent[]> events; | ||||
|  | ||||
| 	private List<RelationType> usedRelationsList; | ||||
|  | ||||
| 	public AbstractTxStream(IDatabase database, String name, long streamId) { | ||||
| 		super(name); | ||||
| 		this.database=database; | ||||
| 		this.streamId=streamId; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public int getWidth() { | ||||
| 		if(maxConcurrency==null){ | ||||
| 			StringBuilder sb = new StringBuilder(); | ||||
| 			sb.append("SELECT MAX(concurrencyLevel) as concurrencyLevel FROM ScvTx where stream="); | ||||
| 			sb.append(streamId); | ||||
| 			try( | ||||
| 					java.sql.Connection connection = database.createConnection(); | ||||
| 					java.sql.Statement statement = connection.createStatement(); | ||||
| 					java.sql.ResultSet resultSet = statement.executeQuery(sb.toString()); | ||||
| 					) { | ||||
| 				while (resultSet.next()) { | ||||
| 					if(maxConcurrency==null) maxConcurrency=0; | ||||
| 					Object value = resultSet.getObject("concurrencyLevel"); | ||||
| 					if(value!=null) | ||||
| 						maxConcurrency=(Integer) value; | ||||
| 				} | ||||
| 			} catch (SQLException e) { | ||||
| 				if(maxConcurrency==null) maxConcurrency=0; | ||||
| 			} | ||||
| 			maxConcurrency+=1; | ||||
| 		} | ||||
| 		return maxConcurrency; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public  NavigableMap<Long, IEvent[]> getEvents(){ | ||||
| 		if(events==null){ | ||||
| 			events=new TreeMap<>(); | ||||
| 			for(Entry<Integer, ITx> entry:getTransactions().entrySet()){ | ||||
| 				putEvent(new TxEvent(EventKind.BEGIN, entry.getValue())); | ||||
| 				putEvent(new TxEvent(EventKind.END, entry.getValue())); | ||||
| 			}	 | ||||
| 		} | ||||
| 		return events; | ||||
| 	} | ||||
|  | ||||
| 	private void putEvent(TxEvent ev){ | ||||
| 		Long time = ev.getTime(); | ||||
| 		if(events.containsKey(time)) { | ||||
| 			IEvent[] oldV = events.get(time); | ||||
| 			IEvent[] newV = new IEvent[oldV.length+1]; | ||||
| 			System.arraycopy(oldV, 0, newV, 0, oldV.length); | ||||
| 			newV[oldV.length]=ev; | ||||
| 			events.put(time, newV); | ||||
| 		} else { | ||||
| 			events.put(time, new IEvent[] {ev}); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	protected abstract Map<Integer, ITx> getTransactions(); | ||||
|  | ||||
| 	@Override | ||||
| 	public IEvent[] getEventsAtTime(Long time) { | ||||
| 		return getEvents().get(time); | ||||
| 	} | ||||
|  | ||||
| 	public void setRelationTypeList(List<RelationType> usedRelationsList){ | ||||
| 		this.usedRelationsList=usedRelationsList; | ||||
| 	} | ||||
|  | ||||
| 	public RelationType getRelationType(String name) { | ||||
| 		RelationType relType=RelationTypeFactory.create(name); | ||||
| 		if(!usedRelationsList.contains(relType)) usedRelationsList.add(relType); | ||||
| 		return relType; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public IEvent[] getEventsBeforeTime(Long time) { | ||||
| 		Entry<Long, IEvent[]> e = events.floorEntry(time); | ||||
| 		if(e==null) | ||||
| 			return new IEvent[]{}; | ||||
| 		else | ||||
| 			return  events.floorEntry(time).getValue(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public WaveformType getType() { | ||||
| 		return WaveformType.TRANSACTION; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -11,10 +11,11 @@ | ||||
| package com.minres.scviewer.database.sqlite; | ||||
|  | ||||
| import java.beans.IntrospectionException; | ||||
| import java.beans.PropertyChangeListener; | ||||
| import java.beans.PropertyChangeSupport; | ||||
| import java.io.File; | ||||
| import java.io.FileInputStream; | ||||
| import java.io.FileNotFoundException; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.lang.reflect.InvocationTargetException; | ||||
| import java.sql.SQLException; | ||||
| import java.util.ArrayList; | ||||
| @@ -24,6 +25,7 @@ import java.util.List; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.IWaveformDb; | ||||
| import com.minres.scviewer.database.IWaveformDbLoader; | ||||
| import com.minres.scviewer.database.InputFormatException; | ||||
| import com.minres.scviewer.database.RelationType; | ||||
| import com.minres.scviewer.database.sqlite.db.IDatabase; | ||||
| import com.minres.scviewer.database.sqlite.db.SQLiteDatabase; | ||||
| @@ -37,21 +39,21 @@ public class SQLiteDbLoader implements IWaveformDbLoader { | ||||
| 	protected IDatabase database; | ||||
| 	 | ||||
| 	private List<RelationType> usedRelationsList = new ArrayList<>(); | ||||
|  | ||||
| 	private IWaveformDb db; | ||||
| 	 | ||||
| 	private ScvSimProps scvSimProps; | ||||
| 		 | ||||
| 	public SQLiteDbLoader() { | ||||
| 	} | ||||
| 	private static final byte[] x = "SQLite format 3".getBytes(); | ||||
|  | ||||
| 	/** The pcs. */ | ||||
| 	protected PropertyChangeSupport pcs = new PropertyChangeSupport(this); | ||||
|  | ||||
| 	@Override | ||||
| 	public Long getMaxTime() { | ||||
| 		SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<ScvTxEvent>(ScvTxEvent.class, | ||||
| 		SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class, | ||||
| 				database, "time = (SELECT MAX(time) FROM ScvTxEvent)"); | ||||
| 		try { | ||||
| 			List<ScvTxEvent> event = handler.selectObjects(); | ||||
| 			if(event.size()>0) | ||||
| 			if(!event.isEmpty()) | ||||
| 				return event.get(0).getTime()*scvSimProps.getTime_resolution(); | ||||
| 		} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | ||||
| 				| InvocationTargetException | SQLException | IntrospectionException e) { | ||||
| @@ -62,59 +64,85 @@ public class SQLiteDbLoader implements IWaveformDbLoader { | ||||
|  | ||||
| 	@Override | ||||
| 	public Collection<IWaveform> getAllWaves() { | ||||
| 		SQLiteDatabaseSelectHandler<ScvStream> handler = new SQLiteDatabaseSelectHandler<ScvStream>(ScvStream.class, database); | ||||
| 		List<IWaveform> streams=new ArrayList<IWaveform>(); | ||||
| 		SQLiteDatabaseSelectHandler<ScvStream> handler = new SQLiteDatabaseSelectHandler<>(ScvStream.class, database); | ||||
| 		List<IWaveform> streams=new ArrayList<>(); | ||||
| 		try { | ||||
| 			for(ScvStream scvStream:handler.selectObjects()){ | ||||
| 				TxStream stream = new TxStream(database, db, scvStream); | ||||
| 				TxStream stream = new TxStream(database, scvStream); | ||||
| 				stream.setRelationTypeList(usedRelationsList); | ||||
| 				streams.add(stream); | ||||
| 			} | ||||
| 		} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | ||||
| 				| InvocationTargetException | SQLException | IntrospectionException e) { | ||||
| //			e.printStackTrace(); | ||||
| 		} | ||||
| 		return streams; | ||||
| 	} | ||||
|  | ||||
| 	private byte[] x = "SQLite format 3".getBytes(); | ||||
| 	@Override | ||||
| 	public boolean canLoad(File inputFile) { | ||||
| 		if (!inputFile.isDirectory() && inputFile.exists()) { | ||||
| 			try(InputStream stream = new FileInputStream(inputFile)){ | ||||
| 				byte[] buffer = new byte[x.length]; | ||||
| 				int readCnt = stream.read(buffer, 0, x.length); | ||||
| 				if (readCnt == x.length) { | ||||
| 					for (int i = 0; i < x.length; i++) | ||||
| 						if (buffer[i] != x[i]) | ||||
| 							return false; | ||||
| 				} | ||||
| 				return true; | ||||
| 			} catch (Exception e) { | ||||
| 				return false; | ||||
| 			} | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public boolean load(IWaveformDb db, File file) throws Exception { | ||||
| 		if(file.isDirectory() || !file.exists()) return false; | ||||
| 		this.db=db; | ||||
| 		try { | ||||
| 			FileInputStream fis = new FileInputStream(file); | ||||
| 			byte[] buffer = new byte[x.length]; | ||||
| 			int read = fis.read(buffer, 0, x.length); | ||||
| 			fis.close(); | ||||
| 			if (read == x.length) | ||||
| 				for (int i = 0; i < x.length; i++) | ||||
| 					if (buffer[i] != x[i])	return false; | ||||
| 		} catch(FileNotFoundException e) { | ||||
| 			return false; | ||||
| 		} catch(IOException e) { //if an I/O error occurs | ||||
| 			return false; | ||||
| 		} | ||||
| 		database=new SQLiteDatabase(file.getAbsolutePath()); | ||||
| 	public void load(IWaveformDb db, File file) throws InputFormatException { | ||||
| 		dispose(); | ||||
| 		database=new SQLiteDatabase(file.getAbsolutePath(), db); | ||||
| 		database.setData("TIMERESOLUTION", 1L); | ||||
| 		SQLiteDatabaseSelectHandler<ScvSimProps> handler = new SQLiteDatabaseSelectHandler<ScvSimProps>(ScvSimProps.class, database); | ||||
| 		SQLiteDatabaseSelectHandler<ScvSimProps> handler = new SQLiteDatabaseSelectHandler<>(ScvSimProps.class, database); | ||||
| 		try { | ||||
| 			for(ScvSimProps simProps:handler.selectObjects()){ | ||||
| 				scvSimProps=simProps; | ||||
| 				database.setData("TIMERESOLUTION", scvSimProps.getTime_resolution()); | ||||
| 			} | ||||
| 			return true; | ||||
| 			pcs.firePropertyChange(IWaveformDbLoader.LOADING_FINISHED, null, null); | ||||
| 		} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | ||||
| 				| InvocationTargetException | SQLException | IntrospectionException e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new InputFormatException(e.toString()); | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
| 	 | ||||
|  | ||||
| 	public void dispose() { | ||||
| 		database=null; | ||||
| 		usedRelationsList=null; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Collection<RelationType> getAllRelationTypes(){ | ||||
| 		return usedRelationsList; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Adds the property change listener. | ||||
| 	 * | ||||
| 	 * @param l the l | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public void addPropertyChangeListener(PropertyChangeListener l) { | ||||
| 		pcs.addPropertyChangeListener(l); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Removes the property change listener. | ||||
| 	 * | ||||
| 	 * @param l the l | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public void removePropertyChangeListener(PropertyChangeListener l) { | ||||
| 		pcs.removePropertyChangeListener(l); | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -18,12 +18,7 @@ import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.ITxAttribute; | ||||
| import com.minres.scviewer.database.ITxEvent; | ||||
| import com.minres.scviewer.database.ITxGenerator; | ||||
| import com.minres.scviewer.database.ITxRelation; | ||||
| import com.minres.scviewer.database.ITxStream; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.sqlite.db.IDatabase; | ||||
| import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler; | ||||
| import com.minres.scviewer.database.sqlite.tables.ScvStream; | ||||
| @@ -31,6 +26,10 @@ import com.minres.scviewer.database.sqlite.tables.ScvTx; | ||||
| 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.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxAttribute; | ||||
| import com.minres.scviewer.database.tx.ITxGenerator; | ||||
| import com.minres.scviewer.database.tx.ITxRelation; | ||||
|  | ||||
| public class Tx implements ITx { | ||||
|  | ||||
| @@ -39,8 +38,10 @@ public class Tx implements ITx { | ||||
| 	private TxGenerator trGenerator; | ||||
| 	private ScvTx scvTx; | ||||
| 	private List<ITxAttribute> attributes; | ||||
| 	private Long begin, end; | ||||
| 	private List<ITxRelation> incoming, outgoing; | ||||
| 	private Long begin; | ||||
| 	private Long end; | ||||
| 	private List<ITxRelation> incoming; | ||||
| 	private List<ITxRelation> outgoing; | ||||
| 	 | ||||
| 	public Tx(IDatabase database, TxStream trStream, TxGenerator trGenerator, ScvTx scvTx) { | ||||
| 		this.database=database; | ||||
| @@ -55,7 +56,7 @@ public class Tx implements ITx { | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public ITxStream<ITxEvent> getStream() { | ||||
| 	public IWaveform getStream() { | ||||
| 		return trStream; | ||||
| 	} | ||||
|  | ||||
| @@ -72,7 +73,7 @@ public class Tx implements ITx { | ||||
| 	@Override | ||||
| 	public Long getBeginTime() { | ||||
| 		if(begin==null){ | ||||
| 		SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<ScvTxEvent>(ScvTxEvent.class, | ||||
| 		SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class, | ||||
| 				database, "tx="+scvTx.getId()+" AND type="+ AssociationType.BEGIN.ordinal()); | ||||
| 		try { | ||||
| 			for(ScvTxEvent scvEvent:handler.selectObjects()){ | ||||
| @@ -88,7 +89,7 @@ public class Tx implements ITx { | ||||
| 	@Override | ||||
| 	public Long getEndTime() { | ||||
| 		if(end==null){ | ||||
| 		SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<ScvTxEvent>(ScvTxEvent.class, | ||||
| 		SQLiteDatabaseSelectHandler<ScvTxEvent> handler = new SQLiteDatabaseSelectHandler<>(ScvTxEvent.class, | ||||
| 				database, "tx="+scvTx.getId()+" AND type="+ AssociationType.END.ordinal()); | ||||
| 		try { | ||||
| 			for(ScvTxEvent scvEvent:handler.selectObjects()){ | ||||
| @@ -104,10 +105,10 @@ public class Tx implements ITx { | ||||
| 	@Override | ||||
| 	public List<ITxAttribute> getAttributes() { | ||||
| 		if(attributes==null){ | ||||
| 			SQLiteDatabaseSelectHandler<ScvTxAttribute> handler = new SQLiteDatabaseSelectHandler<ScvTxAttribute>( | ||||
| 			SQLiteDatabaseSelectHandler<ScvTxAttribute> handler = new SQLiteDatabaseSelectHandler<>( | ||||
| 					ScvTxAttribute.class, database, "tx="+scvTx.getId()); | ||||
| 			try { | ||||
| 				attributes = new ArrayList<ITxAttribute>(); | ||||
| 				attributes = new ArrayList<>(); | ||||
| 				for(ScvTxAttribute scvAttribute:handler.selectObjects()){ | ||||
| 					attributes.add(new TxAttribute(this, scvAttribute)); | ||||
| 					 | ||||
| @@ -122,10 +123,10 @@ public class Tx implements ITx { | ||||
| 	@Override | ||||
| 	public Collection<ITxRelation> getIncomingRelations() { | ||||
| 		if(incoming==null){ | ||||
| 			SQLiteDatabaseSelectHandler<ScvTxRelation> handler = new SQLiteDatabaseSelectHandler<ScvTxRelation>( | ||||
| 			SQLiteDatabaseSelectHandler<ScvTxRelation> handler = new SQLiteDatabaseSelectHandler<>( | ||||
| 					ScvTxRelation.class, database, "sink="+scvTx.getId()); | ||||
| 			try { | ||||
| 				incoming = new ArrayList<ITxRelation>(); | ||||
| 				incoming = new ArrayList<>(); | ||||
| 				for(ScvTxRelation scvRelation:handler.selectObjects()){ | ||||
| 					incoming.add(createRelation(scvRelation, false)); | ||||
| 				} | ||||
| @@ -139,10 +140,10 @@ public class Tx implements ITx { | ||||
| 	@Override | ||||
| 	public Collection<ITxRelation> getOutgoingRelations() { | ||||
| 		if(outgoing==null){ | ||||
| 			SQLiteDatabaseSelectHandler<ScvTxRelation> handler = new SQLiteDatabaseSelectHandler<ScvTxRelation>( | ||||
| 			SQLiteDatabaseSelectHandler<ScvTxRelation> handler = new SQLiteDatabaseSelectHandler<>( | ||||
| 					ScvTxRelation.class, database, "src="+scvTx.getId()); | ||||
| 			try { | ||||
| 				outgoing = new ArrayList<ITxRelation>(); | ||||
| 				outgoing = new ArrayList<>(); | ||||
| 				for(ScvTxRelation scvRelation:handler.selectObjects()){ | ||||
| 					outgoing.add(createRelation(scvRelation, true)); | ||||
| 				} | ||||
| @@ -155,7 +156,7 @@ public class Tx implements ITx { | ||||
|  | ||||
| 	private ITxRelation createRelation(ScvTxRelation rel, boolean outgoing) { | ||||
| 		int otherId = outgoing?rel.getSink():rel.getSrc(); | ||||
| 		SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<ScvTx>(ScvTx.class, database, | ||||
| 		SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<>(ScvTx.class, database, | ||||
| 				"id="+otherId); | ||||
| 		try { | ||||
| 			List<ScvTx> res = handler.selectObjects(); | ||||
| @@ -163,7 +164,7 @@ public class Tx implements ITx { | ||||
| 			List<ScvStream> streams = new SQLiteDatabaseSelectHandler<ScvStream>(ScvStream.class, database, | ||||
| 						"id="+res.get(0).getStream()).selectObjects(); | ||||
| 			if(streams.size()!=1) return null; | ||||
| 			TxStream tgtStream = (TxStream) trStream.getDb().getStreamByName(streams.get(0).getName()); | ||||
| 			TxStream tgtStream = (TxStream) database.getWaveformDb().getStreamByName(streams.get(0).getName()); | ||||
| 			Tx that = (Tx) tgtStream.getTransactions().get(otherId); | ||||
| 			if(outgoing) | ||||
| 				return new TxRelation(trStream.getRelationType(rel.getName()), this, that); | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -12,8 +12,8 @@ package com.minres.scviewer.database.sqlite; | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.DataType; | ||||
| import com.minres.scviewer.database.ITxAttribute; | ||||
| import com.minres.scviewer.database.sqlite.tables.ScvTxAttribute; | ||||
| import com.minres.scviewer.database.tx.ITxAttribute; | ||||
|  | ||||
| public class TxAttribute implements ITxAttribute{ | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -10,16 +10,18 @@ | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.sqlite; | ||||
|  | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.ITxEvent; | ||||
| import com.minres.scviewer.database.IWaveformEvent; | ||||
| import com.minres.scviewer.database.EventKind; | ||||
| import com.minres.scviewer.database.IEvent; | ||||
| import com.minres.scviewer.database.WaveformType; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxEvent; | ||||
|  | ||||
| public class TxEvent implements ITxEvent { | ||||
|  | ||||
| 	private final Type type; | ||||
| 	private final EventKind type; | ||||
| 	private ITx tx; | ||||
| 	 | ||||
| 	public TxEvent(Type type, ITx tx) { | ||||
| 	public TxEvent(EventKind type, ITx tx) { | ||||
| 		super(); | ||||
| 		this.type = type; | ||||
| 		this.tx = tx; | ||||
| @@ -27,26 +29,21 @@ public class TxEvent implements ITxEvent { | ||||
|  | ||||
| 	@Override | ||||
| 	public Long getTime() { | ||||
| 		return type==Type.BEGIN?tx.getBeginTime():tx.getEndTime(); | ||||
| 		return type==EventKind.BEGIN?tx.getBeginTime():tx.getEndTime(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public IWaveformEvent duplicate() throws CloneNotSupportedException { | ||||
| 	public IEvent duplicate() throws CloneNotSupportedException { | ||||
| 		return new TxEvent(type, tx); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public int compareTo(IWaveformEvent o) { | ||||
| 		return getTime().compareTo(o.getTime()); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public ITx getTransaction() { | ||||
| 		return tx; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Type getType() { | ||||
| 	public EventKind getKind() { | ||||
| 		return type; | ||||
| 	} | ||||
|  | ||||
| @@ -54,4 +51,9 @@ public class TxEvent implements ITxEvent { | ||||
| 	public String toString() { | ||||
| 		return type.toString()+"@"+getTime()+" of tx #"+tx.getId(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public WaveformType getType() { | ||||
| 		return WaveformType.TRANSACTION; | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -10,23 +10,33 @@ | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.sqlite; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.beans.IntrospectionException; | ||||
| import java.lang.reflect.InvocationTargetException; | ||||
| import java.sql.SQLException; | ||||
| import java.util.Map; | ||||
| import java.util.TreeMap; | ||||
|  | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.ITxEvent; | ||||
| import com.minres.scviewer.database.ITxGenerator; | ||||
| import com.minres.scviewer.database.ITxStream; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.sqlite.db.IDatabase; | ||||
| import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler; | ||||
| import com.minres.scviewer.database.sqlite.tables.ScvGenerator; | ||||
| import com.minres.scviewer.database.sqlite.tables.ScvTx; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxGenerator; | ||||
|  | ||||
| public class TxGenerator implements ITxGenerator { | ||||
| public class TxGenerator extends AbstractTxStream implements ITxGenerator { | ||||
|  | ||||
| 	private ITxStream<ITxEvent>  stream; | ||||
| 	private TxStream  stream; | ||||
| 	 | ||||
| 	private ScvGenerator scvGenerator; | ||||
|  | ||||
| 	public TxGenerator(ITxStream<ITxEvent>  stream, ScvGenerator scvGenerator) { | ||||
| 	private TreeMap<Integer, ITx> transactions; | ||||
|  | ||||
| 	public TxGenerator(IDatabase database, TxStream stream, ScvGenerator scvGenerator) { | ||||
| 		super(database, scvGenerator.getName(), stream.getId()); | ||||
| 		this.stream=stream; | ||||
| 		this.scvGenerator=scvGenerator; | ||||
| 		stream.addChild(this); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| @@ -35,7 +45,7 @@ public class TxGenerator implements ITxGenerator { | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public ITxStream<ITxEvent> getStream() { | ||||
| 	public IWaveform getStream() { | ||||
| 		return stream; | ||||
| 	} | ||||
|  | ||||
| @@ -45,8 +55,31 @@ public class TxGenerator implements ITxGenerator { | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public List<ITx> getTransactions() { | ||||
| 		return null; | ||||
| 	public boolean isSame(IWaveform other) { | ||||
| 		return(other instanceof TxGenerator && this.getId().equals(other.getId())); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public String getKind() { | ||||
| 		return stream.getKind(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	protected Map<Integer, ITx> getTransactions() { | ||||
| 		if(transactions==null){ | ||||
| 			transactions = new TreeMap<>(); | ||||
| 			SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<>(ScvTx.class, database, | ||||
| 					"stream="+stream.getId()+" and generator="+scvGenerator.getId()); | ||||
| 			try { | ||||
| 				for(ScvTx scvTx:handler.selectObjects()){ | ||||
| 					transactions.put(scvTx.getId(), new Tx(database, (TxStream) stream, this, scvTx)); | ||||
| 				} | ||||
| 			} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | ||||
| 					| InvocationTargetException | SQLException | IntrospectionException e) { | ||||
| 				e.printStackTrace(); | ||||
| 			} | ||||
| 		} | ||||
| 		return transactions; | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -10,14 +10,15 @@ | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.sqlite; | ||||
|  | ||||
| import com.minres.scviewer.database.ITxRelation; | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.RelationType; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxRelation; | ||||
|  | ||||
| public class TxRelation implements ITxRelation { | ||||
|  | ||||
| 	RelationType relationType; | ||||
| 	Tx source, target; | ||||
| 	Tx source; | ||||
| 	Tx target; | ||||
|  | ||||
| 	public TxRelation(RelationType relationType, Tx source, Tx target) { | ||||
| 		this.source = source; | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -14,59 +14,34 @@ import java.beans.IntrospectionException; | ||||
| import java.lang.reflect.InvocationTargetException; | ||||
| import java.sql.SQLException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Map.Entry; | ||||
| import java.util.NavigableMap; | ||||
| import java.util.TreeMap; | ||||
| import java.util.Vector; | ||||
|  | ||||
| import com.minres.scviewer.database.HierNode; | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.ITxEvent; | ||||
| import com.minres.scviewer.database.ITxGenerator; | ||||
| import com.minres.scviewer.database.ITxStream; | ||||
| import com.minres.scviewer.database.IEvent; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.IWaveformDb; | ||||
| import com.minres.scviewer.database.RelationType; | ||||
| import com.minres.scviewer.database.sqlite.db.IDatabase; | ||||
| import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler; | ||||
| import com.minres.scviewer.database.sqlite.tables.ScvGenerator; | ||||
| import com.minres.scviewer.database.sqlite.tables.ScvStream; | ||||
| import com.minres.scviewer.database.sqlite.tables.ScvTx; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxGenerator; | ||||
|  | ||||
| public class TxStream extends HierNode implements ITxStream<ITxEvent> { | ||||
|  | ||||
| 	private IDatabase database; | ||||
| public class TxStream extends AbstractTxStream { | ||||
|  | ||||
| 	private String fullName; | ||||
| 	 | ||||
| 	private IWaveformDb db; | ||||
| 	 | ||||
| 	private ScvStream scvStream; | ||||
| 	 | ||||
| 	private TreeMap<Integer, TxGenerator> generators; | ||||
| 	 | ||||
| 	private TreeMap<Integer, ITx> transactions; | ||||
| 	 | ||||
| 	private Integer maxConcurrency; | ||||
| 	 | ||||
| 	private TreeMap<Long, List<ITxEvent>> events; | ||||
|  | ||||
| 	private List<RelationType> usedRelationsList; | ||||
| 	 | ||||
| 	public TxStream(IDatabase database, IWaveformDb waveformDb, ScvStream scvStream) { | ||||
| 		super(scvStream.getName()); | ||||
| 		this.database=database; | ||||
| 	private ScvStream scvStream; | ||||
|  | ||||
| 	private TreeMap<Integer, TxGenerator> generators; | ||||
|  | ||||
| 	private TreeMap<Integer, ITx> transactions; | ||||
|  | ||||
| 	public TxStream(IDatabase database, ScvStream scvStream) { | ||||
| 		super(database, scvStream.getName(), scvStream.getId()); | ||||
| 		fullName=scvStream.getName(); | ||||
| 		this.scvStream=scvStream; | ||||
| 		db=waveformDb; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public IWaveformDb getDb() { | ||||
| 		return db; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| @@ -79,90 +54,28 @@ public class TxStream extends HierNode implements ITxStream<ITxEvent> { | ||||
| 		return (long) scvStream.getId(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public String getKind() { | ||||
| 		return scvStream.getKind(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public List<ITxGenerator> getGenerators() { | ||||
| 		if(generators==null){ | ||||
| 			SQLiteDatabaseSelectHandler<ScvGenerator> handler = new SQLiteDatabaseSelectHandler<ScvGenerator>( | ||||
| 			SQLiteDatabaseSelectHandler<ScvGenerator> handler = new SQLiteDatabaseSelectHandler<>( | ||||
| 					ScvGenerator.class, database, "stream="+scvStream.getId()); | ||||
| 			generators=new TreeMap<Integer, TxGenerator>(); | ||||
| 			generators=new TreeMap<>(); | ||||
| 			try { | ||||
| 				for(ScvGenerator scvGenerator:handler.selectObjects()){ | ||||
| 					generators.put(scvGenerator.getId(), new TxGenerator(this, scvGenerator)); | ||||
| 					generators.put(scvGenerator.getId(), new TxGenerator(database, this, scvGenerator)); | ||||
| 				} | ||||
| 			} catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | ||||
| 					| InvocationTargetException | SQLException | IntrospectionException e) { | ||||
| 				e.printStackTrace(); | ||||
| 			} | ||||
| 		} | ||||
| 		return new ArrayList<ITxGenerator>(generators.values()); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public int getMaxConcurrency() { | ||||
| 		if(maxConcurrency==null){ | ||||
| 			java.sql.Connection connection=null; | ||||
| 			java.sql.Statement statement=null; | ||||
| 			java.sql.ResultSet resultSet=null; | ||||
| 			try { | ||||
| 				connection = database.createConnection(); | ||||
| 				statement = connection.createStatement(); | ||||
| 				StringBuilder sb = new StringBuilder(); | ||||
| 				sb.append("SELECT MAX(concurrencyLevel) as concurrencyLevel FROM ScvTx where stream="); | ||||
| 				sb.append(scvStream.getId()); | ||||
| 				resultSet = statement.executeQuery(sb.toString()); | ||||
| 				while (resultSet.next()) { | ||||
| 					if(maxConcurrency==null) maxConcurrency=0; | ||||
| 					Object value = resultSet.getObject("concurrencyLevel"); | ||||
| 					if(value!=null) | ||||
| 						maxConcurrency=(Integer) value; | ||||
| 				} | ||||
| 			} catch (SQLException e) { | ||||
| 				if(maxConcurrency==null) maxConcurrency=0; | ||||
| 			} finally { | ||||
| 				try{ | ||||
| 				if(resultSet!=null) resultSet.close(); | ||||
| 				if(statement!=null) statement.close(); | ||||
| 				if(connection!=null) connection.close(); | ||||
| 				} catch (SQLException e) {	} | ||||
| 			} | ||||
| 			maxConcurrency+=1; | ||||
| 		} | ||||
| 		return maxConcurrency; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public  NavigableMap<Long, List<ITxEvent>> getEvents(){ | ||||
| 		if(events==null){ | ||||
| 			events=new TreeMap<Long, List<ITxEvent>>(); | ||||
| 			for(Entry<Integer, ITx> entry:getTransactions().entrySet()){ | ||||
| 				putEvent(new TxEvent(TxEvent.Type.BEGIN, entry.getValue())); | ||||
| 				putEvent(new TxEvent(TxEvent.Type.END, entry.getValue())); | ||||
| 			}	 | ||||
| 		} | ||||
| 		return events; | ||||
| 	} | ||||
|  | ||||
| 	private void putEvent(TxEvent ev){ | ||||
| 		Long time = ev.getTime(); | ||||
| 		if(!events.containsKey(time)){ | ||||
| 			Vector<ITxEvent> vector=new Vector<ITxEvent>(); | ||||
| 			vector.add(ev); | ||||
| 			events.put(time,  vector); | ||||
| 		} else { | ||||
| 			events.get(time).add(ev); | ||||
| 		} | ||||
| 		return new ArrayList<>(generators.values()); | ||||
| 	} | ||||
|  | ||||
| 	protected Map<Integer, ITx> getTransactions() { | ||||
| 		if(transactions==null){ | ||||
| 			if(generators==null) getGenerators(); | ||||
| 			transactions = new TreeMap<Integer, ITx>(); | ||||
| 			SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<ScvTx>(ScvTx.class, database, | ||||
| 			transactions = new TreeMap<>(); | ||||
| 			SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<>(ScvTx.class, database, | ||||
| 					"stream="+scvStream.getId()); | ||||
| 			try { | ||||
| 				for(ScvTx scvTx:handler.selectObjects()){ | ||||
| @@ -177,23 +90,17 @@ public class TxStream extends HierNode implements ITxStream<ITxEvent> { | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Collection<ITxEvent> getWaveformEventsAtTime(Long time) { | ||||
| 	public IEvent[] getEventsAtTime(Long time) { | ||||
| 		return getEvents().get(time); | ||||
| 	} | ||||
|  | ||||
| 	public void setRelationTypeList(List<RelationType> usedRelationsList){ | ||||
| 		this.usedRelationsList=usedRelationsList; | ||||
| 	} | ||||
| 	 | ||||
| 	public RelationType getRelationType(String name) { | ||||
| 		RelationType relType=RelationType.create(name); | ||||
| 		if(!usedRelationsList.contains(relType)) usedRelationsList.add(relType); | ||||
| 		return relType; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Boolean equals(IWaveform other) { | ||||
| 	public boolean isSame(IWaveform other) { | ||||
| 		return(other instanceof TxStream && this.getId().equals(other.getId())); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public String getKind() { | ||||
| 		return scvStream.getKind(); | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -16,6 +16,8 @@ import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Statement; | ||||
|  | ||||
| import com.minres.scviewer.database.IWaveformDb; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * Creates a connection to a database. | ||||
| @@ -58,4 +60,6 @@ public interface IDatabase { | ||||
| 	public void setData(String name, Object value); | ||||
| 	 | ||||
| 	public Object getData(String name);  | ||||
| 	 | ||||
| 	public IWaveformDb getWaveformDb(); | ||||
| }  | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -20,10 +20,14 @@ import java.sql.SQLException; | ||||
| import java.sql.Statement; | ||||
| import java.util.HashMap; | ||||
|  | ||||
| import com.minres.scviewer.database.IWaveformDb; | ||||
|  | ||||
| public class SQLiteDatabase implements IDatabase { | ||||
|  | ||||
| 	protected String dbFileName; | ||||
| 	 | ||||
| 	protected IWaveformDb waveformDb; | ||||
| 	 | ||||
| 	protected HashMap<String, Object> props; | ||||
| 	 | ||||
|     static { | ||||
| @@ -39,9 +43,10 @@ public class SQLiteDatabase implements IDatabase { | ||||
| 		} | ||||
|     } | ||||
|      | ||||
| 	public SQLiteDatabase(String dbFileName) { | ||||
| 	public SQLiteDatabase(String dbFileName, IWaveformDb waveformDb) { | ||||
| 		super(); | ||||
| 		this.dbFileName = dbFileName; | ||||
| 		this.waveformDb = waveformDb; | ||||
| 		props = new HashMap<String, Object>(); | ||||
| 	} | ||||
|  | ||||
| @@ -89,4 +94,9 @@ public class SQLiteDatabase implements IDatabase { | ||||
| 		return props.get(name); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public IWaveformDb getWaveformDb() { | ||||
| 		return waveformDb; | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -77,7 +77,6 @@ public class SQLiteDatabaseSelectHandler<T> extends AbstractDatabaseHandler<T> { | ||||
| 	 * @throws InvocationTargetException | ||||
| 	 */ | ||||
| 	public synchronized List<T> selectObjects() throws SQLException, | ||||
| 			SecurityException, IllegalArgumentException, | ||||
| 			InstantiationException, IllegalAccessException, | ||||
| 			IntrospectionException, InvocationTargetException { | ||||
|  | ||||
| @@ -116,12 +115,11 @@ public class SQLiteDatabaseSelectHandler<T> extends AbstractDatabaseHandler<T> { | ||||
| 	 * @throws InvocationTargetException | ||||
| 	 */ | ||||
| 	private List<T> createObjects(ResultSet resultSet) | ||||
| 			throws SecurityException, IllegalArgumentException, | ||||
| 			SQLException, InstantiationException, | ||||
| 			throws SQLException, InstantiationException, | ||||
| 			IllegalAccessException, IntrospectionException, | ||||
| 			InvocationTargetException { | ||||
|  | ||||
| 		List<T> list = new ArrayList<T>(); | ||||
| 		List<T> list = new ArrayList<>(); | ||||
|  | ||||
| 		while (resultSet.next()) { | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -11,10 +11,7 @@ | ||||
| 			<attribute name="javadoc_location" value="jar:platform:/resource/com.minres.scviewer.database.text/lib/mapdb-3.0.7-javadoc.jar!/"/> | ||||
| 		</attributes> | ||||
| 	</classpathentry> | ||||
| 	<classpathentry kind="src" path="src/"/> | ||||
| 	<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-9.2.0.jar"/> | ||||
| 	<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-api-9.2.0.jar"/> | ||||
| 	<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-forkjoin-9.2.0.jar"/> | ||||
| 	<classpathentry kind="src" path="src"/> | ||||
| 	<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/elsa-3.0.0-M5.jar"/> | ||||
|   | ||||
| @@ -33,7 +33,6 @@ | ||||
| 	</buildSpec> | ||||
| 	<natures> | ||||
| 		<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||||
| 		<nature>org.eclipse.jdt.groovy.core.groovyNature</nature> | ||||
| 		<nature>org.eclipse.pde.PluginNature</nature> | ||||
| 		<nature>org.eclipse.jdt.core.javanature</nature> | ||||
| 	</natures> | ||||
|   | ||||
| @@ -2,22 +2,19 @@ Manifest-Version: 1.0 | ||||
| Bundle-ManifestVersion: 2 | ||||
| Bundle-Name: Textual transaction database | ||||
| Bundle-SymbolicName: com.minres.scviewer.database.text | ||||
| Bundle-Version: 2.0.2.qualifier | ||||
| Bundle-Version: 3.0.0.qualifier | ||||
| Bundle-Vendor: MINRES Technologies GmbH | ||||
| Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||||
| Import-Package: org.osgi.framework;version="1.3.0" | ||||
| Require-Bundle: com.minres.scviewer.database, | ||||
|  org.codehaus.groovy;bundle-version="2.5.8", | ||||
|  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", | ||||
|  org.eclipse.collections;bundle-version="10.4.0" | ||||
| Service-Component: OSGI-INF/component.xml | ||||
| Bundle-ActivationPolicy: lazy | ||||
| Automatic-Module-Name: com.minres.scviewer.database.text | ||||
| Bundle-ClassPath: lib/mapdb-3.0.7.jar, | ||||
|  ., | ||||
|  lib/eclipse-collections-9.2.0.jar, | ||||
|  lib/eclipse-collections-api-9.2.0.jar, | ||||
|  lib/eclipse-collections-forkjoin-9.2.0.jar, | ||||
| Bundle-ClassPath: ., | ||||
|  lib/mapdb-3.0.7.jar, | ||||
|  lib/kotlin-stdlib-1.2.42.jar, | ||||
|  lib/lz4-1.3.0.jar, | ||||
|  lib/elsa-3.0.0-M5.jar | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| ############################################################################### | ||||
| # Copyright (c) 2014, 2015 MINRES Technologies GmbH and others. | ||||
| # Copyright (c) 2014, 2015-2021 MINRES Technologies GmbH and others. | ||||
| # All rights reserved. This program and the accompanying materials | ||||
| # are made available under the terms of the Eclipse Public License v1.0 | ||||
| # which accompanies this distribution, and is available at | ||||
| @@ -13,9 +13,6 @@ bin.includes = META-INF/,\ | ||||
|                OSGI-INF/,\ | ||||
|                lib/,\ | ||||
|                lib/mapdb-3.0.7.jar,\ | ||||
|                lib/eclipse-collections-9.2.0.jar,\ | ||||
|                lib/eclipse-collections-api-9.2.0.jar,\ | ||||
|                lib/eclipse-collections-forkjoin-9.2.0.jar,\ | ||||
|                lib/kotlin-stdlib-1.2.42.jar,\ | ||||
|                lib/lz4-1.3.0.jar,\ | ||||
|                lib/elsa-3.0.0-M5.jar | ||||
|   | ||||
							
								
								
									
										177
									
								
								plugins/com.minres.scviewer.database.text/lib/LICENSE.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										177
									
								
								plugins/com.minres.scviewer.database.text/lib/LICENSE.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,177 @@ | ||||
|  | ||||
|                                  Apache License | ||||
|                            Version 2.0, January 2004 | ||||
|                         http://www.apache.org/licenses/ | ||||
|  | ||||
|    TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||||
|  | ||||
|    1. Definitions. | ||||
|  | ||||
|       "License" shall mean the terms and conditions for use, reproduction, | ||||
|       and distribution as defined by Sections 1 through 9 of this document. | ||||
|  | ||||
|       "Licensor" shall mean the copyright owner or entity authorized by | ||||
|       the copyright owner that is granting the License. | ||||
|  | ||||
|       "Legal Entity" shall mean the union of the acting entity and all | ||||
|       other entities that control, are controlled by, or are under common | ||||
|       control with that entity. For the purposes of this definition, | ||||
|       "control" means (i) the power, direct or indirect, to cause the | ||||
|       direction or management of such entity, whether by contract or | ||||
|       otherwise, or (ii) ownership of fifty percent (50%) or more of the | ||||
|       outstanding shares, or (iii) beneficial ownership of such entity. | ||||
|  | ||||
|       "You" (or "Your") shall mean an individual or Legal Entity | ||||
|       exercising permissions granted by this License. | ||||
|  | ||||
|       "Source" form shall mean the preferred form for making modifications, | ||||
|       including but not limited to software source code, documentation | ||||
|       source, and configuration files. | ||||
|  | ||||
|       "Object" form shall mean any form resulting from mechanical | ||||
|       transformation or translation of a Source form, including but | ||||
|       not limited to compiled object code, generated documentation, | ||||
|       and conversions to other media types. | ||||
|  | ||||
|       "Work" shall mean the work of authorship, whether in Source or | ||||
|       Object form, made available under the License, as indicated by a | ||||
|       copyright notice that is included in or attached to the work | ||||
|       (an example is provided in the Appendix below). | ||||
|  | ||||
|       "Derivative Works" shall mean any work, whether in Source or Object | ||||
|       form, that is based on (or derived from) the Work and for which the | ||||
|       editorial revisions, annotations, elaborations, or other modifications | ||||
|       represent, as a whole, an original work of authorship. For the purposes | ||||
|       of this License, Derivative Works shall not include works that remain | ||||
|       separable from, or merely link (or bind by name) to the interfaces of, | ||||
|       the Work and Derivative Works thereof. | ||||
|  | ||||
|       "Contribution" shall mean any work of authorship, including | ||||
|       the original version of the Work and any modifications or additions | ||||
|       to that Work or Derivative Works thereof, that is intentionally | ||||
|       submitted to Licensor for inclusion in the Work by the copyright owner | ||||
|       or by an individual or Legal Entity authorized to submit on behalf of | ||||
|       the copyright owner. For the purposes of this definition, "submitted" | ||||
|       means any form of electronic, verbal, or written communication sent | ||||
|       to the Licensor or its representatives, including but not limited to | ||||
|       communication on electronic mailing lists, source code control systems, | ||||
|       and issue tracking systems that are managed by, or on behalf of, the | ||||
|       Licensor for the purpose of discussing and improving the Work, but | ||||
|       excluding communication that is conspicuously marked or otherwise | ||||
|       designated in writing by the copyright owner as "Not a Contribution." | ||||
|  | ||||
|       "Contributor" shall mean Licensor and any individual or Legal Entity | ||||
|       on behalf of whom a Contribution has been received by Licensor and | ||||
|       subsequently incorporated within the Work. | ||||
|  | ||||
|    2. Grant of Copyright License. Subject to the terms and conditions of | ||||
|       this License, each Contributor hereby grants to You a perpetual, | ||||
|       worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||||
|       copyright license to reproduce, prepare Derivative Works of, | ||||
|       publicly display, publicly perform, sublicense, and distribute the | ||||
|       Work and such Derivative Works in Source or Object form. | ||||
|  | ||||
|    3. Grant of Patent License. Subject to the terms and conditions of | ||||
|       this License, each Contributor hereby grants to You a perpetual, | ||||
|       worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||||
|       (except as stated in this section) patent license to make, have made, | ||||
|       use, offer to sell, sell, import, and otherwise transfer the Work, | ||||
|       where such license applies only to those patent claims licensable | ||||
|       by such Contributor that are necessarily infringed by their | ||||
|       Contribution(s) alone or by combination of their Contribution(s) | ||||
|       with the Work to which such Contribution(s) was submitted. If You | ||||
|       institute patent litigation against any entity (including a | ||||
|       cross-claim or counterclaim in a lawsuit) alleging that the Work | ||||
|       or a Contribution incorporated within the Work constitutes direct | ||||
|       or contributory patent infringement, then any patent licenses | ||||
|       granted to You under this License for that Work shall terminate | ||||
|       as of the date such litigation is filed. | ||||
|  | ||||
|    4. Redistribution. You may reproduce and distribute copies of the | ||||
|       Work or Derivative Works thereof in any medium, with or without | ||||
|       modifications, and in Source or Object form, provided that You | ||||
|       meet the following conditions: | ||||
|  | ||||
|       (a) You must give any other recipients of the Work or | ||||
|           Derivative Works a copy of this License; and | ||||
|  | ||||
|       (b) You must cause any modified files to carry prominent notices | ||||
|           stating that You changed the files; and | ||||
|  | ||||
|       (c) You must retain, in the Source form of any Derivative Works | ||||
|           that You distribute, all copyright, patent, trademark, and | ||||
|           attribution notices from the Source form of the Work, | ||||
|           excluding those notices that do not pertain to any part of | ||||
|           the Derivative Works; and | ||||
|  | ||||
|       (d) If the Work includes a "NOTICE" text file as part of its | ||||
|           distribution, then any Derivative Works that You distribute must | ||||
|           include a readable copy of the attribution notices contained | ||||
|           within such NOTICE file, excluding those notices that do not | ||||
|           pertain to any part of the Derivative Works, in at least one | ||||
|           of the following places: within a NOTICE text file distributed | ||||
|           as part of the Derivative Works; within the Source form or | ||||
|           documentation, if provided along with the Derivative Works; or, | ||||
|           within a display generated by the Derivative Works, if and | ||||
|           wherever such third-party notices normally appear. The contents | ||||
|           of the NOTICE file are for informational purposes only and | ||||
|           do not modify the License. You may add Your own attribution | ||||
|           notices within Derivative Works that You distribute, alongside | ||||
|           or as an addendum to the NOTICE text from the Work, provided | ||||
|           that such additional attribution notices cannot be construed | ||||
|           as modifying the License. | ||||
|  | ||||
|       You may add Your own copyright statement to Your modifications and | ||||
|       may provide additional or different license terms and conditions | ||||
|       for use, reproduction, or distribution of Your modifications, or | ||||
|       for any such Derivative Works as a whole, provided Your use, | ||||
|       reproduction, and distribution of the Work otherwise complies with | ||||
|       the conditions stated in this License. | ||||
|  | ||||
|    5. Submission of Contributions. Unless You explicitly state otherwise, | ||||
|       any Contribution intentionally submitted for inclusion in the Work | ||||
|       by You to the Licensor shall be under the terms and conditions of | ||||
|       this License, without any additional terms or conditions. | ||||
|       Notwithstanding the above, nothing herein shall supersede or modify | ||||
|       the terms of any separate license agreement you may have executed | ||||
|       with Licensor regarding such Contributions. | ||||
|  | ||||
|    6. Trademarks. This License does not grant permission to use the trade | ||||
|       names, trademarks, service marks, or product names of the Licensor, | ||||
|       except as required for reasonable and customary use in describing the | ||||
|       origin of the Work and reproducing the content of the NOTICE file. | ||||
|  | ||||
|    7. Disclaimer of Warranty. Unless required by applicable law or | ||||
|       agreed to in writing, Licensor provides the Work (and each | ||||
|       Contributor provides its Contributions) on an "AS IS" BASIS, | ||||
|       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||||
|       implied, including, without limitation, any warranties or conditions | ||||
|       of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | ||||
|       PARTICULAR PURPOSE. You are solely responsible for determining the | ||||
|       appropriateness of using or redistributing the Work and assume any | ||||
|       risks associated with Your exercise of permissions under this License. | ||||
|  | ||||
|    8. Limitation of Liability. In no event and under no legal theory, | ||||
|       whether in tort (including negligence), contract, or otherwise, | ||||
|       unless required by applicable law (such as deliberate and grossly | ||||
|       negligent acts) or agreed to in writing, shall any Contributor be | ||||
|       liable to You for damages, including any direct, indirect, special, | ||||
|       incidental, or consequential damages of any character arising as a | ||||
|       result of this License or out of the use or inability to use the | ||||
|       Work (including but not limited to damages for loss of goodwill, | ||||
|       work stoppage, computer failure or malfunction, or any and all | ||||
|       other commercial damages or losses), even if such Contributor | ||||
|       has been advised of the possibility of such damages. | ||||
|  | ||||
|    9. Accepting Warranty or Additional Liability. While redistributing | ||||
|       the Work or Derivative Works thereof, You may choose to offer, | ||||
|       and charge a fee for, acceptance of support, warranty, indemnity, | ||||
|       or other liability obligations and/or rights consistent with this | ||||
|       License. However, in accepting such obligations, You may act only | ||||
|       on Your own behalf and on Your sole responsibility, not on behalf | ||||
|       of any other Contributor, and only if You agree to indemnify, | ||||
|       defend, and hold each Contributor harmless for any liability | ||||
|       incurred by, or claims asserted against, such Contributor by reason | ||||
|       of your accepting any such warranty or additional liability. | ||||
|  | ||||
|    END OF TERMS AND CONDITIONS | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -2,11 +2,11 @@ | ||||
| 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||||
| 	<modelVersion>4.0.0</modelVersion> | ||||
| 	<artifactId>com.minres.scviewer.database.text</artifactId> | ||||
| 	<version>2.0.2-SNAPSHOT</version> | ||||
| 	<version>3.0.0-SNAPSHOT</version> | ||||
| 	<parent> | ||||
| 		<groupId>com.minres.scviewer</groupId> | ||||
| 		<artifactId>com.minres.scviewer.parent</artifactId> | ||||
| 		<version>2.0.0-SNAPSHOT</version> | ||||
| 		<version>2.11.0</version> | ||||
| 		<relativePath>../..</relativePath> | ||||
| 	</parent> | ||||
| 	<packaging>eclipse-plugin</packaging> | ||||
|   | ||||
| @@ -0,0 +1,159 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
| import java.util.Map.Entry; | ||||
| import java.util.NavigableMap; | ||||
| import java.util.TreeMap; | ||||
|  | ||||
| import com.minres.scviewer.database.EventKind; | ||||
| import com.minres.scviewer.database.HierNode; | ||||
| import com.minres.scviewer.database.IEvent; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.WaveformType; | ||||
| import com.minres.scviewer.database.tx.ITxEvent; | ||||
|  | ||||
| /** | ||||
|  * The Class AbstractTxStream. | ||||
|  */ | ||||
| abstract class AbstractTxStream extends HierNode implements IWaveform { | ||||
|  | ||||
| 	/** The id. */ | ||||
| 	private Long id; | ||||
|  | ||||
| 	/** The loader. */ | ||||
| 	protected TextDbLoader loader; | ||||
|  | ||||
| 	/** The events. */ | ||||
| 	TreeMap<Long, IEvent[]> events = new TreeMap<>(); | ||||
|  | ||||
| 	/** The concurrency calculated. */ | ||||
| 	boolean concurrencyCalculated = false; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new abstract tx stream. | ||||
| 	 * | ||||
| 	 * @param loader the loader | ||||
| 	 * @param id     the id | ||||
| 	 * @param name   the name | ||||
| 	 */ | ||||
| 	public AbstractTxStream(TextDbLoader loader, Long id, String name) { | ||||
| 		super(name); | ||||
| 		this.loader = loader; | ||||
| 		this.id = id; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Adds the event. | ||||
| 	 * | ||||
| 	 * @param evt the evt | ||||
| 	 */ | ||||
| 	public void addEvent(ITxEvent evt) { | ||||
| 		if (!events.containsKey(evt.getTime())) | ||||
| 			events.put(evt.getTime(), new IEvent[] { evt }); | ||||
| 		else { | ||||
| 			IEvent[] evts = events.get(evt.getTime()); | ||||
| 			IEvent[] newEvts = Arrays.copyOf(evts, evts.length + 1); | ||||
| 			newEvts[evts.length] = evt; | ||||
| 			events.put(evt.getTime(), newEvts); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the events. | ||||
| 	 * | ||||
| 	 * @return the events | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public NavigableMap<Long, IEvent[]> getEvents() { | ||||
| 		if (!concurrencyCalculated) | ||||
| 			calculateConcurrency(); | ||||
| 		return events; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the events at time. | ||||
| 	 * | ||||
| 	 * @param time the time | ||||
| 	 * @return the events at time | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public IEvent[] getEventsAtTime(Long time) { | ||||
| 		if (!concurrencyCalculated) | ||||
| 			calculateConcurrency(); | ||||
| 		return events.get(time); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the events before time. | ||||
| 	 * | ||||
| 	 * @param time the time | ||||
| 	 * @return the events before time | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public IEvent[] getEventsBeforeTime(Long time) { | ||||
| 		if (!concurrencyCalculated) | ||||
| 			calculateConcurrency(); | ||||
| 		Entry<Long, IEvent[]> e = events.floorEntry(time); | ||||
| 		if (e == null) | ||||
| 			return new IEvent[] {}; | ||||
| 		else | ||||
| 			return events.floorEntry(time).getValue(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the type. | ||||
| 	 * | ||||
| 	 * @return the type | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public WaveformType getType() { | ||||
| 		return WaveformType.TRANSACTION; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the id. | ||||
| 	 * | ||||
| 	 * @return the id | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Long getId() { | ||||
| 		return id; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Calculate concurrency. | ||||
| 	 */ | ||||
| 	synchronized void calculateConcurrency() { | ||||
| 		if (concurrencyCalculated) | ||||
| 			return; | ||||
| 		ArrayList<Long> rowendtime = new ArrayList<>(); | ||||
| 		events.entrySet().stream().forEach(entry -> { | ||||
| 			IEvent[] values = entry.getValue(); | ||||
| 			Arrays.asList(values).stream().filter(e -> e.getKind() == EventKind.BEGIN).forEach(evt -> { | ||||
| 				Tx tx = (Tx) ((TxEvent) evt).getTransaction(); | ||||
| 				int rowIdx = 0; | ||||
| 				for (; rowIdx < rowendtime.size() && rowendtime.get(rowIdx) > tx.getBeginTime(); rowIdx++) | ||||
| 					; | ||||
| 				if (rowendtime.size() <= rowIdx) | ||||
| 					rowendtime.add(tx.getEndTime()); | ||||
| 				else | ||||
| 					rowendtime.set(rowIdx, tx.getEndTime()); | ||||
| 				tx.setConcurrencyIndex(rowIdx); | ||||
| 			}); | ||||
| 		}); | ||||
| 		concurrencyCalculated = true; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,47 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     MINRES Technologies GmbH - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import com.minres.scviewer.database.RelationType; | ||||
|  | ||||
| /** | ||||
|  * The Class ScvRelation. | ||||
|  */ | ||||
| class ScvRelation implements Serializable { | ||||
|  | ||||
| 	/** The Constant serialVersionUID. */ | ||||
| 	private static final long serialVersionUID = -347668857680574140L; | ||||
|  | ||||
| 	/** The source. */ | ||||
| 	final long source; | ||||
|  | ||||
| 	/** The target. */ | ||||
| 	final long target; | ||||
|  | ||||
| 	/** The relation type. */ | ||||
| 	final RelationType relationType; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new scv relation. | ||||
| 	 * | ||||
| 	 * @param relationType the relation type | ||||
| 	 * @param source       the source | ||||
| 	 * @param target       the target | ||||
| 	 */ | ||||
| 	public ScvRelation(RelationType relationType, long source, long target) { | ||||
| 		this.source = source; | ||||
| 		this.target = target; | ||||
| 		this.relationType = relationType; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,70 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.io.Serializable; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import com.minres.scviewer.database.tx.ITxAttribute; | ||||
|  | ||||
| /** | ||||
|  * The Class ScvTx. | ||||
|  */ | ||||
| class ScvTx implements Serializable { | ||||
|  | ||||
| 	/** The Constant serialVersionUID. */ | ||||
| 	private static final long serialVersionUID = -855200240003328221L; | ||||
|  | ||||
| 	/** The id. */ | ||||
| 	final long id; | ||||
|  | ||||
| 	/** The generator id. */ | ||||
| 	final long generatorId; | ||||
|  | ||||
| 	/** The stream id. */ | ||||
| 	final long streamId; | ||||
|  | ||||
| 	/** The begin time. */ | ||||
| 	long beginTime; | ||||
|  | ||||
| 	/** The end time. */ | ||||
| 	long endTime; | ||||
|  | ||||
| 	/** The attributes. */ | ||||
| 	final List<ITxAttribute> attributes = new ArrayList<>(); | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new scv tx. | ||||
| 	 * | ||||
| 	 * @param id          the id | ||||
| 	 * @param streamId    the stream id | ||||
| 	 * @param generatorId the generator id | ||||
| 	 * @param begin       the begin | ||||
| 	 */ | ||||
| 	ScvTx(long id, long streamId, long generatorId, long begin) { | ||||
| 		this.id = id; | ||||
| 		this.streamId = streamId; | ||||
| 		this.generatorId = generatorId; | ||||
| 		this.beginTime = begin; | ||||
| 		this.endTime = begin; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the id. | ||||
| 	 * | ||||
| 	 * @return the id | ||||
| 	 */ | ||||
| 	Long getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| } | ||||
| @@ -1,242 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.nio.charset.CharsetDecoder; | ||||
| import java.util.Collection; | ||||
| import java.util.zip.GZIPInputStream | ||||
|  | ||||
| import org.codehaus.groovy.ast.stmt.CatchStatement | ||||
| import org.mapdb.DB | ||||
| import org.mapdb.DBMaker | ||||
|  | ||||
| import groovy.io.FileType | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType | ||||
| import com.minres.scviewer.database.DataType | ||||
| import com.minres.scviewer.database.ITxGenerator | ||||
| import com.minres.scviewer.database.ITxStream | ||||
| import com.minres.scviewer.database.IWaveform | ||||
| import com.minres.scviewer.database.IWaveformDb | ||||
| import com.minres.scviewer.database.IWaveformDbLoader | ||||
| import com.minres.scviewer.database.RelationType | ||||
|  | ||||
| public class TextDbLoader implements IWaveformDbLoader{ | ||||
|  | ||||
| 	private Long maxTime; | ||||
|  | ||||
| 	IWaveformDb db; | ||||
|  | ||||
| 	def streams = [] | ||||
|  | ||||
| 	def relationTypes=[:] | ||||
|  | ||||
| 	DB mapDb | ||||
| 	 | ||||
| 	public TextDbLoader() { | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Long getMaxTime() { | ||||
| 		return maxTime; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Collection<IWaveform> getAllWaves() { | ||||
| 		return streams; | ||||
| 	} | ||||
|  | ||||
| 	public Map<Long, ITxGenerator> getGeneratorsById() { | ||||
| 		TreeMap<Long, ITxGenerator> res = new TreeMap<Long, ITxGenerator>(); | ||||
| 		streams.each{TxStream stream -> stream.generators.each{res.put(it.id, id)} } | ||||
| 		return res; | ||||
| 	} | ||||
|  | ||||
| 	static final byte[] x = "scv_tr_stream".bytes | ||||
|  | ||||
| 	@Override | ||||
| 	boolean load(IWaveformDb db, File file) throws Exception { | ||||
| 		if(file.isDirectory() || !file.exists()) return false; | ||||
| 		this.db=db | ||||
| 		this.streams=[] | ||||
| 		try { | ||||
| 			def gzipped = isGzipped(file) | ||||
| 			if(isTxfile(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))){ | ||||
| 				def mapDbFile = File.createTempFile("."+file.name, "tmp", file.parentFile) | ||||
| 				mapDbFile.delete() | ||||
| 				mapDbFile.deleteOnExit() | ||||
| 				this.mapDb = DBMaker | ||||
| 				.fileDB(mapDbFile) | ||||
| 				.fileMmapEnableIfSupported() | ||||
| 				.fileMmapPreclearDisable() | ||||
| 				.cleanerHackEnable() | ||||
| 				.allocateStartSize(64*1024*1024) | ||||
| 				.allocateIncrement(64*1024*1024) | ||||
| 				.make() | ||||
| 				// NPE here ---> | ||||
| 				parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file)) | ||||
| 				streams.each{ TxStream  stream -> stream.getMaxConcurrency() } | ||||
| 				return true | ||||
| 			} | ||||
| 		} catch (IndexOutOfBoundsException e) { | ||||
| 			return false | ||||
| 		} catch (IllegalArgumentException e) { | ||||
| 			return false | ||||
| 		} catch (NumberFormatException e) { | ||||
| 			return false | ||||
| 		} catch(EOFException e) { | ||||
| 			return true; | ||||
| 		} catch(Exception e) { | ||||
| 			System.out.println("---->>> Exception "+e.toString()+" caught while loading database"); | ||||
| 			//System.out.println("---->>> Exception "+e.toString()+" caught while loading database. StackTrace following... "); | ||||
| 			//e.printStackTrace() | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	private static boolean isTxfile(InputStream istream) { | ||||
| 		byte[] buffer = new byte[x.size()] | ||||
| 		def readCnt = istream.read(buffer, 0, x.size()) | ||||
| 		istream.close() | ||||
| 		if(readCnt==x.size()){ | ||||
| 			for(int i=0; i<x.size(); i++) | ||||
| 				if(buffer[i]!=x[i]) return false | ||||
| 		} | ||||
| 		return true | ||||
| 	} | ||||
|  | ||||
| 	private static boolean isGzipped(File f) { | ||||
| 		InputStream is = null; | ||||
| 		try { | ||||
| 			is = new FileInputStream(f); | ||||
| 			byte [] signature = new byte[2]; | ||||
| 			int nread = is.read( signature ); //read the gzip signature | ||||
| 			return nread == 2 && signature[ 0 ] == (byte) 0x1f && signature[ 1 ] == (byte) 0x8b; | ||||
| 		} catch (IOException e) { | ||||
| 			return false; | ||||
| 		} finally { | ||||
| 			if(is!=null) is.close() | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	private stringToScale(String scale){ | ||||
| 		switch(scale.trim()){ | ||||
| 			case "fs":return 1L | ||||
| 			case "ps":return 1000L | ||||
| 			case "ns":return 1000000L | ||||
| 			case "us":return 1000000000L | ||||
| 			case "ms":return 1000000000000L | ||||
| 			case "s": return 1000000000000000L | ||||
| 		} | ||||
| 		return 1L | ||||
| 	} | ||||
| 	 | ||||
| 	private def parseInput(InputStream inputStream){ | ||||
| 		def streamsById = [:] | ||||
| 		def generatorsById = [:] | ||||
| 		def transactionsById = [:] | ||||
| 		TxGenerator generator | ||||
| 		Tx transaction | ||||
| 		boolean endTransaction=false | ||||
| 		def matcher | ||||
| 		BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); | ||||
| 		long lineCnt=0; | ||||
| 		reader.eachLine { line -> | ||||
| 			def tokens = line.split(/\s+/) as ArrayList | ||||
| 			switch(tokens[0]){ | ||||
| 				case "scv_tr_stream": | ||||
| 					if ((matcher = line =~ /^scv_tr_stream\s+\(ID (\d+),\s+name\s+"([^"]+)",\s+kind\s+"([^"]+)"\)$/)) { | ||||
| 						def id = Integer.parseInt(matcher[0][1]) | ||||
| 						def stream = new TxStream(this, id, matcher[0][2], matcher[0][3]) | ||||
| 						streams<<stream | ||||
| 						streamsById[id]=stream | ||||
| 					} | ||||
| 					break; | ||||
| 				case "scv_tr_generator": | ||||
| 					if ((matcher = line =~ /^scv_tr_generator\s+\(ID\s+(\d+),\s+name\s+"([^"]+)",\s+scv_tr_stream\s+(\d+),$/)) { | ||||
| 						def id = Integer.parseInt(matcher[0][1]) | ||||
| 						ITxStream stream=streamsById[Integer.parseInt(matcher[0][3])] | ||||
| 						generator=new TxGenerator(id, stream, matcher[0][2]) | ||||
| 						stream.generators<<generator | ||||
| 						generatorsById[id]=generator | ||||
| 					} | ||||
| 					break; | ||||
| 				case "begin_attribute": | ||||
| 					if ((matcher = line =~ /^begin_attribute \(ID (\d+), name "([^"]+)", type "([^"]+)"\)$/)) { | ||||
| 						generator.begin_attrs << TxAttributeType.getAttrType(matcher[0][2], DataType.valueOf(matcher[0][3]), AssociationType.BEGIN) | ||||
| 					} | ||||
| 					break; | ||||
| 				case "end_attribute": | ||||
| 					if ((matcher = line =~ /^end_attribute \(ID (\d+), name "([^"]+)", type "([^"]+)"\)$/)) { | ||||
| 						generator.end_attrs << TxAttributeType.getAttrType(matcher[0][2], DataType.valueOf(matcher[0][3]), AssociationType.END) | ||||
| 					} | ||||
| 					break; | ||||
| 				case ")": | ||||
| 					generator=null | ||||
| 					break | ||||
| 				case "tx_begin"://matcher = line =~ /^tx_begin\s+(\d+)\s+(\d+)\s+(\d+)\s+([munpf]?s)/ | ||||
| 					def id = Integer.parseInt(tokens[1]) | ||||
| 					TxGenerator gen=generatorsById[Integer.parseInt(tokens[2])] | ||||
| 					transaction = new Tx(id, gen.stream, gen, Long.parseLong(tokens[3])*stringToScale(tokens[4])) | ||||
| 					gen.transactions << transaction | ||||
| 					transactionsById[id]= transaction | ||||
| 					gen.begin_attrs_idx=0; | ||||
| 					maxTime = maxTime>transaction.beginTime?maxTime:transaction.beginTime | ||||
| 					endTransaction=false | ||||
| 					break | ||||
| 				case "tx_end"://matcher = line =~ /^tx_end\s+(\d+)\s+(\d+)\s+(\d+)\s+([munpf]?s)/ | ||||
| 					def id = Integer.parseInt(tokens[1]) | ||||
| 					transaction = transactionsById[id] | ||||
| 					assert Integer.parseInt(tokens[2])==transaction.generator.id | ||||
| 					transaction.endTime = Long.parseLong(tokens[3])*stringToScale(tokens[4]) | ||||
| 					transaction.generator.end_attrs_idx=0; | ||||
| 					maxTime = maxTime>transaction.endTime?maxTime:transaction.endTime | ||||
| 					endTransaction=true | ||||
| 					break | ||||
| 				case "tx_record_attribute"://matcher = line =~ /^tx_record_attribute\s+(\d+)\s+"([^"]+)"\s+(\S+)\s*=\s*(.+)$/ | ||||
| 					def id = Integer.parseInt(tokens[1]) | ||||
| 					def name = tokens[2][1..-2] | ||||
| 					def type = tokens[3] as DataType | ||||
| 					def remaining = tokens.size()>5?tokens[5..-1].join(' '):"" | ||||
| 					transactionsById[id].attributes<<new TxAttribute(name, type, AssociationType.RECORD, remaining) | ||||
| 					break | ||||
| 				case "a"://matcher = line =~ /^a\s+(.+)$/ | ||||
| 					if(endTransaction){ | ||||
| 						transaction.attributes << new TxAttribute(transaction.generator.end_attrs[transaction.generator.end_attrs_idx], tokens[1]) | ||||
| 						transaction.generator.end_attrs_idx++ | ||||
| 					} else { | ||||
| 						transaction.attributes << new TxAttribute(transaction.generator.begin_attrs[transaction.generator.begin_attrs_idx], tokens[1]) | ||||
| 						transaction.generator.begin_attrs_idx++ | ||||
| 					} | ||||
| 					break | ||||
| 				case "tx_relation"://matcher = line =~ /^tx_relation\s+\"(\S+)\"\s+(\d+)\s+(\d+)$/ | ||||
| 					Tx tr2= transactionsById[Integer.parseInt(tokens[2])] | ||||
| 					Tx tr1= transactionsById[Integer.parseInt(tokens[3])] | ||||
| 					def relType=tokens[1][1..-2] | ||||
| 					if(!relationTypes.containsKey(relType)) relationTypes[relType]=RelationType.create(relType) | ||||
| 					def rel = new TxRelation(relationTypes[relType], tr1, tr2) | ||||
| 					tr1.outgoingRelations<<rel | ||||
| 					tr2.incomingRelations<<rel | ||||
| 					break | ||||
| 				default: | ||||
| 					println "Don't know what to do with: '$line'" | ||||
|  | ||||
| 			} | ||||
| 			lineCnt++ | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public Collection<RelationType> getAllRelationTypes(){ | ||||
| 		return relationTypes.values(); | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
| @@ -0,0 +1,552 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.beans.PropertyChangeListener; | ||||
| import java.beans.PropertyChangeSupport; | ||||
| import java.io.BufferedReader; | ||||
| import java.io.File; | ||||
| import java.io.FileInputStream; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.io.InputStreamReader; | ||||
| import java.nio.charset.StandardCharsets; | ||||
| import java.nio.file.Files; | ||||
| import java.nio.file.Paths; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
| import java.util.Collection; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.regex.Matcher; | ||||
| import java.util.regex.Pattern; | ||||
| import java.util.zip.GZIPInputStream; | ||||
|  | ||||
| import org.eclipse.collections.impl.map.mutable.UnifiedMap; | ||||
| import org.mapdb.DB; | ||||
| import org.mapdb.DB.TreeMapSink; | ||||
| import org.mapdb.DBMaker; | ||||
| import org.mapdb.Serializer; | ||||
|  | ||||
| import com.google.common.collect.HashMultimap; | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.DataType; | ||||
| import com.minres.scviewer.database.EventKind; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.IWaveformDb; | ||||
| import com.minres.scviewer.database.IWaveformDbLoader; | ||||
| import com.minres.scviewer.database.InputFormatException; | ||||
| import com.minres.scviewer.database.RelationType; | ||||
| import com.minres.scviewer.database.RelationTypeFactory; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
|  | ||||
| /** | ||||
|  * The Class TextDbLoader. | ||||
|  */ | ||||
| public class TextDbLoader implements IWaveformDbLoader { | ||||
|  | ||||
| 	/** The max time. */ | ||||
| 	private Long maxTime = 0L; | ||||
|  | ||||
| 	/** The map db. */ | ||||
| 	DB mapDb = null; | ||||
|  | ||||
| 	/** The attr values. */ | ||||
| 	final List<String> attrValues = new ArrayList<>(); | ||||
|  | ||||
| 	/** The relation types. */ | ||||
| 	final Map<String, RelationType> relationTypes = UnifiedMap.newMap(); | ||||
|  | ||||
| 	/** The tx streams. */ | ||||
| 	final Map<Long, TxStream> txStreams = UnifiedMap.newMap(); | ||||
|  | ||||
| 	/** The tx generators. */ | ||||
| 	final Map<Long, TxGenerator> txGenerators = UnifiedMap.newMap(); | ||||
|  | ||||
| 	/** The transactions. */ | ||||
| 	Map<Long, ScvTx> transactions = null; | ||||
|  | ||||
| 	Map<Long, Long> id2index = new HashMap<>(); | ||||
| 	 | ||||
| 	/** The attribute types. */ | ||||
| 	final Map<String, TxAttributeType> attributeTypes = UnifiedMap.newMap(); | ||||
|  | ||||
| 	/** The relations in. */ | ||||
| 	final HashMultimap<Long, ScvRelation> relationsIn = HashMultimap.create(); | ||||
|  | ||||
| 	/** The relations out. */ | ||||
| 	final HashMultimap<Long, ScvRelation> relationsOut = HashMultimap.create(); | ||||
|  | ||||
| 	/** The tx cache. */ | ||||
| 	HashMap<Long, Tx> txCache = new HashMap<>(); | ||||
|  | ||||
| 	/** The threads. */ | ||||
| 	List<Thread> threads = new ArrayList<>(); | ||||
|  | ||||
| 	/** The pcs. */ | ||||
| 	protected PropertyChangeSupport pcs = new PropertyChangeSupport(this); | ||||
|  | ||||
| 	/** The Constant x. */ | ||||
| 	static final byte[] x = "scv_tr_stream".getBytes(); | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the max time. | ||||
| 	 * | ||||
| 	 * @return the max time | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Long getMaxTime() { | ||||
| 		return maxTime; | ||||
| 	} | ||||
|  | ||||
| 	public ScvTx getScvTx(long id) { | ||||
| 		return transactions.get(id2index.get(id)); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the all waves. | ||||
| 	 * | ||||
| 	 * @return the all waves | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Collection<IWaveform> getAllWaves() { | ||||
| 		return new ArrayList<>(txStreams.values()); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Can load. | ||||
| 	 * | ||||
| 	 * @param inputFile the input file | ||||
| 	 * @return true, if successful | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public boolean canLoad(File inputFile) { | ||||
| 		if (!inputFile.isDirectory() && inputFile.exists()) { | ||||
| 			boolean gzipped = isGzipped(inputFile); | ||||
| 			try(InputStream stream = gzipped ? new GZIPInputStream(new FileInputStream(inputFile)) : new FileInputStream(inputFile)){ | ||||
| 				byte[] buffer = new byte[x.length]; | ||||
| 				int readCnt = stream.read(buffer, 0, x.length); | ||||
| 				if (readCnt == x.length) { | ||||
| 					for (int i = 0; i < x.length; i++) | ||||
| 						if (buffer[i] != x[i]) | ||||
| 							return false; | ||||
| 				} | ||||
| 				return true; | ||||
| 			} catch (Exception e) { | ||||
| 				return false; | ||||
| 			} | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Load. | ||||
| 	 * | ||||
| 	 * @param db   the db | ||||
| 	 * @param file the file | ||||
| 	 * @return true, if successful | ||||
| 	 * @throws InputFormatException the input format exception | ||||
| 	 */ | ||||
| 	@SuppressWarnings("unchecked") | ||||
| 	@Override | ||||
| 	public void load(IWaveformDb db, File file) throws InputFormatException { | ||||
| 		dispose(); | ||||
| 		boolean gzipped = isGzipped(file); | ||||
| 		if (file.length() < 75000000 * (gzipped ? 1 : 10) | ||||
| 				|| "memory".equals(System.getProperty("ScvBackingDB", "file"))) | ||||
| 			mapDb = DBMaker.memoryDirectDB().allocateStartSize(512l * 1024l * 1024l) | ||||
| 					.allocateIncrement(128l * 1024l * 1024l).cleanerHackEnable().make(); | ||||
| 		else { | ||||
| 			File mapDbFile; | ||||
| 			try { | ||||
| 				mapDbFile = File.createTempFile("." + file.getName(), ".mapdb", null /* file.parentFile */); | ||||
| 				Files.delete(Paths.get(mapDbFile.getPath())); | ||||
| 			} catch (IOException e) { | ||||
| 				throw new InputFormatException(e.toString()); | ||||
| 			} | ||||
| 			mapDb = DBMaker.fileDB(mapDbFile).fileMmapEnable() // Always enable mmap | ||||
| 					.fileMmapEnableIfSupported().fileMmapPreclearDisable().allocateStartSize(512l * 1024l * 1024l) | ||||
| 					.allocateIncrement(128l * 1024l * 1024l).cleanerHackEnable().make(); | ||||
| 			mapDbFile.deleteOnExit(); | ||||
| 		} | ||||
| 		TextDbParser parser = new TextDbParser(this); | ||||
| 		try { | ||||
| 			parser.txSink = mapDb.treeMap("transactions", Serializer.LONG, Serializer.JAVA).createFromSink(); | ||||
| 			parser.parseInput(gzipped ? new GZIPInputStream(new FileInputStream(file)) : new FileInputStream(file)); | ||||
| 			transactions = parser.txSink.create(); | ||||
| 		} catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) { | ||||
| 		} catch (Exception e) { | ||||
| 			throw new InputFormatException(e.toString()); | ||||
| 		} | ||||
| 		for (TxStream stream : txStreams.values()) { | ||||
| 			Thread t = new Thread() { | ||||
| 				@Override | ||||
| 				public void run() { | ||||
| 					try { | ||||
| 						stream.calculateConcurrency(); | ||||
| 					} catch (Exception e) { | ||||
| 						/* don't let exceptions bubble up */ } | ||||
| 				} | ||||
| 			}; | ||||
| 			threads.add(t); | ||||
| 			t.start(); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Dispose. | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public void dispose() { | ||||
| 		attrValues.clear(); | ||||
| 		relationTypes.clear(); | ||||
| 		txStreams.clear(); | ||||
| 		txGenerators.clear(); | ||||
| 		transactions = null; | ||||
| 		attributeTypes.clear(); | ||||
| 		relationsIn.clear(); | ||||
| 		relationsOut.clear(); | ||||
| 		if (mapDb != null) { | ||||
| 			mapDb.close(); | ||||
| 			mapDb = null; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Checks if is gzipped. | ||||
| 	 * | ||||
| 	 * @param f the f | ||||
| 	 * @return true, if is gzipped | ||||
| 	 */ | ||||
| 	private static boolean isGzipped(File f) { | ||||
| 		try (InputStream is = new FileInputStream(f)) { | ||||
| 			byte[] signature = new byte[2]; | ||||
| 			int nread = is.read(signature); // read the gzip signature | ||||
| 			return nread == 2 && signature[0] == (byte) 0x1f && signature[1] == (byte) 0x8b; | ||||
| 		} catch (IOException e) { | ||||
| 			return false; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the all relation types. | ||||
| 	 * | ||||
| 	 * @return the all relation types | ||||
| 	 */ | ||||
| 	public Collection<RelationType> getAllRelationTypes() { | ||||
| 		return relationTypes.values(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * The Class TextDbParser. | ||||
| 	 */ | ||||
| 	static class TextDbParser { | ||||
|  | ||||
| 		/** The Constant scv_tr_stream. */ | ||||
| 		static final Pattern scv_tr_stream = Pattern | ||||
| 				.compile("^scv_tr_stream\\s+\\(ID (\\d+),\\s+name\\s+\"([^\"]+)\",\\s+kind\\s+\"([^\"]+)\"\\)$"); | ||||
|  | ||||
| 		/** The Constant scv_tr_generator. */ | ||||
| 		static final Pattern scv_tr_generator = Pattern | ||||
| 				.compile("^scv_tr_generator\\s+\\(ID\\s+(\\d+),\\s+name\\s+\"([^\"]+)\",\\s+scv_tr_stream\\s+(\\d+),$"); | ||||
|  | ||||
| 		/** The Constant begin_attribute. */ | ||||
| 		static final Pattern begin_attribute = Pattern | ||||
| 				.compile("^begin_attribute \\(ID (\\d+), name \"([^\"]+)\", type \"([^\"]+)\"\\)$"); | ||||
|  | ||||
| 		/** The Constant end_attribute. */ | ||||
| 		static final Pattern end_attribute = Pattern | ||||
| 				.compile("^end_attribute \\(ID (\\d+), name \"([^\"]+)\", type \"([^\"]+)\"\\)$"); | ||||
|  | ||||
| 		/** The loader. */ | ||||
| 		final TextDbLoader loader; | ||||
|  | ||||
| 		/** The transaction by id. */ | ||||
| 		HashMap<Long, ScvTx> transactionById = new HashMap<>(); | ||||
|  | ||||
| 		/** The tx sink. */ | ||||
| 		TreeMapSink<Long, ScvTx> txSink; | ||||
|  | ||||
| 		/** The reader. */ | ||||
| 		BufferedReader reader = null; | ||||
|  | ||||
| 		/** The generator. */ | ||||
| 		TxGenerator generator = null; | ||||
|  | ||||
| 		/** The attr value lut. */ | ||||
| 		Map<String, Integer> attrValueLut = new HashMap<>(); | ||||
|  | ||||
| 		long indexCount = 0; | ||||
| 		/** | ||||
| 		 * Instantiates a new text db parser. | ||||
| 		 * | ||||
| 		 * @param loader the loader | ||||
| 		 */ | ||||
| 		public TextDbParser(TextDbLoader loader) { | ||||
| 			super(); | ||||
| 			this.loader = loader; | ||||
| 		} | ||||
|  | ||||
| 		/** | ||||
| 		 * Parses the input. | ||||
| 		 * | ||||
| 		 * @param inputStream the input stream | ||||
| 		 * @throws IOException Signals that an I/O exception has occurred. | ||||
| 		 * @throws InputFormatException Signals that the input format is wrong | ||||
| 		 */ | ||||
| 		void parseInput(InputStream inputStream) throws IOException, InputFormatException { | ||||
| 			reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); | ||||
| 			String curLine = reader.readLine(); | ||||
| 			String nextLine = null; | ||||
| 			while ((nextLine = reader.readLine()) != null && curLine != null) { | ||||
| 				curLine = parseLine(curLine, nextLine); | ||||
| 			} | ||||
| 			if (curLine != null) | ||||
| 				parseLine(curLine, nextLine); | ||||
| 		} | ||||
|  | ||||
| 		/** | ||||
| 		 * Gets the attr type. | ||||
| 		 * | ||||
| 		 * @param name     the name | ||||
| 		 * @param dataType the data type | ||||
| 		 * @param type     the type | ||||
| 		 * @return the attr type | ||||
| 		 */ | ||||
| 		private TxAttributeType getAttrType(String name, DataType dataType, AssociationType type) { | ||||
| 			String key = name + "-" + dataType.toString(); | ||||
| 			TxAttributeType res; | ||||
| 			if (loader.attributeTypes.containsKey(key)) { | ||||
| 				res = loader.attributeTypes.get(key); | ||||
| 			} else { | ||||
| 				res = new TxAttributeType(name, dataType, type); | ||||
| 				loader.attributeTypes.put(key, res); | ||||
| 			} | ||||
| 			return res; | ||||
| 		} | ||||
|  | ||||
| 		/** | ||||
| 		 * Parses the line. | ||||
| 		 * | ||||
| 		 * @param curLine  the cur line | ||||
| 		 * @param nextLine the next line | ||||
| 		 * @return the string | ||||
| 		 * @throws IOException Signals that an I/O exception has occurred. | ||||
| 		 * @throws InputFormatException Signals that the input format is wrong | ||||
| 		 */ | ||||
| 		private String parseLine(String curLine, String nextLine) throws IOException, InputFormatException { | ||||
| 			String[] tokens = curLine.split("\\s+"); | ||||
| 			if ("tx_record_attribute".equals(tokens[0])) { | ||||
| 				Long id = Long.parseLong(tokens[1]); | ||||
| 				String name = tokens[2].substring(1, tokens[2].length()); | ||||
| 				DataType type = DataType.valueOf(tokens[3]); | ||||
| 				String remaining = tokens.length > 5 ? String.join(" ", Arrays.copyOfRange(tokens, 5, tokens.length)) | ||||
| 						: ""; | ||||
| 				TxAttributeType attrType = getAttrType(name, type, AssociationType.RECORD); | ||||
| 				transactionById.get(id).attributes.add(new TxAttribute(attrType, getAttrString(attrType, remaining))); | ||||
| 			} else if ("tx_begin".equals(tokens[0])) { | ||||
| 				Long id = Long.parseLong(tokens[1]); | ||||
| 				Long genId = Long.parseLong(tokens[2]); | ||||
| 				TxGenerator gen = loader.txGenerators.get(genId); | ||||
| 				ScvTx scvTx = new ScvTx(id, gen.stream.getId(), genId, | ||||
| 						Long.parseLong(tokens[3]) * stringToScale(tokens[4])); | ||||
| 				loader.maxTime = loader.maxTime > scvTx.beginTime ? loader.maxTime : scvTx.beginTime; | ||||
| 				TxStream stream = loader.txStreams.get(gen.stream.getId()); | ||||
| 				stream.setConcurrency(stream.getConcurrency() + 1); | ||||
| 				if (nextLine != null && nextLine.charAt(0) == 'a') { | ||||
| 					int idx = 0; | ||||
| 					while (nextLine != null && nextLine.charAt(0) == 'a') { | ||||
| 						String[] attrTokens = nextLine.split("\\s+"); | ||||
| 						TxAttributeType attrType = gen.beginAttrs.get(idx); | ||||
| 						TxAttribute attr = new TxAttribute(attrType, getAttrString(attrType, attrTokens[1])); | ||||
| 						scvTx.attributes.add(attr); | ||||
| 						idx++; | ||||
| 						nextLine = reader.readLine(); | ||||
| 					} | ||||
| 				} | ||||
| 				transactionById.put(id, scvTx); | ||||
| 			} else if ("tx_end".equals(tokens[0])) { | ||||
| 				Long id = Long.parseLong(tokens[1]); | ||||
| 				ScvTx scvTx = transactionById.get(id); | ||||
| 				assert Long.parseLong(tokens[2]) == scvTx.generatorId; | ||||
| 				scvTx.endTime = Long.parseLong(tokens[3]) * stringToScale(tokens[4]); | ||||
| 				loader.maxTime = loader.maxTime > scvTx.endTime ? loader.maxTime : scvTx.endTime; | ||||
| 				TxGenerator gen = loader.txGenerators.get(scvTx.generatorId); | ||||
| 				TxStream stream = loader.txStreams.get(gen.stream.getId()); | ||||
| 				if (scvTx.beginTime == scvTx.endTime) { | ||||
| 					TxEvent evt = new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime); | ||||
| 					stream.addEvent(evt); | ||||
| 					gen.addEvent(evt); | ||||
| 				} else { | ||||
| 					TxEvent begEvt = new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime); | ||||
| 					stream.addEvent(begEvt); | ||||
| 					gen.addEvent(begEvt); | ||||
| 					TxEvent endEvt = new TxEvent(loader, EventKind.END, id, scvTx.endTime); | ||||
| 					stream.addEvent(endEvt); | ||||
| 					gen.addEvent(endEvt); | ||||
| 				} | ||||
| 				stream.setConcurrency(stream.getConcurrency() - 1); | ||||
| 				if (nextLine != null && nextLine.charAt(0) == 'a') { | ||||
| 					int idx = 0; | ||||
| 					while (nextLine != null && nextLine.charAt(0) == 'a') { | ||||
| 						String[] attrTokens = nextLine.split("\\s+"); | ||||
| 						TxAttributeType attrType = gen.endAttrs.get(idx); | ||||
| 						TxAttribute attr = new TxAttribute(attrType, getAttrString(attrType, attrTokens[1])); | ||||
| 						scvTx.attributes.add(attr); | ||||
| 						idx++; | ||||
| 						nextLine = reader.readLine(); | ||||
| 					} | ||||
| 				} | ||||
| 				txSink.put(indexCount, scvTx); | ||||
| 				loader.id2index.put(scvTx.getId(), indexCount++); | ||||
| 				transactionById.remove(id); | ||||
| 			} else if ("tx_relation".equals(tokens[0])) { | ||||
| 				Long tr2 = Long.parseLong(tokens[2]); | ||||
| 				Long tr1 = Long.parseLong(tokens[3]); | ||||
| 				String relType = tokens[1].substring(1, tokens[1].length() - 1); | ||||
| 				if (!loader.relationTypes.containsKey(relType)) | ||||
| 					loader.relationTypes.put(relType, RelationTypeFactory.create(relType)); | ||||
| 				ScvRelation rel = new ScvRelation(loader.relationTypes.get(relType), tr1, tr2); | ||||
| 				loader.relationsOut.put(tr1, rel); | ||||
| 				loader.relationsIn.put(tr2, rel); | ||||
| 			} else if ("scv_tr_stream".equals(tokens[0])) { | ||||
| 				Matcher matcher = scv_tr_stream.matcher(curLine); | ||||
| 				if (matcher.matches()) { | ||||
| 					Long id = Long.parseLong(matcher.group(1)); | ||||
| 					TxStream stream = new TxStream(loader, id, matcher.group(2), matcher.group(3)); | ||||
| 					add(id, stream); | ||||
| 				} | ||||
| 			} else if ("scv_tr_generator".equals(tokens[0])) { | ||||
| 				Matcher matcher = scv_tr_generator.matcher(curLine); | ||||
| 				if ((matcher.matches())) { | ||||
| 					Long id = Long.parseLong(matcher.group(1)); | ||||
| 					TxStream stream = loader.txStreams.get(Long.parseLong(matcher.group(3))); | ||||
| 					generator = new TxGenerator(loader, id, matcher.group(2), stream); | ||||
| 					add(id, generator); | ||||
| 				} | ||||
| 			} else if ("begin_attribute".equals(tokens[0])) { | ||||
| 				Matcher matcher = begin_attribute.matcher(curLine); | ||||
| 				if ((matcher.matches())) { | ||||
| 					TxAttributeType attrType = getAttrType(matcher.group(2), DataType.valueOf(matcher.group(3)), | ||||
| 							AssociationType.BEGIN); | ||||
| 					generator.beginAttrs.add(attrType); | ||||
| 				} | ||||
| 			} else if ("end_attribute".equals(tokens[0])) { | ||||
| 				Matcher matcher = end_attribute.matcher(curLine); | ||||
| 				if ((matcher.matches())) { | ||||
| 					TxAttributeType attrType = getAttrType(matcher.group(2), DataType.valueOf(matcher.group(3)), | ||||
| 							AssociationType.END); | ||||
| 					generator.endAttrs.add(attrType); | ||||
| 				} | ||||
| 			} else if (")".equals(tokens[0])) { | ||||
| 				generator = null; | ||||
| 			} else | ||||
| 				throw new InputFormatException("Don't know what to do with: '" + curLine + "'"); | ||||
| 			return nextLine; | ||||
| 		} | ||||
|  | ||||
| 		/** | ||||
| 		 * Gets the attr string. | ||||
| 		 * | ||||
| 		 * @param attrType the attr type | ||||
| 		 * @param string   the string | ||||
| 		 * @return the attr string | ||||
| 		 */ | ||||
| 		private String getAttrString(TxAttributeType attrType, String string) { | ||||
| 			String value; | ||||
| 			switch (attrType.getDataType()) { | ||||
| 			case STRING: | ||||
| 			case ENUMERATION: | ||||
| 				value = string.substring(1, string.length() - 1); | ||||
| 				break; | ||||
| 			default: | ||||
| 				value = string; | ||||
| 			} | ||||
| 			if (attrValueLut.containsKey(value)) { | ||||
| 				return loader.attrValues.get(attrValueLut.get(value)); | ||||
| 			} else { | ||||
| 				attrValueLut.put(value, loader.attrValues.size()); | ||||
| 				loader.attrValues.add(value); | ||||
| 				return value; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		/** | ||||
| 		 * String to scale. | ||||
| 		 * | ||||
| 		 * @param scale the scale | ||||
| 		 * @return the long | ||||
| 		 */ | ||||
| 		private long stringToScale(String scale) { | ||||
| 			String cmp = scale.trim(); | ||||
| 			if ("fs".equals(cmp)) | ||||
| 				return 1L; | ||||
| 			if ("ps".equals(cmp)) | ||||
| 				return 1000L; | ||||
| 			if ("ns".equals(cmp)) | ||||
| 				return 1000000L; | ||||
| 			if ("us".equals(cmp)) | ||||
| 				return 1000000000L; | ||||
| 			if ("ms".equals(cmp)) | ||||
| 				return 1000000000000L; | ||||
| 			if ("s".equals(cmp)) | ||||
| 				return 1000000000000000L; | ||||
| 			return 1L; | ||||
| 		} | ||||
| 		private void add(Long id, TxStream stream) { | ||||
| 			loader.txStreams.put(id, stream); | ||||
| 			loader.pcs.firePropertyChange(IWaveformDbLoader.STREAM_ADDED, null, stream); | ||||
| 		} | ||||
|  | ||||
| 		private void add(Long id, TxGenerator generator) { | ||||
| 			loader.txGenerators.put(id, generator); | ||||
| 			loader.pcs.firePropertyChange(IWaveformDbLoader.GENERATOR_ADDED, null, generator); | ||||
| 		} | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the transaction. | ||||
| 	 * | ||||
| 	 * @param txId the tx id | ||||
| 	 * @return the transaction | ||||
| 	 */ | ||||
| 	public ITx getTransaction(long txId) { | ||||
| 		if (txCache.containsKey(txId)) | ||||
| 			return txCache.get(txId); | ||||
| 		Tx tx = new Tx(this, txId); | ||||
| 		txCache.put(txId, tx); | ||||
| 		return tx; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Adds the property change listener. | ||||
| 	 * | ||||
| 	 * @param l the l | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public void addPropertyChangeListener(PropertyChangeListener l) { | ||||
| 		pcs.addPropertyChangeListener(l); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Removes the property change listener. | ||||
| 	 * | ||||
| 	 * @param l the l | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public void removePropertyChangeListener(PropertyChangeListener l) { | ||||
| 		pcs.removePropertyChangeListener(l); | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -1,67 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text | ||||
|  | ||||
| import com.minres.scviewer.database.* | ||||
|  | ||||
| class Tx implements ITx { | ||||
| 	 | ||||
| 	Long id | ||||
| 	 | ||||
| 	TxGenerator generator | ||||
|  | ||||
| 	TxStream stream | ||||
| 	 | ||||
| 	int concurrencyIndex | ||||
| 	 | ||||
| 	Long beginTime | ||||
| 	 | ||||
| 	Long endTime | ||||
| 	 | ||||
| 	ArrayList<ITxAttribute> attributes = new ArrayList<ITxAttribute>() | ||||
| 	 | ||||
| 	def incomingRelations =[] | ||||
| 	 | ||||
| 	def outgoingRelations =[] | ||||
| 	 | ||||
| 	Tx(int id, TxStream stream, TxGenerator generator, Long begin){ | ||||
| 		this.id=id | ||||
| 		this.stream=stream | ||||
| 		this.generator=generator | ||||
| 		this.beginTime=begin | ||||
|         this.endTime=begin | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public Collection<ITxRelation> getIncomingRelations() { | ||||
| 		return incomingRelations; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Collection<ITxRelation> getOutgoingRelations() { | ||||
| 		return outgoingRelations; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public int compareTo(ITx o) { | ||||
| 		def res =beginTime.compareTo(o.beginTime) | ||||
| 		if(res!=0)  | ||||
| 			return res | ||||
| 		else | ||||
| 			return id.compareTo(o.id) | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String toString() { | ||||
| 		return "tx#"+getId()+"["+getBeginTime()/1000000+"ns - "+getEndTime()/1000000+"ns]"; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,231 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Set; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxAttribute; | ||||
| import com.minres.scviewer.database.tx.ITxGenerator; | ||||
| import com.minres.scviewer.database.tx.ITxRelation; | ||||
|  | ||||
| /** | ||||
|  * The Class Tx. | ||||
|  */ | ||||
| class Tx implements ITx { | ||||
|  | ||||
| 	/** The loader. */ | ||||
| 	private final TextDbLoader loader; | ||||
|  | ||||
| 	/** The id. */ | ||||
| 	private long id; | ||||
|  | ||||
| 	/** The begin time. */ | ||||
| 	long beginTime = -1; | ||||
|  | ||||
| 	/** The end time. */ | ||||
| 	long endTime = -1; | ||||
|  | ||||
| 	/** The concurrency index. */ | ||||
| 	private int concurrencyIndex; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx. | ||||
| 	 * | ||||
| 	 * @param loader the loader | ||||
| 	 * @param scvTx  the scv tx | ||||
| 	 */ | ||||
| 	public Tx(TextDbLoader loader, ScvTx scvTx) { | ||||
| 		this.loader = loader; | ||||
| 		id = scvTx.id; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx. | ||||
| 	 * | ||||
| 	 * @param loader the loader | ||||
| 	 * @param txId   the tx id | ||||
| 	 */ | ||||
| 	public Tx(TextDbLoader loader, long txId) { | ||||
| 		this.loader = loader; | ||||
| 		id = txId; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the incoming relations. | ||||
| 	 * | ||||
| 	 * @return the incoming relations | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Collection<ITxRelation> getIncomingRelations() { | ||||
| 		Set<ScvRelation> rels = loader.relationsIn.get(id); | ||||
| 		return rels.stream().map(rel -> new TxRelation(loader, rel)).collect(Collectors.toList()); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the outgoing relations. | ||||
| 	 * | ||||
| 	 * @return the outgoing relations | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Collection<ITxRelation> getOutgoingRelations() { | ||||
| 		Set<ScvRelation> rels = loader.relationsOut.get(id); | ||||
| 		return rels.stream().map(rel -> new TxRelation(loader, rel)).collect(Collectors.toList()); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Compare to. | ||||
| 	 * | ||||
| 	 * @param o the o | ||||
| 	 * @return the int | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public int compareTo(ITx o) { | ||||
| 		int res = getBeginTime().compareTo(o.getBeginTime()); | ||||
| 		if (res != 0) | ||||
| 			return res; | ||||
| 		else | ||||
| 			return getId().compareTo(o.getId()); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Equals. | ||||
| 	 * | ||||
| 	 * @param obj the obj | ||||
| 	 * @return true, if successful | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public boolean equals(Object obj) { | ||||
| 		if (this == obj) | ||||
| 			return true; | ||||
| 		if (obj == null || getClass() != obj.getClass()) | ||||
| 			return false; | ||||
| 		return this.loader.getScvTx(id).equals(((Tx) obj).loader.getScvTx(id)); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Hash code. | ||||
| 	 * | ||||
| 	 * @return the int | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public int hashCode() { | ||||
| 		return loader.getScvTx(id).hashCode(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * To string. | ||||
| 	 * | ||||
| 	 * @return the string | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public String toString() { | ||||
| 		return "tx#" + getId() + "[" + getBeginTime() / 1000000 + "ns - " + getEndTime() / 1000000 + "ns]"; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the id. | ||||
| 	 * | ||||
| 	 * @return the id | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Long getId() { | ||||
| 		return loader.getScvTx(id).id; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the stream. | ||||
| 	 * | ||||
| 	 * @return the stream | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public IWaveform getStream() { | ||||
| 		return loader.txStreams.get(loader.getScvTx(id).streamId); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the generator. | ||||
| 	 * | ||||
| 	 * @return the generator | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public ITxGenerator getGenerator() { | ||||
| 		return loader.txGenerators.get(loader.getScvTx(id).generatorId); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the begin time. | ||||
| 	 * | ||||
| 	 * @return the begin time | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Long getBeginTime() { | ||||
| 		if (beginTime < 0) | ||||
| 			beginTime = loader.getScvTx(id).beginTime; | ||||
| 		return beginTime; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the end time. | ||||
| 	 * | ||||
| 	 * @return the end time | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Long getEndTime() { | ||||
| 		if (endTime < 0) | ||||
| 			endTime = loader.getScvTx(id).endTime; | ||||
| 		return endTime; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Sets the end time. | ||||
| 	 * | ||||
| 	 * @param time the new end time | ||||
| 	 */ | ||||
| 	void setEndTime(Long time) { | ||||
| 		loader.getScvTx(id).endTime = time; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the concurrency index. | ||||
| 	 * | ||||
| 	 * @return the concurrency index | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public int getConcurrencyIndex() { | ||||
| 		return concurrencyIndex; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Sets the concurrency index. | ||||
| 	 * | ||||
| 	 * @param idx the new concurrency index | ||||
| 	 */ | ||||
| 	void setConcurrencyIndex(int idx) { | ||||
| 		concurrencyIndex = idx; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the attributes. | ||||
| 	 * | ||||
| 	 * @return the attributes | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public List<ITxAttribute> getAttributes() { | ||||
| 		return loader.getScvTx(id).attributes; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -1,59 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.DataType; | ||||
| import com.minres.scviewer.database.ITxAttributeType; | ||||
| import com.minres.scviewer.database.ITxAttribute | ||||
|  | ||||
| class TxAttribute  implements ITxAttribute{ | ||||
| 	 | ||||
| 	TxAttributeType attributeType | ||||
|  | ||||
| 	def value | ||||
| 	 | ||||
| 	TxAttribute(String name, DataType dataType, AssociationType type, value){ | ||||
| 		attributeType = TxAttributeTypeFactory.instance.getAttrType(name, dataType, type) | ||||
| 		switch(dataType){ | ||||
| 			case DataType.STRING: | ||||
| 			case DataType.ENUMERATION: | ||||
| 				this.value=value[1..-2] | ||||
| 				break; | ||||
| 			default: | ||||
| 				this.value=value | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	TxAttribute(TxAttributeType other){ | ||||
| 		attributeType=other | ||||
| 	} | ||||
| 	 | ||||
| 	TxAttribute(TxAttributeType other, value){ | ||||
| 		this(other.name, other.dataType, other.type, value) | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public String getName() { | ||||
| 		return attributeType.getName(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public AssociationType getType() { | ||||
| 		attributeType.type; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public DataType getDataType() { | ||||
| 		attributeType.dataType; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,85 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.DataType; | ||||
| import com.minres.scviewer.database.tx.ITxAttribute; | ||||
|  | ||||
| /** | ||||
|  * The Class TxAttribute. | ||||
|  */ | ||||
| public class TxAttribute implements ITxAttribute, Serializable { | ||||
|  | ||||
| 	/** The Constant serialVersionUID. */ | ||||
| 	private static final long serialVersionUID = 4767726016651807152L; | ||||
|  | ||||
| 	/** The attribute type. */ | ||||
| 	private final TxAttributeType attributeType; | ||||
|  | ||||
| 	/** The value. */ | ||||
| 	private final String value; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx attribute. | ||||
| 	 * | ||||
| 	 * @param type  the type | ||||
| 	 * @param value the value | ||||
| 	 */ | ||||
| 	TxAttribute(TxAttributeType type, String value) { | ||||
| 		this.attributeType = type; | ||||
| 		this.value = value; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the name. | ||||
| 	 * | ||||
| 	 * @return the name | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public String getName() { | ||||
| 		return attributeType.getName(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the type. | ||||
| 	 * | ||||
| 	 * @return the type | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public AssociationType getType() { | ||||
| 		return attributeType.getType(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the data type. | ||||
| 	 * | ||||
| 	 * @return the data type | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public DataType getDataType() { | ||||
| 		return attributeType.getDataType(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the value. | ||||
| 	 * | ||||
| 	 * @return the value | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Object getValue() { | ||||
| 		return value; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -1,31 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.DataType; | ||||
| import com.minres.scviewer.database.ITxAttributeType; | ||||
|  | ||||
| class TxAttributeType implements ITxAttributeType { | ||||
| 	String name | ||||
| 	DataType dataType | ||||
| 	AssociationType type | ||||
| 	 | ||||
| 	static TxAttributeType getAttrType(String name, DataType dataType, AssociationType type){ | ||||
| 		TxAttributeTypeFactory.instance.getAttrType(name, dataType, type) | ||||
| 	} | ||||
| 	 | ||||
| 	TxAttributeType(String name, DataType dataType, AssociationType type){ | ||||
| 		this.name=name | ||||
| 		this.dataType=dataType | ||||
| 		this.type=type | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,79 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.io.Serializable; | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.DataType; | ||||
| import com.minres.scviewer.database.tx.ITxAttributeType; | ||||
|  | ||||
| /** | ||||
|  * The Class TxAttributeType. | ||||
|  */ | ||||
| class TxAttributeType implements ITxAttributeType, Serializable { | ||||
|  | ||||
| 	/** The Constant serialVersionUID. */ | ||||
| 	private static final long serialVersionUID = 7159721937208946828L; | ||||
|  | ||||
| 	/** The name. */ | ||||
| 	private String name; | ||||
|  | ||||
| 	/** The data type. */ | ||||
| 	private DataType dataType; | ||||
|  | ||||
| 	/** The type. */ | ||||
| 	private AssociationType type; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx attribute type. | ||||
| 	 * | ||||
| 	 * @param name     the name | ||||
| 	 * @param dataType the data type | ||||
| 	 * @param type     the type | ||||
| 	 */ | ||||
| 	TxAttributeType(String name, DataType dataType, AssociationType type) { | ||||
| 		this.name = name; | ||||
| 		this.dataType = dataType; | ||||
| 		this.type = type; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the name. | ||||
| 	 * | ||||
| 	 * @return the name | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public String getName() { | ||||
| 		return name; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the data type. | ||||
| 	 * | ||||
| 	 * @return the data type | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public DataType getDataType() { | ||||
| 		return dataType; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the type. | ||||
| 	 * | ||||
| 	 * @return the type | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public AssociationType getType() { | ||||
| 		return type; | ||||
| 	} | ||||
| } | ||||
| @@ -1,38 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text | ||||
|  | ||||
| import com.minres.scviewer.database.AssociationType; | ||||
| import com.minres.scviewer.database.DataType | ||||
| import com.minres.scviewer.database.ITxAttributeType | ||||
| import com.minres.scviewer.database.ITxAttribute | ||||
|  | ||||
| class TxAttributeTypeFactory { | ||||
| 	private static final instance = new TxAttributeTypeFactory() | ||||
| 	 | ||||
| 	def attributes = [:] | ||||
| 	 | ||||
| 	private TxAttributeTypeFactory() { | ||||
| 		TxAttributeTypeFactory.metaClass.constructor = {-> instance } | ||||
| 	} | ||||
| 	 | ||||
| 	ITxAttributeType getAttrType(String name, DataType dataType, AssociationType type){ | ||||
| 		def key = name+":"+dataType.toString() | ||||
| 		ITxAttributeType res | ||||
| 		if(attributes.containsKey(key)){ | ||||
| 			res=attributes[key] | ||||
| 		} else { | ||||
| 			res=new TxAttributeType(name, dataType, type) | ||||
| 			attributes[key]=res | ||||
| 		} | ||||
| 		return res | ||||
| 	} | ||||
| } | ||||
| @@ -1,36 +0,0 @@ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import com.minres.scviewer.database.ITx | ||||
| import com.minres.scviewer.database.ITxEvent | ||||
| import com.minres.scviewer.database.IWaveformEvent | ||||
|  | ||||
| class TxEvent implements ITxEvent { | ||||
|  | ||||
| 	final ITxEvent.Type type; | ||||
| 	 | ||||
| 	final Tx transaction; | ||||
| 	 | ||||
| 	final Long time | ||||
| 	 | ||||
| 	TxEvent(ITxEvent.Type type, ITx transaction) { | ||||
| 		super(); | ||||
| 		this.type = type; | ||||
| 		this.transaction = transaction; | ||||
| 		this.time = type==ITxEvent.Type.BEGIN?transaction.beginTime:transaction.endTime | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	IWaveformEvent duplicate() throws CloneNotSupportedException { | ||||
| 		new TxEvent(type, transaction, time) | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	int compareTo(IWaveformEvent o) { | ||||
| 		time.compareTo(o.time) | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	String toString() { | ||||
| 		type.toString()+"@"+time+" of tx #"+transaction.id; | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,110 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     MINRES Technologies GmbH - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import com.minres.scviewer.database.EventKind; | ||||
| import com.minres.scviewer.database.WaveformType; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxEvent; | ||||
|  | ||||
| /** | ||||
|  * The Class TxEvent. | ||||
|  */ | ||||
| class TxEvent implements ITxEvent { | ||||
|  | ||||
| 	/** The loader. */ | ||||
| 	final TextDbLoader loader; | ||||
|  | ||||
| 	/** The kind. */ | ||||
| 	final EventKind kind; | ||||
|  | ||||
| 	/** The transaction. */ | ||||
| 	final long transaction; | ||||
|  | ||||
| 	/** The time. */ | ||||
| 	final long time; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx event. | ||||
| 	 * | ||||
| 	 * @param loader      the loader | ||||
| 	 * @param kind        the kind | ||||
| 	 * @param transaction the transaction | ||||
| 	 * @param time        the time | ||||
| 	 */ | ||||
| 	TxEvent(TextDbLoader loader, EventKind kind, Long transaction, Long time) { | ||||
| 		this.loader = loader; | ||||
| 		this.kind = kind; | ||||
| 		this.transaction = transaction; | ||||
| 		this.time = time; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Duplicate. | ||||
| 	 * | ||||
| 	 * @return the i tx event | ||||
| 	 * @throws CloneNotSupportedException the clone not supported exception | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public ITxEvent duplicate() throws CloneNotSupportedException { | ||||
| 		return new TxEvent(loader, kind, transaction, time); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * To string. | ||||
| 	 * | ||||
| 	 * @return the string | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public String toString() { | ||||
| 		return kind.toString() + "@" + time + " of tx #" + transaction; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the type. | ||||
| 	 * | ||||
| 	 * @return the type | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public WaveformType getType() { | ||||
| 		return WaveformType.TRANSACTION; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the kind. | ||||
| 	 * | ||||
| 	 * @return the kind | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public EventKind getKind() { | ||||
| 		return kind; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the time. | ||||
| 	 * | ||||
| 	 * @return the time | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public Long getTime() { | ||||
| 		return time; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the transaction. | ||||
| 	 * | ||||
| 	 * @return the transaction | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public ITx getTransaction() { | ||||
| 		return loader.getTransaction(transaction); | ||||
| 	} | ||||
| } | ||||
| @@ -1,52 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import com.minres.scviewer.database.ITxAttributeType | ||||
| import com.minres.scviewer.database.ITxAttribute; | ||||
| import com.minres.scviewer.database.ITxEvent; | ||||
| import com.minres.scviewer.database.ITxGenerator; | ||||
| import com.minres.scviewer.database.ITxStream; | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.IWaveformEvent; | ||||
|  | ||||
| class TxGenerator implements ITxGenerator{ | ||||
| 	Long id | ||||
| 	TxStream stream | ||||
| 	String name | ||||
| 	Boolean active = false | ||||
| 	ArrayList<ITx> transactions=[] | ||||
| 	 | ||||
| 	ArrayList<ITxAttributeType> begin_attrs = [] | ||||
| 	int begin_attrs_idx = 0 | ||||
| 	ArrayList<ITxAttributeType> end_attrs= [] | ||||
| 	int end_attrs_idx = 0 | ||||
| 	 | ||||
| 	TxGenerator(int id, TxStream stream, name){ | ||||
| 		this.id=id | ||||
| 		this.stream=stream | ||||
| 		this.name=name | ||||
| 	} | ||||
| 	 | ||||
| 	ITxStream<? extends ITxEvent> getStream(){ | ||||
| 		return stream; | ||||
| 	} | ||||
| 	 | ||||
| 	List<ITx> getTransactions(){ | ||||
| 		return transactions | ||||
| 	} | ||||
| 	 | ||||
| 	Boolean isActive() {return active}; | ||||
| 	 | ||||
| } | ||||
| @@ -0,0 +1,106 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.tx.ITxGenerator; | ||||
|  | ||||
| /** | ||||
|  * The Class TxGenerator. | ||||
|  */ | ||||
| class TxGenerator extends AbstractTxStream implements ITxGenerator { | ||||
|  | ||||
| 	/** The stream. */ | ||||
| 	TxStream stream; | ||||
|  | ||||
| 	/** The begin attrs. */ | ||||
| 	List<TxAttributeType> beginAttrs = new ArrayList<>(); | ||||
|  | ||||
| 	/** The end attrs. */ | ||||
| 	List<TxAttributeType> endAttrs = new ArrayList<>(); | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx generator. | ||||
| 	 * | ||||
| 	 * @param loader the loader | ||||
| 	 * @param id     the id | ||||
| 	 * @param name   the name | ||||
| 	 * @param stream the stream | ||||
| 	 */ | ||||
| 	TxGenerator(TextDbLoader loader, Long id, String name, TxStream stream) { | ||||
| 		super(loader, id, name); | ||||
| 		this.stream = stream; | ||||
| 		stream.addChild(this); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the stream. | ||||
| 	 * | ||||
| 	 * @return the stream | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public IWaveform getStream() { | ||||
| 		return stream; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Checks if is same. | ||||
| 	 * | ||||
| 	 * @param other the other | ||||
| 	 * @return true, if is same | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public boolean isSame(IWaveform other) { | ||||
| 		return (other instanceof TxGenerator && this.getId().equals(other.getId())); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the begin attrs. | ||||
| 	 * | ||||
| 	 * @return the begin attrs | ||||
| 	 */ | ||||
| 	public List<TxAttributeType> getBeginAttrs() { | ||||
| 		return beginAttrs; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the end attrs. | ||||
| 	 * | ||||
| 	 * @return the end attrs | ||||
| 	 */ | ||||
| 	public List<TxAttributeType> getEndAttrs() { | ||||
| 		return endAttrs; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the kind. | ||||
| 	 * | ||||
| 	 * @return the kind | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public String getKind() { | ||||
| 		return stream.getKind(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the width. | ||||
| 	 * | ||||
| 	 * @return the width | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public int getWidth() { | ||||
| 		return stream.getWidth(); | ||||
| 	} | ||||
| } | ||||
| @@ -1,36 +0,0 @@ | ||||
| package com.minres.scviewer.database.text | ||||
|  | ||||
| import com.minres.scviewer.database.ITxRelation | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.RelationType; | ||||
|  | ||||
| class TxRelation implements ITxRelation { | ||||
| 	Tx source | ||||
| 	 | ||||
| 	Tx target | ||||
| 	 | ||||
| 	RelationType relationType | ||||
| 	 | ||||
| 	 | ||||
| 	public TxRelation(RelationType relationType, Tx source, Tx target) { | ||||
| 		this.source = source; | ||||
| 		this.target = target; | ||||
| 		this.relationType = relationType; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public RelationType getRelationType() { | ||||
| 		return relationType; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public ITx getSource() { | ||||
| 		return source; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public ITx getTarget() { | ||||
| 		return target; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,69 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     MINRES Technologies GmbH - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import com.minres.scviewer.database.RelationType; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| import com.minres.scviewer.database.tx.ITxRelation; | ||||
|  | ||||
| /** | ||||
|  * The Class TxRelation. | ||||
|  */ | ||||
| class TxRelation implements ITxRelation { | ||||
|  | ||||
| 	/** The loader. */ | ||||
| 	final TextDbLoader loader; | ||||
|  | ||||
| 	/** The scv relation. */ | ||||
| 	final ScvRelation scvRelation; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx relation. | ||||
| 	 * | ||||
| 	 * @param loader      the loader | ||||
| 	 * @param scvRelation the scv relation | ||||
| 	 */ | ||||
| 	public TxRelation(TextDbLoader loader, ScvRelation scvRelation) { | ||||
| 		this.loader = loader; | ||||
| 		this.scvRelation = scvRelation; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the relation type. | ||||
| 	 * | ||||
| 	 * @return the relation type | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public RelationType getRelationType() { | ||||
| 		return scvRelation.relationType; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the source. | ||||
| 	 * | ||||
| 	 * @return the source | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public ITx getSource() { | ||||
| 		return loader.getTransaction(scvRelation.source); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the target. | ||||
| 	 * | ||||
| 	 * @return the target | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public ITx getTarget() { | ||||
| 		return loader.getTransaction(scvRelation.target); | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -1,119 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text | ||||
|  | ||||
| import java.beans.PropertyChangeListener; | ||||
| import java.util.Collection; | ||||
| import java.util.Comparator; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.NavigableMap; | ||||
|  | ||||
| import org.mapdb.Serializer | ||||
|  | ||||
| import com.minres.scviewer.database.ITxEvent; | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.IWaveformDb | ||||
| import com.minres.scviewer.database.IWaveformEvent | ||||
| import com.minres.scviewer.database.ITxGenerator | ||||
| import com.minres.scviewer.database.HierNode; | ||||
| import com.minres.scviewer.database.IHierNode | ||||
| import com.minres.scviewer.database.ITxStream | ||||
| import com.minres.scviewer.database.ITx | ||||
|  | ||||
| class TxStream extends HierNode implements ITxStream { | ||||
|  | ||||
| 	Long id | ||||
| 	 | ||||
| 	IWaveformDb database | ||||
| 	 | ||||
| 	String fullName | ||||
| 	 | ||||
| 	String kind | ||||
| 	 | ||||
| 	def generators = [] | ||||
| 	 | ||||
| 	int maxConcurrency | ||||
| 	 | ||||
| 	private TreeMap<Long, List<ITxEvent>> events | ||||
| 	 | ||||
| 	TxStream(TextDbLoader loader, int id, String name, String kind){ | ||||
| 		super(name) | ||||
| 		this.id=id | ||||
| 		this.database=loader.db | ||||
| 		this.fullName=name | ||||
| 		this.kind=kind | ||||
| 		this.maxConcurrency=0 | ||||
| 		//events = new TreeMap<Long, List<ITxEvent>>() | ||||
| 		events = loader.mapDb.treeMap(name).keySerializer(Serializer.LONG).createOrOpen(); | ||||
| 	} | ||||
|  | ||||
| 	List<ITxGenerator> getGenerators(){ | ||||
| 		return generators as List<ITxGenerator> | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public IWaveformDb getDb() { | ||||
| 		return database | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public int getMaxConcurrency() { | ||||
| 		if(!maxConcurrency){ | ||||
| 			generators.each {TxGenerator generator -> | ||||
| 				generator.transactions.each{ Tx tx -> | ||||
| 					putEvent(new TxEvent(ITxEvent.Type.BEGIN, tx)) | ||||
| 					putEvent(new TxEvent(ITxEvent.Type.END, tx)) | ||||
| 				} | ||||
| 			} | ||||
| 			def rowendtime = [0] | ||||
| 			events.keySet().each{long time -> | ||||
| 				def value=events.get(time) | ||||
| 				def starts=value.findAll{ITxEvent event ->event.type==ITxEvent.Type.BEGIN} | ||||
| 				starts.each {ITxEvent event -> | ||||
| 					Tx tx = event.transaction | ||||
| 					def rowIdx = 0 | ||||
| 					for(rowIdx=0; rowIdx<rowendtime.size() && rowendtime[rowIdx]>tx.beginTime; rowIdx++); | ||||
| 					if(rowendtime.size<=rowIdx) | ||||
| 						rowendtime<<tx.endTime | ||||
| 					else | ||||
| 						rowendtime[rowIdx]=tx.endTime | ||||
| 					tx.concurrencyIndex=rowIdx | ||||
| 				} | ||||
| 			} | ||||
| 			maxConcurrency=rowendtime.size() | ||||
| 		} | ||||
| 		return maxConcurrency | ||||
| 	} | ||||
|  | ||||
| 	private putEvent(ITxEvent event){ | ||||
| 		if(!events.containsKey(event.time))  | ||||
| 			events.put(event.time, [event]) | ||||
| 		else | ||||
| 			events[event.time]<<event | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public NavigableMap getEvents() { | ||||
| 		return events; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public Collection getWaveformEventsAtTime(Long time) { | ||||
| 		return events.get(time); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public Boolean equals(IWaveform other) { | ||||
| 		return(other instanceof TxStream && this.getId()==other.getId()); | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,94 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2012 IT Just working. | ||||
|  * Copyright (c) 2020 MINRES Technologies GmbH | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     IT Just working - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.text; | ||||
|  | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
|  | ||||
| /** | ||||
|  * The Class TxStream. | ||||
|  */ | ||||
| class TxStream extends AbstractTxStream { | ||||
|  | ||||
| 	/** The kind. */ | ||||
| 	final String kind; | ||||
|  | ||||
| 	/** | ||||
| 	 * Instantiates a new tx stream. | ||||
| 	 * | ||||
| 	 * @param loader the loader | ||||
| 	 * @param id     the id | ||||
| 	 * @param name   the name | ||||
| 	 * @param kind   the kind | ||||
| 	 */ | ||||
| 	TxStream(TextDbLoader loader, Long id, String name, String kind) { | ||||
| 		super(loader, id, name); | ||||
| 		this.kind = kind; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Checks if is same. | ||||
| 	 * | ||||
| 	 * @param other the other | ||||
| 	 * @return true, if is same | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public boolean isSame(IWaveform other) { | ||||
| 		return (other instanceof TxStream && this.getId().equals(other.getId())); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the kind. | ||||
| 	 * | ||||
| 	 * @return the kind | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public String getKind() { | ||||
| 		return kind; | ||||
| 	} | ||||
|  | ||||
| 	/** The max concurrency. */ | ||||
| 	private int maxConcurrency = 0; | ||||
|  | ||||
| 	/** The concurrency. */ | ||||
| 	private int concurrency = 0; | ||||
|  | ||||
| 	/** | ||||
| 	 * Sets the concurrency. | ||||
| 	 * | ||||
| 	 * @param concurrency the new concurrency | ||||
| 	 */ | ||||
| 	void setConcurrency(int concurrency) { | ||||
| 		this.concurrency = concurrency; | ||||
| 		if (concurrency > maxConcurrency) | ||||
| 			maxConcurrency = concurrency; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the concurrency. | ||||
| 	 * | ||||
| 	 * @return the concurrency | ||||
| 	 */ | ||||
| 	int getConcurrency() { | ||||
| 		return this.concurrency; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Gets the width. | ||||
| 	 * | ||||
| 	 * @return the width | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public int getWidth() { | ||||
| 		return maxConcurrency; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -98,4 +98,5 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning | ||||
| org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore | ||||
| org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning | ||||
| org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning | ||||
| org.eclipse.jdt.core.compiler.release=disabled | ||||
| org.eclipse.jdt.core.compiler.source=1.8 | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| Manifest-Version: 1.0 | ||||
| Bundle-ManifestVersion: 2 | ||||
| Bundle-Name: SWT widget | ||||
| Bundle-Name: SWT database widget | ||||
| Bundle-SymbolicName: com.minres.scviewer.database.ui.swt | ||||
| Bundle-Version: 2.2.0.qualifier | ||||
| Bundle-Version: 3.0.0.qualifier | ||||
| Bundle-Vendor: MINRES Technologies GmbH | ||||
| Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||||
| Require-Bundle: org.eclipse.swt;bundle-version="3.103.1", | ||||
| @@ -10,11 +10,21 @@ Require-Bundle: org.eclipse.swt;bundle-version="3.103.1", | ||||
|  com.google.guava;bundle-version="15.0.0", | ||||
|  org.eclipse.jface, | ||||
|  org.eclipse.equinox.registry, | ||||
|  com.minres.scviewer.database.ui, | ||||
|  org.eclipse.core.runtime, | ||||
|  org.eclipse.osgi | ||||
| Export-Package: com.minres.scviewer.database.swt | ||||
| Export-Package: com.minres.scviewer.database.ui; | ||||
|   uses:="org.eclipse.swt.events, | ||||
|    org.eclipse.swt.graphics, | ||||
|    org.eclipse.swt.widgets, | ||||
|    com.minres.scviewer.database, | ||||
|    org.eclipse.jface.viewers", | ||||
|  com.minres.scviewer.database.ui.swt; | ||||
|   uses:="org.osgi.framework, | ||||
|    org.eclipse.core.runtime, | ||||
|    com.minres.scviewer.database.ui, | ||||
|    org.eclipse.swt.graphics, | ||||
|    org.eclipse.swt.widgets" | ||||
| Bundle-ClassPath: . | ||||
| Bundle-ActivationPolicy: lazy | ||||
| Bundle-Activator: com.minres.scviewer.database.swt.DatabaseUiPlugin | ||||
| Bundle-Activator: com.minres.scviewer.database.ui.swt.DatabaseUiPlugin | ||||
| Automatic-Module-Name: com.minres.scviewer.database.ui.swt | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| ############################################################################### | ||||
| # Copyright (c) 2014, 2015 MINRES Technologies GmbH and others. | ||||
| # Copyright (c) 2014, 2015-2021 MINRES Technologies GmbH and others. | ||||
| # All rights reserved. This program and the accompanying materials | ||||
| # are made available under the terms of the Eclipse Public License v1.0 | ||||
| # which accompanies this distribution, and is available at | ||||
|   | ||||
| @@ -5,8 +5,8 @@ | ||||
|   <parent> | ||||
|   	<groupId>com.minres.scviewer</groupId> | ||||
|   	<artifactId>com.minres.scviewer.parent</artifactId> | ||||
|   	<version>2.0.0-SNAPSHOT</version> | ||||
|   	<version>2.11.0</version> | ||||
| 	<relativePath>../..</relativePath> | ||||
|   </parent> | ||||
|   <version>2.2.0-SNAPSHOT</version> | ||||
|   <version>3.0.0-SNAPSHOT</version> | ||||
| </project> | ||||
|   | ||||
| @@ -1,12 +0,0 @@ | ||||
| package com.minres.scviewer.database.swt; | ||||
|  | ||||
| public class Constants { | ||||
|  | ||||
| 	public static final String[] unitString={"fs", "ps", "ns", "us", "ms"};//, "s"}; | ||||
|      | ||||
|     public static final int[] unitMultiplier={1, 3, 10, 30, 100, 300}; | ||||
|  | ||||
| 	public static final String CONTENT_PROVIDER_TAG = "TOOLTIP_CONTENT_PROVIDER"; | ||||
| 	public static final String HELP_PROVIDER_TAG = "TOOLTIP_HELP_PROVIDER"; | ||||
|  | ||||
| } | ||||
| @@ -1,198 +0,0 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     MINRES Technologies GmbH - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.swt.internal; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Map.Entry; | ||||
| import java.util.NavigableMap; | ||||
| import java.util.TreeSet; | ||||
|  | ||||
| import org.eclipse.swt.SWT; | ||||
| import org.eclipse.swt.graphics.GC; | ||||
| import org.eclipse.swt.graphics.Point; | ||||
| import org.eclipse.swt.graphics.Rectangle; | ||||
|  | ||||
| import com.minres.scviewer.database.ITx; | ||||
| import com.minres.scviewer.database.ITxEvent; | ||||
| import com.minres.scviewer.database.ITxStream; | ||||
| import com.minres.scviewer.database.ui.TrackEntry; | ||||
| import com.minres.scviewer.database.ui.WaveformColors; | ||||
|  | ||||
| public class StreamPainter extends TrackPainter{ | ||||
|  | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private final WaveformCanvas waveCanvas; | ||||
| 	private ITxStream<? extends ITxEvent> stream; | ||||
| 	private int txBase, txHeight; | ||||
| 	private boolean even; | ||||
| 	private TreeSet<ITx> seenTx; | ||||
|  | ||||
| 	public StreamPainter(WaveformCanvas waveCanvas, boolean even, TrackEntry trackEntry) { | ||||
| 		super(trackEntry, even); | ||||
| 		this.waveCanvas = waveCanvas; | ||||
| 		this.stream=trackEntry.getStream(); | ||||
| 		this.seenTx=new TreeSet<ITx>(); | ||||
| 	} | ||||
|      | ||||
| 	/* | ||||
| 	 * convert java.awt.Color to org.eclipse.swt.graphics.Color  | ||||
| 	 */ | ||||
| 	static org.eclipse.swt.graphics.Color toSwtColor( GC gc, java.awt.Color awtColor ){ | ||||
| 		return new org.eclipse.swt.graphics.Color( gc.getDevice(), awtColor.getRed(), awtColor.getGreen(), awtColor.getBlue() ); | ||||
| 	} | ||||
|  | ||||
| 	static org.eclipse.swt.graphics.Color[] toSwtColors( GC gc, java.awt.Color[] awtColors ){ | ||||
| 		org.eclipse.swt.graphics.Color[] swtColors = new org.eclipse.swt.graphics.Color[awtColors.length]; | ||||
| 		for( int i=0; i<awtColors.length; i++ ) | ||||
| 			swtColors[i] = toSwtColor( gc, awtColors[i] ); | ||||
| 		return swtColors; | ||||
| 	} | ||||
|  | ||||
| 	@SuppressWarnings("unchecked") | ||||
| 	public void paintArea(GC gc, Rectangle area) { | ||||
| 		if(stream.getEvents().size()==0) return; | ||||
| 		int trackHeight=trackEntry.height/stream.getMaxConcurrency(); | ||||
| 		txBase=trackHeight/5; | ||||
| 		txHeight=trackHeight*3/5; | ||||
| 		if(trackEntry.selected) { | ||||
| 			gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]); | ||||
| 		} | ||||
| 		else | ||||
| 			gc.setBackground(this.waveCanvas.colors[even?WaveformColors.TRACK_BG_EVEN.ordinal():WaveformColors.TRACK_BG_ODD.ordinal()]); | ||||
| 		gc.setFillRule(SWT.FILL_EVEN_ODD); | ||||
| 		gc.fillRectangle(area); | ||||
| 		 | ||||
| 		long scaleFactor = this.waveCanvas.getScaleFactor(); | ||||
| 		long beginPos = area.x; | ||||
| 		long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor; | ||||
| 		//long endPos = beginPos + area.width; | ||||
|         long endTime = beginTime + area.width*scaleFactor; | ||||
|  | ||||
| 		Entry<Long, ?> firstTx=stream.getEvents().floorEntry(beginTime); | ||||
| 		Entry<Long, ?> lastTx=stream.getEvents().ceilingEntry(endTime); | ||||
| 		if(firstTx==null) firstTx = stream.getEvents().firstEntry(); | ||||
| 		if(lastTx==null) lastTx=stream.getEvents().lastEntry(); | ||||
|         gc.setFillRule(SWT.FILL_EVEN_ODD); | ||||
|         gc.setLineStyle(SWT.LINE_SOLID); | ||||
|         gc.setLineWidth(1); | ||||
|         gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]); | ||||
|          | ||||
|         for( int y1=area.y+trackHeight/2; y1<area.y+trackEntry.height; y1+=trackHeight) | ||||
|         	gc.drawLine(area.x, y1, area.x+area.width, y1); | ||||
| 		if(firstTx==lastTx) { | ||||
| 			for(ITxEvent txEvent:(Collection<?  extends ITxEvent>)firstTx.getValue()) | ||||
| 				drawTx(gc, area, txEvent.getTransaction(), false); | ||||
| 		}else{ | ||||
| 			seenTx.clear(); | ||||
| 			NavigableMap<Long,?> entries = stream.getEvents().subMap(firstTx.getKey(), true, lastTx.getKey(), true); | ||||
| 			boolean highlighed=false; | ||||
| 	        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]); | ||||
| 	         | ||||
| 	        for(Entry<Long, ?> entry: entries.entrySet()) | ||||
| 				for(ITxEvent txEvent:(Collection<?  extends ITxEvent>)entry.getValue()){ | ||||
| 					if(txEvent.getType()==ITxEvent.Type.BEGIN) | ||||
| 						seenTx.add(txEvent.getTransaction()); | ||||
| 					if(txEvent.getType()==ITxEvent.Type.END){ | ||||
| 						ITx tx = txEvent.getTransaction(); | ||||
| 						highlighed|=waveCanvas.currentSelection!=null && waveCanvas.currentSelection.equals(tx); | ||||
| 						drawTx(gc, area, tx, false); | ||||
| 						seenTx.remove(tx); | ||||
| 					} | ||||
| 				} | ||||
| 			for(ITx tx:seenTx){ | ||||
| 				drawTx(gc, area, tx, false); | ||||
| 			} | ||||
| 			if(highlighed){ | ||||
| 		        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE_HIGHLITE.ordinal()]); | ||||
| 		        drawTx(gc, area, waveCanvas.currentSelection, true); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| 	protected void drawTx(GC gc, Rectangle area, ITx tx, boolean highlighted ) { | ||||
| 		// compute colors | ||||
|         java.awt.Color[] fallbackColors = trackEntry.getColors(); | ||||
|         java.awt.Color[] transColor = TrackEntry.computeColor( tx.getGenerator().getName(), fallbackColors[0], fallbackColors[1] ); | ||||
|          | ||||
|         gc.setBackground( toSwtColor( gc, transColor[highlighted?1:0] ) ); | ||||
|          | ||||
| 		int offset = tx.getConcurrencyIndex()*this.waveCanvas.getTrackHeight(); | ||||
| 		Rectangle bb = new Rectangle( | ||||
| 				(int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()-waveCanvas.getXOffset()), area.y+offset+txBase, | ||||
| 				(int)((tx.getEndTime()-tx.getBeginTime())/this.waveCanvas.getScaleFactor()), txHeight); | ||||
|  | ||||
| 		if(bb.x+bb.width<area.x || bb.x>area.x+area.width) return; | ||||
| 		if(bb.width==0){ | ||||
| 			gc.drawLine(bb.x, bb.y, bb.x, bb.y+bb.height); | ||||
| 		} else if(bb.width<10){ | ||||
| 			gc.fillRectangle(bb); | ||||
| 			gc.drawRectangle(bb); | ||||
| 		} else { | ||||
| 			if(bb.x < area.x) { | ||||
| 				bb.width = bb.width-(area.x-bb.x)+5; | ||||
| 				bb.x=area.x-5; | ||||
| 			} | ||||
| 			int bb_x2 = bb.x+bb.width; | ||||
| 			int area_x2 = area.x+area.width; | ||||
| 			if(bb_x2>area_x2){ | ||||
| 				bb_x2=area_x2+5; | ||||
| 				bb.width= bb_x2-bb.x; | ||||
| 			} | ||||
| 			gc.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5); | ||||
| 		    gc.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public ITx getClicked(Point point) { | ||||
| 		int lane=point.y/waveCanvas.getTrackHeight(); | ||||
| 		Entry<Long, List<ITxEvent>> firstTx=stream.getEvents().floorEntry(point.x*waveCanvas.getScaleFactor()); | ||||
| 		if(firstTx!=null){ | ||||
| 			do { | ||||
| 				ITx tx = getTxFromEntry(lane, point.x, firstTx); | ||||
| 				if(tx!=null) return tx; | ||||
| 				firstTx=stream.getEvents().lowerEntry(firstTx.getKey()); | ||||
| 			}while(firstTx!=null); | ||||
| 		} | ||||
| 		return null; | ||||
| 	} | ||||
|  | ||||
| 	public ITxStream<? extends ITxEvent> getStream() { | ||||
| 		return stream; | ||||
| 	} | ||||
|  | ||||
| 	public void setStream(ITxStream<? extends ITxEvent> stream) { | ||||
| 		this.stream = stream; | ||||
| 	} | ||||
|  | ||||
| 	protected ITx getTxFromEntry(int lane, int offset, Entry<Long, List<ITxEvent>> firstTx) { | ||||
|         long timePoint=offset*waveCanvas.getScaleFactor(); | ||||
| 		for(ITxEvent evt:firstTx.getValue()){ | ||||
| 		    ITx tx=evt.getTransaction(); | ||||
| 			if(evt.getType()==ITxEvent.Type.BEGIN && tx.getConcurrencyIndex()==lane && tx.getBeginTime()<=timePoint && tx.getEndTime()>=timePoint){ | ||||
| 				return evt.getTransaction(); | ||||
| 			} | ||||
| 		} | ||||
| 		// now with some fuzziness | ||||
|         timePoint=(offset-5)*waveCanvas.getScaleFactor(); | ||||
|         long timePointHigh=(offset+5)*waveCanvas.getScaleFactor(); | ||||
|         for(ITxEvent evt:firstTx.getValue()){ | ||||
|             ITx tx=evt.getTransaction(); | ||||
|             if(evt.getType()==ITxEvent.Type.BEGIN && tx.getConcurrencyIndex()==lane && tx.getBeginTime()<=timePointHigh && tx.getEndTime()>=timePoint){ | ||||
|                 return evt.getTransaction(); | ||||
|             } | ||||
|         } | ||||
| 		return null; | ||||
| 	} | ||||
|  | ||||
| } | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -0,0 +1,17 @@ | ||||
| package com.minres.scviewer.database.ui; | ||||
|  | ||||
| import org.eclipse.swt.graphics.Color; | ||||
| import org.eclipse.swt.graphics.Font; | ||||
|  | ||||
| public interface IWaveformStyleProvider { | ||||
| 	 | ||||
| 	Font getNameFont(); | ||||
|  | ||||
| 	Font getNameFontHighlite(); | ||||
| 	 | ||||
| 	int getTrackHeight(); | ||||
|  | ||||
| 	Color getColor(WaveformColors type); | ||||
|  | ||||
| 	Color[] computeColor(String name); | ||||
| } | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -11,7 +11,6 @@ | ||||
| package com.minres.scviewer.database.ui; | ||||
| 
 | ||||
| import java.beans.PropertyChangeListener; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import org.eclipse.jface.viewers.ISelection; | ||||
| @@ -19,24 +18,27 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; | ||||
| import org.eclipse.jface.viewers.ISelectionProvider; | ||||
| import org.eclipse.swt.events.DisposeListener; | ||||
| import org.eclipse.swt.graphics.Point; | ||||
| import org.eclipse.swt.graphics.RGB; | ||||
| import org.eclipse.swt.widgets.Control; | ||||
| 
 | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
| import com.minres.scviewer.database.RelationType; | ||||
| import com.minres.scviewer.database.RelationTypeFactory; | ||||
| import com.minres.scviewer.database.tx.ITx; | ||||
| 
 | ||||
| public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvider{ | ||||
| public interface IWaveformView extends PropertyChangeListener, ISelectionProvider{ | ||||
| 
 | ||||
| 	String CURSOR_PROPERTY = "cursor_time"; | ||||
| 	 | ||||
| 	String MARKER_PROPERTY = "marker_time"; | ||||
| 	 | ||||
| 	public static final RelationType NEXT_PREV_IN_STREAM = RelationType.create("Prev/Next in stream");  | ||||
| 	public static final RelationType NEXT_PREV_IN_STREAM = RelationTypeFactory.create("Prev/Next in stream");  | ||||
| 
 | ||||
| 	public void addSelectionChangedListener(ISelectionChangedListener listener); | ||||
| 
 | ||||
| 	public void removeSelectionChangedListener(ISelectionChangedListener listener); | ||||
| 	 | ||||
| 	public void setStyleProvider(IWaveformStyleProvider styleProvider); | ||||
| 	 | ||||
| 	public void update(); | ||||
| 
 | ||||
| 	public Control getControl(); | ||||
| @@ -51,7 +53,9 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi | ||||
| 
 | ||||
| 	public void setSelection(ISelection selection); | ||||
| 
 | ||||
| 	public void setSelection(ISelection selection, boolean addIfNeeded); | ||||
| 	public void setSelection(ISelection selection, boolean showIfNeeded); | ||||
| 
 | ||||
| 	public void addToSelection(ISelection selection, boolean showIfNeeded); | ||||
| 
 | ||||
| 	public void moveSelection(GotoDirection direction); | ||||
| 
 | ||||
| @@ -61,7 +65,9 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi | ||||
| 
 | ||||
| 	public List<TrackEntry> getStreamList(); | ||||
| 
 | ||||
| 	public TrackEntry getEntryForStream(IWaveform source); | ||||
| 	public TrackEntry getEntryFor(ITx source); | ||||
| 	 | ||||
| 	public TrackEntry getEntryFor(IWaveform source); | ||||
| 	 | ||||
| 	public List<Object> getElementsAt(Point pt); | ||||
| 	 | ||||
| @@ -101,8 +107,6 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi | ||||
| 
 | ||||
| 	public List<ICursor> getCursorList(); | ||||
| 
 | ||||
| 	public void setColors(HashMap<WaveformColors, RGB> colourMap); | ||||
| 
 | ||||
| 	public long getBaselineTime(); | ||||
| 
 | ||||
| 	public void setBaselineTime(Long scale); | ||||
| @@ -110,4 +114,8 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi | ||||
| 	public void scrollHorizontal(int percent); | ||||
| 	 | ||||
| 	public void addDisposeListener( DisposeListener listener ); | ||||
| 
 | ||||
| 	public void deleteSelectedTracks(); | ||||
| 
 | ||||
| 	public TrackEntry addWaveform(IWaveform waveform, int pos); | ||||
| } | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -12,6 +12,8 @@ package com.minres.scviewer.database.ui; | ||||
| 
 | ||||
| import org.eclipse.swt.widgets.Composite; | ||||
| 
 | ||||
| public interface IWaveformViewerFactory { | ||||
| 	public IWaveformViewer createPanel(Composite parent); | ||||
| public interface IWaveformViewFactory { | ||||
| 	public IWaveformView createPanel(Composite parent); | ||||
| 
 | ||||
| 	public IWaveformView createPanel(Composite parent, IWaveformStyleProvider styleProvider); | ||||
| } | ||||
| @@ -0,0 +1,59 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *     MINRES Technologies GmbH - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.ui; | ||||
|  | ||||
|  | ||||
| import com.minres.scviewer.database.IWaveform; | ||||
|  | ||||
| public class TrackEntry { | ||||
|  | ||||
| 	IWaveformStyleProvider styleProvider; | ||||
| 	 | ||||
| 	public enum ValueDisplay { | ||||
| 		DEFAULT, SIGNED, UNSIGNED | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	public enum WaveDisplay { | ||||
| 		DEFAULT, STEP_WISE, CONTINOUS | ||||
| 	} | ||||
|  | ||||
| 	final public IWaveform waveform; | ||||
|  | ||||
| 	public int vOffset; | ||||
| 	 | ||||
| 	public int height; | ||||
|  | ||||
| 	public boolean selected; | ||||
| 	 | ||||
| 	public String currentValue=""; | ||||
| 	 | ||||
| 	public ValueDisplay valueDisplay = ValueDisplay.DEFAULT; | ||||
| 	 | ||||
| 	public WaveDisplay waveDisplay = WaveDisplay.DEFAULT; | ||||
| 	 | ||||
| 	public TrackEntry(IWaveform waveform, IWaveformStyleProvider styleProvider) { | ||||
| 		this.waveform = waveform; | ||||
| 		this.styleProvider=styleProvider; | ||||
| 		vOffset=0; | ||||
| 		height=0; | ||||
| 		selected=false; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
|     public boolean equals(Object obj) { | ||||
| 		if(obj instanceof TrackEntry){ | ||||
| 			TrackEntry o = (TrackEntry) obj; | ||||
| 			return waveform==o.waveform && vOffset==o.vOffset; | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
| } | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -0,0 +1,14 @@ | ||||
| package com.minres.scviewer.database.ui.swt; | ||||
|  | ||||
| public class Constants { | ||||
|  | ||||
| 	public static final String[] UNIT_STRING={"fs", "ps", "ns", "us", "ms"};//, "s"}; | ||||
|      | ||||
|     public static final int[] UNIT_MULTIPLIER={1, 3, 10, 30, 100, 300}; | ||||
|  | ||||
| 	public static final String CONTENT_PROVIDER_TAG = "TOOLTIP_CONTENT_PROVIDER"; | ||||
| 	public static final String HELP_PROVIDER_TAG = "TOOLTIP_HELP_PROVIDER"; | ||||
| 	 | ||||
| 	private Constants() {} | ||||
|  | ||||
| } | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (c) 2015 MINRES Technologies GmbH and others. | ||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
| @@ -8,7 +8,7 @@ | ||||
|  * Contributors: | ||||
|  *     MINRES Technologies GmbH - initial API and implementation | ||||
|  *******************************************************************************/ | ||||
| package com.minres.scviewer.database.swt; | ||||
| package com.minres.scviewer.database.ui.swt; | ||||
| 
 | ||||
| import org.eclipse.core.runtime.IStatus; | ||||
| import org.eclipse.core.runtime.Plugin; | ||||
| @@ -16,12 +16,14 @@ import org.eclipse.core.runtime.Status; | ||||
| import org.osgi.framework.BundleContext; | ||||
| 
 | ||||
| public class DatabaseUiPlugin extends Plugin { | ||||
| 	 | ||||
|   public void start(BundleContext context) throws Exception { | ||||
|     getLog().log(new Status(IStatus.OK, "org.eclipse.e4.core", "Starting org.eclipse.e4.core bundle...")); | ||||
|   } | ||||
|   | ||||
|   public void stop(BundleContext context) throws Exception { | ||||
|     getLog().log(new Status(IStatus.OK, "org.eclipse.e4.core", "Stopping org.eclipse.e4.core bundle...")); | ||||
|   } | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void start(BundleContext context) throws Exception { | ||||
| 		getLog().log(new Status(IStatus.OK, "org.eclipse.e4.core", "Starting org.eclipse.e4.core bundle...")); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void stop(BundleContext context) throws Exception { | ||||
| 		getLog().log(new Status(IStatus.OK, "org.eclipse.e4.core", "Stopping org.eclipse.e4.core bundle...")); | ||||
| 	} | ||||
| } | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user