- added SQLite back end
- reworked graphical representation to use widgets
This commit is contained in:
7
com.minres.scviewer.database/.classpath
Normal file
7
com.minres.scviewer.database/.classpath
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
1
com.minres.scviewer.database/.gitignore
vendored
Normal file
1
com.minres.scviewer.database/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/bin
|
28
com.minres.scviewer.database/.project
Normal file
28
com.minres.scviewer.database/.project
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.minres.scviewer.database</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
8
com.minres.scviewer.database/META-INF/MANIFEST.MF
Normal file
8
com.minres.scviewer.database/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,8 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Transaction Database
|
||||
Bundle-SymbolicName: com.minres.scviewer.database
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: MINRES Technologies GmbH
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Export-Package: com.minres.scviewer.database
|
4
com.minres.scviewer.database/build.properties
Normal file
4
com.minres.scviewer.database/build.properties
Normal file
@ -0,0 +1,4 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
@ -0,0 +1,3 @@
|
||||
package com.minres.scviewer.database;
|
||||
|
||||
public enum AssociationType {BEGIN, RECORD, END}
|
@ -0,0 +1,16 @@
|
||||
package com.minres.scviewer.database;
|
||||
public enum DataType {
|
||||
BOOLEAN, // bool
|
||||
ENUMERATION, // enum
|
||||
INTEGER, // char, short, int, long, long long, sc_int, sc_bigint
|
||||
UNSIGNED, // unsigned { char, short, int, long, long long }, sc_uint, sc_biguint
|
||||
FLOATING_POINT_NUMBER, // float, double
|
||||
BIT_VECTOR, // sc_bit, sc_bv
|
||||
LOGIC_VECTOR, // sc_logic, sc_lv
|
||||
FIXED_POINT_INTEGER, // sc_fixed
|
||||
UNSIGNED_FIXED_POINT_INTEGER, // sc_ufixed
|
||||
RECORD, // struct/class
|
||||
POINTER, // T*
|
||||
ARRAY, // T[N]
|
||||
STRING // string, std::string
|
||||
};
|
@ -0,0 +1,72 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
public class EventTime implements Comparable<EventTime>{
|
||||
|
||||
public static final double NS = 1000000.0;
|
||||
|
||||
public static final double MS = 1000000000.0;
|
||||
|
||||
private long value; // unit is femto seconds
|
||||
|
||||
public EventTime(Long value, String unit){
|
||||
setValue(value, unit);
|
||||
}
|
||||
|
||||
public long getValue(){
|
||||
return(value);
|
||||
}
|
||||
|
||||
public double getScaledValue(double scale){
|
||||
return value/scale;
|
||||
}
|
||||
|
||||
public double getValueNS(){
|
||||
return getScaledValue(NS);
|
||||
}
|
||||
|
||||
public double getValueMS(){
|
||||
return getScaledValue(MS);
|
||||
}
|
||||
|
||||
public void setValue(long value){
|
||||
this.value=value;
|
||||
}
|
||||
|
||||
public void setValue(long value, String unit){
|
||||
this.value=value;
|
||||
if("fs".compareToIgnoreCase(unit)==0)
|
||||
this.value=value;
|
||||
else if("ps".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000;
|
||||
else if("ns".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000000;
|
||||
else if("us".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000000000;
|
||||
else if("ms".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000000000000L;
|
||||
else if("s".compareToIgnoreCase(unit)==0)
|
||||
this.value=value*1000000000000000L;
|
||||
else {
|
||||
System.err.print("Don't know what to do with "+unit+"\n");
|
||||
}
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return value/1000000 +"ns";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(EventTime other) {
|
||||
return this.value<other.value? -1 : this.value==other.value? 0 : 1;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
public interface ITrAttrType {
|
||||
public String getName();
|
||||
public DataType getDataType();
|
||||
public AssociationType getType();
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
public interface ITrAttribute extends ITrAttrType {
|
||||
public Object getValue();
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface ITrDb extends ITrHierNode {
|
||||
|
||||
public EventTime getMaxTime();
|
||||
|
||||
public ITrStream getStreamByName(String name);
|
||||
|
||||
public List<ITrStream> getAllStreams();
|
||||
|
||||
public void load(File inp) throws InputFormatException;
|
||||
|
||||
public void clear();
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ITrGenerator {
|
||||
public Long getId();
|
||||
public ITrStream getStream();
|
||||
public String getName();
|
||||
public List<ITransaction> getTransactions();
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.List;
|
||||
|
||||
public interface ITrHierNode {
|
||||
/**
|
||||
* Attach a non-null PropertyChangeListener to this object.
|
||||
*
|
||||
* @param l
|
||||
* a non-null PropertyChangeListener instance
|
||||
* @throws IllegalArgumentException
|
||||
* if the parameter is null
|
||||
*/
|
||||
public void addPropertyChangeListener(PropertyChangeListener l);
|
||||
/**
|
||||
* Remove a PropertyChangeListener from this component.
|
||||
*
|
||||
* @param l
|
||||
* a PropertyChangeListener instance
|
||||
*/
|
||||
public void removePropertyChangeListener(PropertyChangeListener l) ;
|
||||
|
||||
public String getFullName();
|
||||
|
||||
public String getName();
|
||||
|
||||
public void setName(String name);
|
||||
|
||||
public List<ITrHierNode> getChildNodes();
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.minres.scviewer.database;
|
||||
|
||||
public interface ITrRelation {
|
||||
|
||||
RelationType getRelationType();
|
||||
|
||||
ITransaction getSource();
|
||||
|
||||
ITransaction getTarget();
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ITrStream extends ITrHierNode {
|
||||
|
||||
public Long getId();
|
||||
|
||||
public String getKind();
|
||||
|
||||
public ITrDb getDb();
|
||||
|
||||
public List<ITrGenerator> getGenerators();
|
||||
|
||||
public List<ITransaction> getTransactions();
|
||||
|
||||
public ITransaction getTransactionById(long id);
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public interface ITransaction {
|
||||
|
||||
public Long getId();
|
||||
|
||||
public ITrStream getStream();
|
||||
|
||||
public ITrGenerator getGenerator();
|
||||
|
||||
public EventTime getBeginTime();
|
||||
|
||||
public EventTime getEndTime();
|
||||
|
||||
public List<ITrAttribute> getAttributes();
|
||||
|
||||
public Collection<ITrRelation> getIncomingRelations();
|
||||
|
||||
public Collection<ITrRelation> getOutgoingRelations();
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.minres.scviewer.database;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public interface ITransactionDbFactory {
|
||||
|
||||
ITrDb createDatabase(File file);
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
public class InputFormatException extends Exception {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8676129878197783368L;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
public class RelationType {
|
||||
|
||||
private String name;
|
||||
|
||||
public RelationType(String name) {
|
||||
super();
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user