Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
97443c6cd8 | |||
c3486eb6c8 | |||
8a286a8eac | |||
e4329213fa | |||
857bbe17d7 | |||
091cb1cf7f | |||
0623b8de4a | |||
8b55548cca | |||
a0a4ea1f53 | |||
e034d1faad | |||
68660d0892 | |||
a0f0b55045 | |||
3d20b6961e | |||
ca02c92a18 | |||
347dbf134b | |||
44ac32359f | |||
48c7d81b8a | |||
e945a3acbe | |||
145dfbd74d | |||
b7646dc29e | |||
475181c8df | |||
3d043ce1b7 | |||
7e2869b7ee | |||
51d9d7e25c | |||
ed665ac032 | |||
689d7874f4 | |||
c7c1f97b0c | |||
7b2db09585 | |||
52f3f7b348 | |||
429ea37080 | |||
04f011e82f | |||
3a6ed3ce7e |
@ -5,10 +5,7 @@ Bundle-SymbolicName: com.minres.scviewer.database.sqlite
|
|||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.0.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0"
|
||||||
org.eclipse.equinox.util;bundle-version="1.0.500",
|
|
||||||
org.eclipse.equinox.ds;bundle-version="1.4.200",
|
|
||||||
org.eclipse.osgi.services;bundle-version="3.4.0"
|
|
||||||
Bundle-ClassPath: .,sqlite-jdbc-3.8.7.jar
|
Bundle-ClassPath: .,sqlite-jdbc-3.8.7.jar
|
||||||
Service-Component: OSGI-INF/component.xml
|
Service-Component: OSGI-INF/component.xml
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
<artifactId>tycho-surefire-plugin</artifactId>
|
<artifactId>tycho-surefire-plugin</artifactId>
|
||||||
<version>0.23.1</version>
|
<version>${tycho-version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- <bundleStartLevel /> -->
|
<!-- <bundleStartLevel /> -->
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
groovy.compiler.level=26
|
groovy.compiler.level=25
|
||||||
|
@ -2,12 +2,12 @@ Manifest-Version: 1.0
|
|||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: Textual transaction database
|
Bundle-Name: Textual transaction database
|
||||||
Bundle-SymbolicName: com.minres.scviewer.database.text
|
Bundle-SymbolicName: com.minres.scviewer.database.text
|
||||||
Bundle-Version: 2.0.0.qualifier
|
Bundle-Version: 2.0.1.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
Import-Package: org.osgi.framework;version="1.3.0"
|
Import-Package: org.osgi.framework;version="1.3.0"
|
||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
Require-Bundle: com.minres.scviewer.database,
|
||||||
org.codehaus.groovy;bundle-version="1.8.6",
|
org.codehaus.groovy;bundle-version="2.5.8",
|
||||||
org.eclipse.equinox.util;bundle-version="1.0.500",
|
org.eclipse.equinox.util;bundle-version="1.0.500",
|
||||||
org.eclipse.equinox.ds;bundle-version="1.4.200",
|
org.eclipse.equinox.ds;bundle-version="1.4.200",
|
||||||
org.eclipse.osgi.services;bundle-version="3.4.0",
|
org.eclipse.osgi.services;bundle-version="3.4.0",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>com.minres.scviewer.database.text</artifactId>
|
<artifactId>com.minres.scviewer.database.text</artifactId>
|
||||||
<version>2.0.0-SNAPSHOT</version>
|
<version>2.0.1-SNAPSHOT</version>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
@ -15,10 +15,13 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
<artifactId>tycho-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>0.23.1</version>
|
<version>3.8.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<compilerId>groovy-eclipse-compiler</compilerId>
|
<compilerId>groovy-eclipse-compiler</compilerId>
|
||||||
|
<compilerArguments>
|
||||||
|
<indy/><!-- optional; supported by batch 2.4.12-04+ -->
|
||||||
|
</compilerArguments>
|
||||||
<!-- set verbose to be true if you want lots of uninteresting messages -->
|
<!-- set verbose to be true if you want lots of uninteresting messages -->
|
||||||
<!-- <verbose>true</verbose> -->
|
<!-- <verbose>true</verbose> -->
|
||||||
<source>1.7</source>
|
<source>1.7</source>
|
||||||
@ -34,8 +37,6 @@
|
|||||||
<groupId>org.codehaus.groovy</groupId>
|
<groupId>org.codehaus.groovy</groupId>
|
||||||
<artifactId>groovy-eclipse-batch</artifactId>
|
<artifactId>groovy-eclipse-batch</artifactId>
|
||||||
<version>${groovy-eclipse-batch-version}</version>
|
<version>${groovy-eclipse-batch-version}</version>
|
||||||
<!-- or choose a different compiler version -->
|
|
||||||
<!-- <version>2.1.8-01</version> -->
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
@ -28,6 +28,7 @@ import com.minres.scviewer.database.IWaveform
|
|||||||
import com.minres.scviewer.database.IWaveformDb
|
import com.minres.scviewer.database.IWaveformDb
|
||||||
import com.minres.scviewer.database.IWaveformDbLoader
|
import com.minres.scviewer.database.IWaveformDbLoader
|
||||||
import com.minres.scviewer.database.RelationType
|
import com.minres.scviewer.database.RelationType
|
||||||
|
import com.minres.scviewer.database.DataType
|
||||||
|
|
||||||
public class TextDbLoader implements IWaveformDbLoader{
|
public class TextDbLoader implements IWaveformDbLoader{
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
|||||||
.allocateStartSize(64*1024*1024)
|
.allocateStartSize(64*1024*1024)
|
||||||
.allocateIncrement(64*1024*1024)
|
.allocateIncrement(64*1024*1024)
|
||||||
.make()
|
.make()
|
||||||
|
// NPE here --->
|
||||||
parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))
|
parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))
|
||||||
calculateConcurrencyIndicees()
|
calculateConcurrencyIndicees()
|
||||||
return true
|
return true
|
||||||
@ -87,6 +89,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
|||||||
} catch(EOFException e) {
|
} catch(EOFException e) {
|
||||||
return true;
|
return true;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
|
System.out.println("---->>> Exception caught while loading database. StackTrace following... ");
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -113,7 +116,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
is.close()
|
if(is!=null) is.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +141,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
|||||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
||||||
long lineCnt=0;
|
long lineCnt=0;
|
||||||
reader.eachLine { line ->
|
reader.eachLine { line ->
|
||||||
def tokens = line.split(/\s+/)
|
def tokens = line.split(/\s+/) as ArrayList
|
||||||
switch(tokens[0]){
|
switch(tokens[0]){
|
||||||
case "scv_tr_stream":
|
case "scv_tr_stream":
|
||||||
case "scv_tr_generator":
|
case "scv_tr_generator":
|
||||||
@ -185,7 +188,10 @@ public class TextDbLoader implements IWaveformDbLoader{
|
|||||||
break
|
break
|
||||||
case "tx_record_attribute"://matcher = line =~ /^tx_record_attribute\s+(\d+)\s+"([^"]+)"\s+(\S+)\s*=\s*(.+)$/
|
case "tx_record_attribute"://matcher = line =~ /^tx_record_attribute\s+(\d+)\s+"([^"]+)"\s+(\S+)\s*=\s*(.+)$/
|
||||||
def id = Integer.parseInt(tokens[1])
|
def id = Integer.parseInt(tokens[1])
|
||||||
transactionsById[id].attributes<<new TxAttribute(tokens[2][1..-2], DataType.valueOf(tokens[3]), AssociationType.RECORD, tokens[5..-1].join(' '))
|
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
|
break
|
||||||
case "a"://matcher = line =~ /^a\s+(.+)$/
|
case "a"://matcher = line =~ /^a\s+(.+)$/
|
||||||
if(endTransaction){
|
if(endTransaction){
|
||||||
@ -213,6 +219,26 @@ public class TextDbLoader implements IWaveformDbLoader{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private def toDataType(String str){
|
||||||
|
switch (str)
|
||||||
|
{
|
||||||
|
case "BOOLEAN": return DataType. BOOLEAN
|
||||||
|
case "ENUMERATION": return DataType. ENUMERATION
|
||||||
|
case "INTEGER": return DataType. INTEGER
|
||||||
|
case "UNSIGNED": return DataType. UNSIGNED
|
||||||
|
case "FLOATING_POINT_NUMBER": return DataType. FLOATING_POINT_NUMBER
|
||||||
|
case "BIT_VECTOR": return DataType. BIT_VECTOR
|
||||||
|
case "LOGIC_VECTOR": return DataType. LOGIC_VECTOR
|
||||||
|
case "FIXED_POINT_INTEGER": return DataType. FIXED_POINT_INTEGER
|
||||||
|
case "UNSIGNED_FIXED_POINT_INTEGER": return DataType. UNSIGNED_FIXED_POINT_INTEGER
|
||||||
|
case "RECORD": return DataType. RECORD
|
||||||
|
case "POINTER": return DataType. POINTER
|
||||||
|
case "ARRAY": return DataType. ARRAY
|
||||||
|
case "STRING": return DataType. STRING
|
||||||
|
default: return DataType.INTEGER
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private def calculateConcurrencyIndicees(){
|
private def calculateConcurrencyIndicees(){
|
||||||
streams.each{ TxStream stream -> stream.getMaxConcurrency() }
|
streams.each{ TxStream stream -> stream.getMaxConcurrency() }
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: SWT widget
|
Bundle-Name: SWT widget
|
||||||
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
|
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
|
||||||
Bundle-Version: 2.0.1.qualifier
|
Bundle-Version: 2.0.2.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
|
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
<version>2.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<relativePath>../com.minres.scviewer.parent</relativePath>
|
<relativePath>../com.minres.scviewer.parent</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>2.0.1-SNAPSHOT</version>
|
<version>2.0.2-SNAPSHOT</version>
|
||||||
</project>
|
</project>
|
@ -46,6 +46,7 @@ import org.eclipse.swt.dnd.DropTargetEvent;
|
|||||||
import org.eclipse.swt.dnd.Transfer;
|
import org.eclipse.swt.dnd.Transfer;
|
||||||
import org.eclipse.swt.events.ControlAdapter;
|
import org.eclipse.swt.events.ControlAdapter;
|
||||||
import org.eclipse.swt.events.ControlEvent;
|
import org.eclipse.swt.events.ControlEvent;
|
||||||
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.events.MouseAdapter;
|
import org.eclipse.swt.events.MouseAdapter;
|
||||||
import org.eclipse.swt.events.MouseEvent;
|
import org.eclipse.swt.events.MouseEvent;
|
||||||
import org.eclipse.swt.events.MouseListener;
|
import org.eclipse.swt.events.MouseListener;
|
||||||
@ -157,6 +158,7 @@ public class WaveformViewer implements IWaveformViewer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseUp(MouseEvent e) {
|
public void mouseUp(MouseEvent e) {
|
||||||
|
if(start==null) return;
|
||||||
if((e.stateMask&SWT.MODIFIER_MASK&~SWT.SHIFT)!=0) return; //don't react on modifier
|
if((e.stateMask&SWT.MODIFIER_MASK&~SWT.SHIFT)!=0) return; //don't react on modifier
|
||||||
if (e.button == 1 && ((e.stateMask&SWT.SHIFT)==0)) {
|
if (e.button == 1 && ((e.stateMask&SWT.SHIFT)==0)) {
|
||||||
if(Math.abs(e.x-start.x)<3 && Math.abs(e.y-start.y)<3){
|
if(Math.abs(e.x-start.x)<3 && Math.abs(e.y-start.y)<3){
|
||||||
@ -1249,4 +1251,9 @@ public class WaveformViewer implements IWaveformViewer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// probably not the way it should be done
|
||||||
|
public void addDisposeListener( DisposeListener listener ) {
|
||||||
|
waveformCanvas.addDisposeListener(listener);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ import java.util.List;
|
|||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||||
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
@ -104,4 +105,6 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi
|
|||||||
public void setBaselineTime(Long scale);
|
public void setBaselineTime(Long scale);
|
||||||
|
|
||||||
public void scrollHorizontal(int percent);
|
public void scrollHorizontal(int percent);
|
||||||
|
|
||||||
|
public void addDisposeListener( DisposeListener listener );
|
||||||
}
|
}
|
@ -72,7 +72,7 @@ public class TrackEntry {
|
|||||||
}else {
|
}else {
|
||||||
// assign "random" color here, one name always results in the same color!
|
// assign "random" color here, one name always results in the same color!
|
||||||
if( randomColors.length > 0 ) {
|
if( randomColors.length > 0 ) {
|
||||||
int index = streamValue.hashCode() % randomColors.length;
|
int index = Math.abs(streamValue.hashCode()) % randomColors.length;
|
||||||
result[0] = randomColors[index][0];
|
result[0] = randomColors[index][0];
|
||||||
result[1] = randomColors[index][1];
|
result[1] = randomColors[index][1];
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
|||||||
Export-Package: com.minres.scviewer.database
|
Export-Package: com.minres.scviewer.database
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Service-Component: OSGI-INF/component.xml,OSGI-INF/component2.xml
|
Service-Component: OSGI-INF/component.xml,OSGI-INF/component2.xml
|
||||||
Require-Bundle: org.eclipse.equinox.ds;bundle-version="1.4.200",
|
|
||||||
org.eclipse.equinox.util;bundle-version="1.0.500",
|
|
||||||
org.eclipse.osgi.services;bundle-version="3.4.0"
|
|
||||||
Automatic-Module-Name: com.minres.scviewer.database
|
Automatic-Module-Name: com.minres.scviewer.database
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
<mainMenu xmi:id="_95PfyXNmEeWBq8z1Dv39LA" elementId="menu:org.eclipse.ui.main.menu">
|
<mainMenu xmi:id="_95PfyXNmEeWBq8z1Dv39LA" elementId="menu:org.eclipse.ui.main.menu">
|
||||||
<children xsi:type="menu:Menu" xmi:id="_95QGwHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.file" label="File">
|
<children xsi:type="menu:Menu" xmi:id="_95QGwHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.file" label="File">
|
||||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_VJG3YHgvEeWwZ-9vrAR2UQ" elementId="" label="Open Database" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" command="_95PfwHNmEeWBq8z1Dv39LA"/>
|
<children xsi:type="menu:HandledMenuItem" xmi:id="_VJG3YHgvEeWwZ-9vrAR2UQ" elementId="" label="Open Database" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" command="_95PfwHNmEeWBq8z1Dv39LA"/>
|
||||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_e7MOYJedEeW09eyIbHsdvg" elementId="" label="Load settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_page.png" command="_7-AIMJebEeW09eyIbHsdvg">
|
<children xsi:type="menu:HandledMenuItem" xmi:id="_e7MOYJedEeW09eyIbHsdvg" elementId="" label="Load active tab settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_page.png" command="_7-AIMJebEeW09eyIbHsdvg">
|
||||||
<parameters xmi:id="_4vtYgJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.30" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="load"/>
|
<parameters xmi:id="_4vtYgJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.30" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="load"/>
|
||||||
</children>
|
</children>
|
||||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGwnNmEeWBq8z1Dv39LA" label="Save settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/script_save.png" command="_7-AIMJebEeW09eyIbHsdvg">
|
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGwnNmEeWBq8z1Dv39LA" label="Save active tab settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/script_save.png" command="_7-AIMJebEeW09eyIbHsdvg">
|
||||||
<parameters xmi:id="_61QIsJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.31" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="store"/>
|
<parameters xmi:id="_61QIsJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.31" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="store"/>
|
||||||
</children>
|
</children>
|
||||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGw3NmEeWBq8z1Dv39LA" label="Quit" command="_95PfvHNmEeWBq8z1Dv39LA"/>
|
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGw3NmEeWBq8z1Dv39LA" label="Quit" command="_95PfvHNmEeWBq8z1Dv39LA"/>
|
||||||
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %Bundle-Name
|
Bundle-Name: %Bundle-Name
|
||||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
||||||
Bundle-Version: 2.1.1.qualifier
|
Bundle-Version: 2.1.4.qualifier
|
||||||
Bundle-Vendor: %Bundle-Vendor
|
Bundle-Vendor: %Bundle-Vendor
|
||||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
org.eclipse.core.runtime;bundle-version="3.11.1",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>com.minres.scviewer.e4.application</artifactId>
|
<artifactId>com.minres.scviewer.e4.application</artifactId>
|
||||||
<version>2.1.1-SNAPSHOT</version>
|
<version>2.1.4-SNAPSHOT</version>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.e4.application.handlers;
|
package com.minres.scviewer.e4.application.handlers;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||||
@ -20,6 +22,7 @@ import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
|||||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.widgets.FileDialog;
|
import org.eclipse.swt.widgets.FileDialog;
|
||||||
|
import org.eclipse.swt.widgets.MessageBox;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import com.minres.scviewer.e4.application.Messages;
|
import com.minres.scviewer.e4.application.Messages;
|
||||||
@ -38,21 +41,60 @@ public class LoadStoreSettingsHandler {
|
|||||||
@Execute
|
@Execute
|
||||||
public void execute(@Named(PARAMETER_ID) String param, Shell shell, MApplication app, EModelService modelService,
|
public void execute(@Named(PARAMETER_ID) String param, Shell shell, MApplication app, EModelService modelService,
|
||||||
EPartService partService){
|
EPartService partService){
|
||||||
|
|
||||||
boolean load = "load".equals(param); //$NON-NLS-1$
|
boolean load = "load".equals(param); //$NON-NLS-1$
|
||||||
FileDialog dialog = new FileDialog(shell, load?SWT.OPEN:SWT.SAVE);
|
FileDialog dialog = new FileDialog(shell, load?SWT.OPEN:SWT.SAVE);
|
||||||
dialog.setFilterExtensions (new String []{Messages.LoadStoreSettingsHandler_2});
|
dialog.setFilterExtensions (new String []{Messages.LoadStoreSettingsHandler_2});
|
||||||
if(!load) dialog.setFileName(Messages.LoadStoreSettingsHandler_3);
|
if(!load) dialog.setFileName(Messages.LoadStoreSettingsHandler_3);
|
||||||
String res = dialog.open();
|
|
||||||
|
String fileName = null;
|
||||||
MPart part = partService.getActivePart();
|
MPart part = partService.getActivePart();
|
||||||
if(res!=null && part!=null){
|
Object obj = part.getObject();
|
||||||
Object obj = part.getObject();
|
|
||||||
if(obj instanceof WaveformViewer){
|
// Save active tab settings
|
||||||
if(load)
|
if(!load) {
|
||||||
((WaveformViewer)obj).loadState(res);
|
// 3 possible cases when when saving active tab settings:
|
||||||
else
|
// - user dismisses the dialog by pressing Cancel
|
||||||
((WaveformViewer)obj).saveState(res);
|
// - selected file name does not exist
|
||||||
|
// - user agrees to overwrite existing file
|
||||||
|
boolean done = false;
|
||||||
|
while (!done) {
|
||||||
|
// open the File Dialog
|
||||||
|
fileName = dialog.open();
|
||||||
|
if (fileName == null) {
|
||||||
|
// user has cancelled -> quit and return
|
||||||
|
done = true;
|
||||||
|
} else {
|
||||||
|
// user has selected a file -> see if it already exists
|
||||||
|
File file = new File(fileName);
|
||||||
|
if (file.exists()) {
|
||||||
|
// file already exists -> asks for confirmation
|
||||||
|
MessageBox mb = new MessageBox(dialog.getParent(), SWT.ICON_WARNING
|
||||||
|
| SWT.YES | SWT.NO);
|
||||||
|
mb.setText("Confirm overwrite");
|
||||||
|
mb.setMessage(fileName + " already exists. Do you want to overwrite it?");
|
||||||
|
// user clicks Yes -> all done, drop out
|
||||||
|
if(mb.open() == SWT.YES) {
|
||||||
|
((WaveformViewer)obj).saveState(fileName);
|
||||||
|
done = true;
|
||||||
|
} else { // user clicks No -> redisplay the File Dialog
|
||||||
|
done = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// file does not exist -> save and drop out
|
||||||
|
((WaveformViewer)obj).saveState(fileName);
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return;
|
||||||
|
} // end if(!load)
|
||||||
|
|
||||||
|
else { // load active tab settings
|
||||||
|
String res = dialog.open();
|
||||||
|
if(res != null && part!=null && (obj instanceof WaveformViewer)) {
|
||||||
|
((WaveformViewer)obj).loadState(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
@ -49,6 +49,8 @@ import org.eclipse.swt.SWT;
|
|||||||
import org.eclipse.swt.custom.SashForm;
|
import org.eclipse.swt.custom.SashForm;
|
||||||
import org.eclipse.swt.events.ControlAdapter;
|
import org.eclipse.swt.events.ControlAdapter;
|
||||||
import org.eclipse.swt.events.ControlEvent;
|
import org.eclipse.swt.events.ControlEvent;
|
||||||
|
import org.eclipse.swt.events.DisposeEvent;
|
||||||
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
import org.eclipse.swt.events.ModifyListener;
|
||||||
import org.eclipse.swt.events.PaintEvent;
|
import org.eclipse.swt.events.PaintEvent;
|
||||||
@ -58,6 +60,7 @@ import org.eclipse.swt.events.SelectionEvent;
|
|||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.swt.widgets.ToolBar;
|
import org.eclipse.swt.widgets.ToolBar;
|
||||||
import org.eclipse.swt.widgets.ToolItem;
|
import org.eclipse.swt.widgets.ToolItem;
|
||||||
@ -196,12 +199,16 @@ public class DesignBrowser {
|
|||||||
@Override
|
@Override
|
||||||
public void selectionChanged(SelectionChangedEvent event) {
|
public void selectionChanged(SelectionChangedEvent event) {
|
||||||
ISelection selection=event.getSelection();
|
ISelection selection=event.getSelection();
|
||||||
if( selection instanceof IStructuredSelection) {
|
if( selection instanceof IStructuredSelection) {
|
||||||
Object object= ((IStructuredSelection)selection).getFirstElement();
|
Object object= ((IStructuredSelection)selection).getFirstElement();
|
||||||
if(object instanceof IHierNode&& ((IHierNode)object).getChildNodes().size()!=0){
|
if(object instanceof IHierNode && ((IHierNode)object).getChildNodes().size()!=0){
|
||||||
txTableViewer.setInput(object);
|
txTableViewer.setInput(object);
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
else { //if selection is changed but empty
|
||||||
|
txTableViewer.setInput(null);
|
||||||
|
updateButtons();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -247,8 +254,8 @@ public class DesignBrowser {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectionChanged(SelectionChangedEvent event) {
|
public void selectionChanged(SelectionChangedEvent event) {
|
||||||
selectionService.setSelection(event.getSelection());
|
selectionService.setSelection(event.getSelection());
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -344,6 +351,16 @@ public class DesignBrowser {
|
|||||||
thisSelectionCount=selection.toList().size();
|
thisSelectionCount=selection.toList().size();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reset tree viewer and tableviewer after every closed tab
|
||||||
|
*/
|
||||||
|
protected void resetTreeViewer() {
|
||||||
|
//reset tree- and tableviewer
|
||||||
|
treeViewer.setInput(null);
|
||||||
|
txTableViewer.setInput(null);
|
||||||
|
txTableViewer.setSelection(null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the status event.
|
* Gets the status event.
|
||||||
@ -354,21 +371,35 @@ public class DesignBrowser {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Inject @Optional
|
@Inject @Optional
|
||||||
public void getActiveWaveformViewerEvent(@UIEventTopic(WaveformViewer.ACTIVE_WAVEFORMVIEW) WaveformViewer waveformViewerPart) {
|
public void getActiveWaveformViewerEvent(@UIEventTopic(WaveformViewer.ACTIVE_WAVEFORMVIEW) WaveformViewer waveformViewerPart) {
|
||||||
if(this.waveformViewerPart!=null)
|
if(this.waveformViewerPart!=null) {
|
||||||
this.waveformViewerPart.storeDesignBrowerState(new DBState());
|
this.waveformViewerPart.storeDesignBrowerState(new DBState());
|
||||||
|
}
|
||||||
|
if( this.waveformViewerPart == null || this.waveformViewerPart != waveformViewerPart ) {
|
||||||
|
waveformViewerPart.addDisposeListener( new DisposeListener() {
|
||||||
|
@Override
|
||||||
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
|
Control control = treeViewer.getControl();
|
||||||
|
// check if widget is already disposed (f.ex. because of workbench closing)
|
||||||
|
if (control == null || control.isDisposed()) { //if so: do nothing
|
||||||
|
}else { //reset tree- and tableviewer
|
||||||
|
resetTreeViewer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
this.waveformViewerPart=waveformViewerPart;
|
this.waveformViewerPart=waveformViewerPart;
|
||||||
IWaveformDb database = waveformViewerPart.getDatabase();
|
IWaveformDb database = waveformViewerPart.getDatabase();
|
||||||
Object input = treeViewer.getInput();
|
Object input = treeViewer.getInput();
|
||||||
if(input!=null && input instanceof List<?>){
|
if(input!=null && input instanceof List<?>){
|
||||||
IWaveformDb db = ((List<IWaveformDb>)input).get(0);
|
IWaveformDb db = ((List<IWaveformDb>)input).get(0);
|
||||||
if(db==database) return; // do nothing if old and new daabase is the same
|
if(db==database) return; // do nothing if old and new database is the same
|
||||||
((List<IWaveformDb>)input).get(0).removePropertyChangeListener(treeViewerPCL);
|
((List<IWaveformDb>)input).get(0).removePropertyChangeListener(treeViewerPCL);
|
||||||
}
|
}
|
||||||
treeViewer.setInput(Arrays.asList(database.isLoaded()?new IWaveformDb[]{database}:new IWaveformDb[]{new LoadingWaveformDb()}));
|
treeViewer.setInput(Arrays.asList(database.isLoaded()?new IWaveformDb[]{database}:new IWaveformDb[]{new LoadingWaveformDb()}));
|
||||||
Object state=this.waveformViewerPart.retrieveDesignBrowerState();
|
Object state=this.waveformViewerPart.retrieveDesignBrowerState();
|
||||||
if(state!=null && state instanceof DBState)
|
if(state!=null && state instanceof DBState)
|
||||||
((DBState)state).apply();
|
((DBState)state).apply();
|
||||||
else
|
else
|
||||||
txTableViewer.setInput(null);
|
txTableViewer.setInput(null);
|
||||||
// Set up the tree viewer
|
// Set up the tree viewer
|
||||||
database.addPropertyChangeListener(treeViewerPCL);
|
database.addPropertyChangeListener(treeViewerPCL);
|
||||||
|
@ -21,7 +21,9 @@ import org.eclipse.e4.core.di.annotations.Optional;
|
|||||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||||
import org.eclipse.e4.ui.di.Focus;
|
import org.eclipse.e4.ui.di.Focus;
|
||||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||||
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||||
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
||||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
|
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
|
||||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
||||||
@ -119,8 +121,10 @@ public class TransactionDetails {
|
|||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
attributeFilter.setSearchText(((Text) e.widget).getText());
|
attributeFilter.setSearchText(((Text) e.widget).getText());
|
||||||
treeViewer.refresh();
|
treeViewer.refresh();
|
||||||
|
treeViewer.expandAll(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
nameFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
nameFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
attributeFilter = new TxAttributeFilter();
|
attributeFilter = new TxAttributeFilter();
|
||||||
@ -341,10 +345,14 @@ public class TransactionDetails {
|
|||||||
* @param selection the new selection
|
* @param selection the new selection
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
public void setSelection(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional IStructuredSelection selection){
|
public void setSelection(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional IStructuredSelection selection, EPartService partService){
|
||||||
|
// only react if selection is actually from the WaveformViewer and nothing else
|
||||||
|
MPart part = partService.getActivePart();
|
||||||
|
if( part == null || ! (part.getObject() instanceof WaveformViewer ) )
|
||||||
|
return;
|
||||||
if(treeViewer!=null && selection!=null && !treeViewer.getTree().isDisposed()){
|
if(treeViewer!=null && selection!=null && !treeViewer.getTree().isDisposed()){
|
||||||
if( selection instanceof IStructuredSelection) {
|
if( selection instanceof IStructuredSelection) {
|
||||||
setInput(((IStructuredSelection)selection).getFirstElement());
|
setInput(((IStructuredSelection)selection).getFirstElement());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -461,16 +469,20 @@ public class TransactionDetails {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean select(Viewer viewer, Object parentElement, Object element) {
|
public boolean select(Viewer viewer, Object parentElement, Object element) {
|
||||||
|
|
||||||
if (searchString == null || searchString.length() == 0) {
|
if (searchString == null || searchString.length() == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(element instanceof ITxAttribute){
|
if(element instanceof TreeNode) {
|
||||||
ITxAttribute p = (ITxAttribute) element;
|
|
||||||
if (p.getName().matches(searchString)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else if(element instanceof TreeNode)
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
if(element instanceof ITxAttribute){
|
||||||
|
return (((ITxAttribute) element).getName().toLowerCase().matches(searchString.toLowerCase()));
|
||||||
|
}
|
||||||
|
if(element instanceof Object[]) {
|
||||||
|
return (((Object[])element)[0]).toString().toLowerCase().matches(searchString.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
|
|||||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||||
import org.eclipse.jface.viewers.StructuredSelection;
|
import org.eclipse.jface.viewers.StructuredSelection;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.events.DisposeEvent;
|
||||||
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.events.MouseEvent;
|
import org.eclipse.swt.events.MouseEvent;
|
||||||
import org.eclipse.swt.events.MouseTrackListener;
|
import org.eclipse.swt.events.MouseTrackListener;
|
||||||
import org.eclipse.swt.events.MouseWheelListener;
|
import org.eclipse.swt.events.MouseWheelListener;
|
||||||
@ -72,8 +74,10 @@ import org.eclipse.swt.widgets.Composite;
|
|||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.swt.widgets.Event;
|
import org.eclipse.swt.widgets.Event;
|
||||||
import org.eclipse.swt.widgets.Listener;
|
import org.eclipse.swt.widgets.Listener;
|
||||||
|
import org.eclipse.swt.widgets.MessageBox;
|
||||||
|
|
||||||
import com.minres.scviewer.database.ITx;
|
import com.minres.scviewer.database.ITx;
|
||||||
|
import com.minres.scviewer.database.ITxEvent;
|
||||||
import com.minres.scviewer.database.ITxRelation;
|
import com.minres.scviewer.database.ITxRelation;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.IWaveformDb;
|
import com.minres.scviewer.database.IWaveformDb;
|
||||||
@ -100,7 +104,7 @@ import com.minres.scviewer.e4.application.preferences.PreferenceConstants;
|
|||||||
* The Class WaveformViewerPart.
|
* The Class WaveformViewerPart.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("restriction")
|
@SuppressWarnings("restriction")
|
||||||
public class WaveformViewer implements IFileChangeListener, IPreferenceChangeListener {
|
public class WaveformViewer implements IFileChangeListener, IPreferenceChangeListener, DisposeListener {
|
||||||
|
|
||||||
/** The Constant ACTIVE_WAVEFORMVIEW. */
|
/** The Constant ACTIVE_WAVEFORMVIEW. */
|
||||||
public static final String ACTIVE_WAVEFORMVIEW = "Active_Waveform_View"; //$NON-NLS-1$
|
public static final String ACTIVE_WAVEFORMVIEW = "Active_Waveform_View"; //$NON-NLS-1$
|
||||||
@ -126,7 +130,16 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
|
|
||||||
/** The Constant BASE_LINE_TIME. */
|
/** The Constant BASE_LINE_TIME. */
|
||||||
protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; //$NON-NLS-1$
|
protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/** The Constant SELECTED_TX_ID. */
|
||||||
|
protected static final String SELECTED_TX_ID = "SELECTED_TX_ID"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/** The Constant SELECTED_TRACKENTRY_NAME. */
|
||||||
|
protected static final String SELECTED_TRACKENTRY_NAME = "SELECTED_TRACKENTRY_NAME"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/** The Constant WAVEFORM_SELECTED. */
|
||||||
|
protected static final String WAVEFORM_SELECTED = ".WAVEFORM_SELECTED"; //$NON-NLS-1$
|
||||||
|
|
||||||
/** The Constant FILE_CHECK_INTERVAL. */
|
/** The Constant FILE_CHECK_INTERVAL. */
|
||||||
protected static final long FILE_CHECK_INTERVAL = 60000;
|
protected static final long FILE_CHECK_INTERVAL = 60000;
|
||||||
|
|
||||||
@ -139,6 +152,9 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
/** The Constant WAVE_ACTION_ID. */
|
/** The Constant WAVE_ACTION_ID. */
|
||||||
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave"; //$NON-NLS-1$
|
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/** The number of active DisposeListeners */
|
||||||
|
private static int disposeListenerNumber = 0;
|
||||||
|
|
||||||
/** The factory. */
|
/** The factory. */
|
||||||
WaveformViewerFactory factory = new WaveformViewerFactory();
|
WaveformViewerFactory factory = new WaveformViewerFactory();
|
||||||
|
|
||||||
@ -168,6 +184,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
@Inject
|
@Inject
|
||||||
@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE)
|
@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE)
|
||||||
IEclipsePreferences prefs;
|
IEclipsePreferences prefs;
|
||||||
|
|
||||||
|
@Inject @Optional DesignBrowser designBrowser;
|
||||||
|
|
||||||
/** The database. */
|
/** The database. */
|
||||||
private IWaveformDb database;
|
private IWaveformDb database;
|
||||||
@ -211,6 +229,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
*/
|
*/
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory) {
|
public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory) {
|
||||||
|
disposeListenerNumber += 1;
|
||||||
|
|
||||||
myPart = part;
|
myPart = part;
|
||||||
myParent = parent;
|
myParent = parent;
|
||||||
database = dbFactory.getDatabase();
|
database = dbFactory.getDatabase();
|
||||||
@ -229,6 +249,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
});
|
});
|
||||||
waveformPane = factory.createPanel(parent);
|
waveformPane = factory.createPanel(parent);
|
||||||
waveformPane.setMaxTime(0);
|
waveformPane.setMaxTime(0);
|
||||||
|
|
||||||
|
//set selection to empty selection when opening a new waveformPane
|
||||||
|
selectionService.setSelection(new StructuredSelection());
|
||||||
|
|
||||||
waveformPane.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
|
waveformPane.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
@ -248,11 +272,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - time));
|
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - time));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
waveformPane.addSelectionChangedListener(new ISelectionChangedListener() {
|
waveformPane.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void selectionChanged(SelectionChangedEvent event) {
|
public void selectionChanged(SelectionChangedEvent event) {
|
||||||
if (event.getSelection() instanceof IStructuredSelection)
|
if (event.getSelection() instanceof IStructuredSelection) {
|
||||||
selectionService.setSelection(event.getSelection());
|
selectionService.setSelection(event.getSelection());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
waveformPane.getWaveformControl().addMouseTrackListener(new MouseTrackListener() {
|
waveformPane.getWaveformControl().addMouseTrackListener(new MouseTrackListener() {
|
||||||
@ -383,6 +409,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
prefs.addPreferenceChangeListener(this);
|
prefs.addPreferenceChangeListener(this);
|
||||||
|
|
||||||
|
waveformPane.addDisposeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
@ -468,7 +496,17 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
job.addJobChangeListener(new JobChangeAdapter() {
|
job.addJobChangeListener(new JobChangeAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void done(IJobChangeEvent event) {
|
public void done(IJobChangeEvent event) {
|
||||||
if (event.getResult().getCode() != Status.OK_STATUS.getCode()) return;
|
IStatus result = event.getResult();
|
||||||
|
if( (!result.isMultiStatus() && result.getCode() != Status.OK_STATUS.getCode() ) ||
|
||||||
|
(result.isMultiStatus() && result.getChildren().length > 0 && result.getChildren()[0].getCode() != Status.OK_STATUS.getCode() ) ){
|
||||||
|
// kill editor and pop up warning for user
|
||||||
|
sync.asyncExec(() -> {
|
||||||
|
final Display display = myParent.getDisplay();
|
||||||
|
MessageDialog.openWarning(display.getActiveShell(), "Error loading database", "Database cannot be loaded. Aborting...");
|
||||||
|
ePartService.hidePart(myPart, true);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
sync.asyncExec(()->{
|
sync.asyncExec(()->{
|
||||||
waveformPane.setMaxTime(database.getMaxTime());
|
waveformPane.setMaxTime(database.getMaxTime());
|
||||||
if (state != null)
|
if (state != null)
|
||||||
@ -578,6 +616,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void saveState(String fileName){
|
public void saveState(String fileName){
|
||||||
|
|
||||||
|
|
||||||
Map<String, String> persistedState = new HashMap<>();
|
Map<String, String> persistedState = new HashMap<>();
|
||||||
persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); //$NON-NLS-1$
|
persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); //$NON-NLS-1$
|
||||||
Integer index = 0;
|
Integer index = 0;
|
||||||
@ -588,10 +628,14 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
saveWaveformViewerState(persistedState);
|
saveWaveformViewerState(persistedState);
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.putAll(persistedState);
|
props.putAll(persistedState);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FileOutputStream out = new FileOutputStream(fileName);
|
|
||||||
props.store(out, "Written by SCViewer"); //$NON-NLS-1$
|
FileOutputStream out = new FileOutputStream(fileName);
|
||||||
out.close();
|
props.store(out, "Written by SCViewer"); //$NON-NLS-1$
|
||||||
|
out.close();
|
||||||
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -600,6 +644,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
public void loadState(String fileName){
|
public void loadState(String fileName){
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
try {
|
try {
|
||||||
|
//clear old streams before loading tab settings
|
||||||
|
if(!waveformPane.getStreamList().isEmpty()) {
|
||||||
|
waveformPane.getStreamList().clear();
|
||||||
|
for (TrackEntry trackEntry : waveformPane.getStreamList()) {
|
||||||
|
trackEntry.selected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
FileInputStream in = new FileInputStream(fileName);
|
FileInputStream in = new FileInputStream(fileName);
|
||||||
props.load(in);
|
props.load(in);
|
||||||
in.close();
|
in.close();
|
||||||
@ -619,12 +670,15 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
*/
|
*/
|
||||||
protected void saveWaveformViewerState(Map<String, String> persistedState) {
|
protected void saveWaveformViewerState(Map<String, String> persistedState) {
|
||||||
Integer index;
|
Integer index;
|
||||||
|
boolean isStream = false;
|
||||||
persistedState.put(SHOWN_WAVEFORM + "S", Integer.toString(waveformPane.getStreamList().size())); //$NON-NLS-1$
|
persistedState.put(SHOWN_WAVEFORM + "S", Integer.toString(waveformPane.getStreamList().size())); //$NON-NLS-1$
|
||||||
index = 0;
|
index = 0;
|
||||||
for (TrackEntry trackEntry : waveformPane.getStreamList()) {
|
for (TrackEntry trackEntry : waveformPane.getStreamList()) {
|
||||||
|
if(trackEntry.isStream()) { isStream=true; }
|
||||||
persistedState.put(SHOWN_WAVEFORM + index, trackEntry.waveform.getFullName());
|
persistedState.put(SHOWN_WAVEFORM + index, trackEntry.waveform.getFullName());
|
||||||
persistedState.put(SHOWN_WAVEFORM + index + VALUE_DISPLAY, trackEntry.valueDisplay.toString());
|
persistedState.put(SHOWN_WAVEFORM + index + VALUE_DISPLAY, trackEntry.valueDisplay.toString());
|
||||||
persistedState.put(SHOWN_WAVEFORM + index + WAVE_DISPLAY, trackEntry.waveDisplay.toString());
|
persistedState.put(SHOWN_WAVEFORM + index + WAVE_DISPLAY, trackEntry.waveDisplay.toString());
|
||||||
|
persistedState.put(SHOWN_WAVEFORM + index + WAVEFORM_SELECTED, String.valueOf(trackEntry.selected).toUpperCase());
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
List<ICursor> cursors = waveformPane.getCursorList();
|
List<ICursor> cursors = waveformPane.getCursorList();
|
||||||
@ -636,8 +690,38 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
}
|
}
|
||||||
persistedState.put(ZOOM_LEVEL, Integer.toString(waveformPane.getZoomLevel()));
|
persistedState.put(ZOOM_LEVEL, Integer.toString(waveformPane.getZoomLevel()));
|
||||||
persistedState.put(BASE_LINE_TIME, Long.toString(waveformPane.getBaselineTime()));
|
persistedState.put(BASE_LINE_TIME, Long.toString(waveformPane.getBaselineTime()));
|
||||||
|
|
||||||
|
// get selected transaction of a stream
|
||||||
|
ISelection selection = waveformPane.getSelection();
|
||||||
|
if (!selection.isEmpty() && isStream) {
|
||||||
|
List<Object> t = getISelection(selection);
|
||||||
|
ITx tx = (ITx) t.get(0);
|
||||||
|
TrackEntry te = (TrackEntry) t.get(1);
|
||||||
|
// get transaction id
|
||||||
|
persistedState.put(SELECTED_TX_ID, Long.toString(tx.getId()));
|
||||||
|
//get TrackEntry name
|
||||||
|
String name = te.getStream().getFullName();
|
||||||
|
persistedState.put(SELECTED_TRACKENTRY_NAME, name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected List<Object> getISelection(ISelection selection){
|
||||||
|
List<Object> result = new LinkedList<Object> ();
|
||||||
|
|
||||||
|
if ( selection instanceof IStructuredSelection )
|
||||||
|
{
|
||||||
|
Iterator<?> i = ((IStructuredSelection)selection).iterator();
|
||||||
|
while (i.hasNext()){
|
||||||
|
Object o = i.next ();
|
||||||
|
if (o == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
result.add(o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restore waveform viewer state.
|
* Restore waveform viewer state.
|
||||||
*
|
*
|
||||||
@ -650,6 +734,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
IWaveform waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i));
|
IWaveform waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i));
|
||||||
if (waveform != null) {
|
if (waveform != null) {
|
||||||
TrackEntry t = new TrackEntry(waveform);
|
TrackEntry t = new TrackEntry(waveform);
|
||||||
|
//check if t is selected
|
||||||
|
boolean isSelected = Boolean.valueOf(state.get(SHOWN_WAVEFORM + i + WAVEFORM_SELECTED));
|
||||||
|
if(isSelected) {
|
||||||
|
t.selected = true;
|
||||||
|
} else {
|
||||||
|
t.selected = false;
|
||||||
|
}
|
||||||
res.add(t);
|
res.add(t);
|
||||||
String v = state.get(SHOWN_WAVEFORM + i + VALUE_DISPLAY);
|
String v = state.get(SHOWN_WAVEFORM + i + VALUE_DISPLAY);
|
||||||
if(v!=null)
|
if(v!=null)
|
||||||
@ -683,6 +774,38 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (state.containsKey(SELECTED_TX_ID) && state.containsKey(SELECTED_TRACKENTRY_NAME)) {
|
||||||
|
try {
|
||||||
|
Long txId = Long.parseLong(state.get(SELECTED_TX_ID));
|
||||||
|
String trackentryName = state.get(SELECTED_TRACKENTRY_NAME);
|
||||||
|
|
||||||
|
//get TrackEntry Object based on name and TX Object by id and put into selectionList
|
||||||
|
for(TrackEntry te : res) {
|
||||||
|
if(te.waveform.getFullName().compareTo(trackentryName)==0) {
|
||||||
|
boolean found = false;
|
||||||
|
// TODO: find transaction by time? To avoid 3x for-loop
|
||||||
|
for( List<ITxEvent> lev : te.getStream().getEvents().values() ) {
|
||||||
|
if(lev == null) continue;
|
||||||
|
for(ITxEvent itxe : lev) {
|
||||||
|
if(itxe == null) continue;
|
||||||
|
ITx itx = itxe.getTransaction();
|
||||||
|
if(itx.getId() == txId) {
|
||||||
|
found = true;
|
||||||
|
ArrayList<Object> selectionList = new ArrayList<Object>();
|
||||||
|
selectionList.add(te);
|
||||||
|
selectionList.add(itx);
|
||||||
|
waveformPane.setSelection(new StructuredSelection (selectionList));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(found) break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
updateAll();
|
updateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1090,4 +1213,28 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
|||||||
waveformPane.update();
|
waveformPane.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add dispose listener
|
||||||
|
*
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void addDisposeListener (DisposeListener listener) {
|
||||||
|
waveformPane.getControl().addDisposeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* triggers included actions if widget is disposed
|
||||||
|
*
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
|
disposeListenerNumber -= 1;
|
||||||
|
if( disposeListenerNumber == 0) { //if the last tab is closed, reset statusbar
|
||||||
|
eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, null);
|
||||||
|
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, null);
|
||||||
|
eventBroker.post(WaveStatusBarControl.MARKER_TIME, null);
|
||||||
|
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -10,7 +10,7 @@
|
|||||||
<relativePath>../com.minres.scviewer.parent</relativePath>
|
<relativePath>../com.minres.scviewer.parent</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||||
<version>2.1.1-SNAPSHOT</version>
|
<version>2.1.4-SNAPSHOT</version>
|
||||||
<packaging>eclipse-repository</packaging>
|
<packaging>eclipse-repository</packaging>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<build>
|
<build>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<?pde version="3.5"?>
|
<?pde version="3.5"?>
|
||||||
|
|
||||||
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.1.1.qualifier" useFeatures="false" includeLaunchers="true">
|
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.1.4.qualifier" useFeatures="false" includeLaunchers="true">
|
||||||
|
|
||||||
<configIni use="default">
|
<configIni use="default">
|
||||||
</configIni>
|
</configIni>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
@ -24,25 +25,10 @@
|
|||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<tycho-version>0.23.1</tycho-version>
|
<tycho-version>1.5.0</tycho-version>
|
||||||
<tycho-extras-version>${tycho-version}</tycho-extras-version>
|
<groovy-eclipse-compiler-version>3.5.0</groovy-eclipse-compiler-version>
|
||||||
<groovy-eclipse-compiler-version>2.8.0-01</groovy-eclipse-compiler-version>
|
<groovy-eclipse-batch-version>2.5.8-03</groovy-eclipse-batch-version>
|
||||||
<!-- <groovy-eclipse-batch-version>2.0.5</groovy-eclipse-batch-version> -->
|
|
||||||
<groovy-eclipse-batch-version>2.1.8-01</groovy-eclipse-batch-version>
|
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>mars</id>
|
|
||||||
<layout>p2</layout>
|
|
||||||
<url>http://download.eclipse.org/releases/photon</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<id>GRECLIPSE</id>
|
|
||||||
<layout>p2</layout>
|
|
||||||
<url>http://dist.springsource.org/snapshot/GRECLIPSE/e4.8</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
@ -53,11 +39,54 @@
|
|||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
|
<artifactId>tycho-source-plugin</artifactId>
|
||||||
|
<version>${tycho-version}</version>
|
||||||
|
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>plugin-source</id>
|
||||||
|
<goals>
|
||||||
|
<goal>plugin-source</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
|
<artifactId>tycho-p2-plugin</artifactId>
|
||||||
|
<version>${tycho-version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-p2-metadata</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>p2-metadata</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
|
<artifactId>tycho-versions-plugin</artifactId>
|
||||||
|
<version>${tycho-version}</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
<groupId>org.eclipse.tycho</groupId>
|
||||||
<artifactId>target-platform-configuration</artifactId>
|
<artifactId>target-platform-configuration</artifactId>
|
||||||
<version>${tycho-version}</version>
|
<version>${tycho-version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<target>
|
||||||
|
<artifact>
|
||||||
|
<groupId>com.minres.scviewer</groupId>
|
||||||
|
<artifactId>com.minres.scviewer.target</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
</artifact>
|
||||||
|
</target>
|
||||||
<environments>
|
<environments>
|
||||||
<environment>
|
<environment>
|
||||||
<os>linux</os>
|
<os>linux</os>
|
||||||
@ -91,7 +120,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.eclipse.tycho.extras</groupId>
|
<groupId>org.eclipse.tycho.extras</groupId>
|
||||||
<artifactId>tycho-source-feature-plugin</artifactId>
|
<artifactId>tycho-source-feature-plugin</artifactId>
|
||||||
<version>${tycho-extras-version}</version>
|
<version>${tycho-version}</version>
|
||||||
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
@ -111,41 +140,6 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
|
||||||
<artifactId>tycho-source-plugin</artifactId>
|
|
||||||
<version>${tycho-version}</version>
|
|
||||||
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>plugin-source</id>
|
|
||||||
<goals>
|
|
||||||
<goal>plugin-source</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
|
||||||
<artifactId>tycho-p2-plugin</artifactId>
|
|
||||||
<version>${tycho-version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attached-p2-metadata</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>p2-metadata</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.eclipse.tycho</groupId>
|
|
||||||
<artifactId>tycho-versions-plugin</artifactId>
|
|
||||||
<version>${tycho-version}</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
@ -1,4 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="Photon Platform" sequenceNumber="138">
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?pde version="3.8"?>
|
||||||
|
<target name="com.minres.scviewer.target" sequenceNumber="138">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
|
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
|
||||||
@ -11,8 +13,9 @@
|
|||||||
<repository location="http://download.eclipse.org/releases/photon"/>
|
<repository location="http://download.eclipse.org/releases/photon"/>
|
||||||
</location>
|
</location>
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||||
<unit id="org.codehaus.groovy24.feature.feature.group" version="0.0.0"/>
|
<unit id="org.codehaus.groovy24.feature.feature.group" version="3.5.1.v201909291550-e48"/>
|
||||||
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.8/"/>
|
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.8/"/>
|
||||||
|
<unit id="org.codehaus.groovy25.feature.feature.group" version="3.5.1.v201909291550-e48"/>
|
||||||
</location>
|
</location>
|
||||||
</locations>
|
</locations>
|
||||||
<environment>
|
<environment>
|
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="Neon Platform" sequenceNumber="138">
|
|
||||||
<locations>
|
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
|
||||||
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.300.v20161122-1740"/>
|
|
||||||
<unit id="org.eclipse.platform.sdk" version="4.6.2.M20161124-1400"/>
|
|
||||||
<unit id="org.eclipse.rcp.sdk.id" version="4.6.2.M20161124-1400"/>
|
|
||||||
<unit id="org.eclipse.rcptt.core.feature.group" version="2.1.0.201604261352"/>
|
|
||||||
<repository location="http://download.eclipse.org/releases/neon"/>
|
|
||||||
</location>
|
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
|
||||||
<unit id="org.codehaus.groovy24.feature.feature.group" version="2.9.3.xx-201806261157-e46"/>
|
|
||||||
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.6"/>
|
|
||||||
</location>
|
|
||||||
</locations>
|
|
||||||
<environment>
|
|
||||||
<arch>x86_64</arch>
|
|
||||||
<nl>de_DE</nl>
|
|
||||||
</environment>
|
|
||||||
<launcherArgs>
|
|
||||||
<vmArgs>-Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=256 -Xms40m -Xmx2G </vmArgs>
|
|
||||||
</launcherArgs>
|
|
||||||
</target>
|
|
@ -4,7 +4,7 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>photon</artifactId>
|
<artifactId>com.minres.scviewer.target</artifactId>
|
||||||
|
|
||||||
<packaging>eclipse-target-definition</packaging>
|
<packaging>eclipse-target-definition</packaging>
|
||||||
<name>SCViewer Target Definition</name>
|
<name>SCViewer Target Definition</name>
|
||||||
|
36
com.minres.scviewer.ui/src/com/minres/scviewer/ui/Hex.java
Normal file
36
com.minres.scviewer.ui/src/com/minres/scviewer/ui/Hex.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package com.minres.scviewer.ui;
|
||||||
|
public final class Hex {
|
||||||
|
public static byte[] decode(final String hex) {
|
||||||
|
if (hex.length() % 2 != 0) {
|
||||||
|
throw new IllegalArgumentException("A hex string must contain an even number of characters: " + hex);
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] out = new byte[hex.length() / 2];
|
||||||
|
|
||||||
|
for (int i = 0; i < hex.length(); i += 2) {
|
||||||
|
int high = Character.digit(hex.charAt(i), 16);
|
||||||
|
int low = Character.digit(hex.charAt(i + 1), 16);
|
||||||
|
if (high == -1 || low == -1) {
|
||||||
|
throw new IllegalArgumentException("A hex string can only contain the characters 0-9, A-F, a-f: " + hex);
|
||||||
|
}
|
||||||
|
|
||||||
|
out[i / 2] = (byte) (high * 16 + low);
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final char[] UPPER_HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', };
|
||||||
|
|
||||||
|
public static String encode(final byte[] bytes) {
|
||||||
|
StringBuilder stringBuilder = new StringBuilder(bytes.length * 2);
|
||||||
|
for (byte cur : bytes) {
|
||||||
|
stringBuilder.append(UPPER_HEX_DIGITS[(cur >> 4) & 0xF]);
|
||||||
|
stringBuilder.append(UPPER_HEX_DIGITS[(cur & 0xF)]);
|
||||||
|
}
|
||||||
|
return stringBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Hex() {
|
||||||
|
}
|
||||||
|
}
|
@ -71,7 +71,7 @@ public class TxEditorInputFactory implements IElementFactory {
|
|||||||
String listData = memento.getString(TAG_STREAMLIST);
|
String listData = memento.getString(TAG_STREAMLIST);
|
||||||
if (listData != null) {
|
if (listData != null) {
|
||||||
try {
|
try {
|
||||||
ByteArrayInputStream bais = new ByteArrayInputStream(javax.xml.bind.DatatypeConverter.parseHexBinary(listData));
|
ByteArrayInputStream bais = new ByteArrayInputStream(Hex.decode(listData));
|
||||||
ObjectInputStream ois = new ObjectInputStream(bais);
|
ObjectInputStream ois = new ObjectInputStream(bais);
|
||||||
Object obj = ois.readObject();
|
Object obj = ois.readObject();
|
||||||
if(obj instanceof List<?>)
|
if(obj instanceof List<?>)
|
||||||
@ -107,8 +107,9 @@ public class TxEditorInputFactory implements IElementFactory {
|
|||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
ObjectOutputStream oos = new ObjectOutputStream(baos);
|
||||||
oos.writeObject(input.getStreamNames());
|
oos.writeObject(input.getStreamNames());
|
||||||
memento.putString(TAG_STREAMLIST, javax.xml.bind.DatatypeConverter.printHexBinary(baos.toByteArray()));
|
memento.putString(TAG_STREAMLIST, Hex.encode(baos.toByteArray()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user