diff --git a/com.minres.scviewer.database.sqlite/META-INF/MANIFEST.MF b/com.minres.scviewer.database.sqlite/META-INF/MANIFEST.MF index edea213..904a248 100644 --- a/com.minres.scviewer.database.sqlite/META-INF/MANIFEST.MF +++ b/com.minres.scviewer.database.sqlite/META-INF/MANIFEST.MF @@ -8,8 +8,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7 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", - com.google.guava;bundle-version="15.0.0" + org.eclipse.osgi.services;bundle-version="3.4.0" Bundle-ClassPath: ., sqlite-jdbc-3.8.7.jar Service-Component: OSGI-INF/component.xml diff --git a/com.minres.scviewer.database.sqlite/build.properties b/com.minres.scviewer.database.sqlite/build.properties index 14fb00e..8e3ad1b 100644 --- a/com.minres.scviewer.database.sqlite/build.properties +++ b/com.minres.scviewer.database.sqlite/build.properties @@ -1,3 +1,13 @@ +############################################################################### +# Copyright (c) 2014, 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 +############################################################################### source.. = src/ output.. = bin/ bin.includes = META-INF/,\ diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java index 334d3e7..45260fa 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite; import java.beans.IntrospectionException; @@ -6,14 +16,12 @@ import java.io.FileInputStream; import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.ArrayList; -import java.util.HashMap; 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.IWaveformEvent; -import com.minres.scviewer.database.RelationType; import com.minres.scviewer.database.sqlite.db.IDatabase; import com.minres.scviewer.database.sqlite.db.SQLiteDatabase; import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler; @@ -29,10 +37,12 @@ public class SQLiteDbLoader implements IWaveformDbLoader { long timeResolution=1; - private HashMap relationMap = new HashMap(); + private RelationTypeFactory rtf = new RelationTypeFactory(); private IWaveformDb db; + private ScvSimProps scvSimProps; + public SQLiteDbLoader() { } @@ -43,7 +53,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader { try { List event = handler.selectObjects(); if(event.size()>0) - return event.get(0).getTime(); + return event.get(0).getTime()*scvSimProps.getTime_resolution(); } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException | SQLException | IntrospectionException e) { e.printStackTrace(); @@ -58,7 +68,9 @@ public class SQLiteDbLoader implements IWaveformDbLoader { streams=new ArrayList>(); try { for(ScvStream scvStream:handler.selectObjects()){ - streams.add(new TxStream(database, db, scvStream)); + TxStream stream = new TxStream(database, db, scvStream); + stream.setRelationTypeFactory(rtf); + streams.add(stream); } } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException | SQLException | IntrospectionException e) { @@ -85,7 +97,8 @@ public class SQLiteDbLoader implements IWaveformDbLoader { database.setData("TIMERESOLUTION", 1L); SQLiteDatabaseSelectHandler handler = new SQLiteDatabaseSelectHandler(ScvSimProps.class, database); try { - for(ScvSimProps scvSimProps:handler.selectObjects()){ + for(ScvSimProps simProps:handler.selectObjects()){ + scvSimProps=simProps; database.setData("TIMERESOLUTION", scvSimProps.getTime_resolution()); } return true; @@ -95,13 +108,4 @@ public class SQLiteDbLoader implements IWaveformDbLoader { } return false; } - - - public RelationType getRelationType(String relationName) { - if(relationMap.containsKey(relationName)) return relationMap.get(relationName); - RelationType type = new RelationType(relationName); - relationMap.put(relationName, type); - return type; - } - } diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java index 5714129..0082c1c 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite; import java.beans.IntrospectionException; @@ -16,6 +26,7 @@ import com.minres.scviewer.database.ITxRelation; import com.minres.scviewer.database.ITxStream; import com.minres.scviewer.database.sqlite.db.IDatabase; import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler; +import com.minres.scviewer.database.sqlite.tables.ScvStream; import com.minres.scviewer.database.sqlite.tables.ScvTx; import com.minres.scviewer.database.sqlite.tables.ScvTxAttribute; import com.minres.scviewer.database.sqlite.tables.ScvTxEvent; @@ -29,7 +40,7 @@ public class Tx implements ITx { private ScvTx scvTx; private List attributes; private Long begin, end; - private List incoming, outgoing; + private List incoming, outgoing; public Tx(IDatabase database, TxStream trStream, TxGenerator trGenerator, ScvTx scvTx) { this.database=database; @@ -143,20 +154,26 @@ public class Tx implements ITx { } private ITxRelation createRelation(ScvTxRelation rel, boolean outgoing) { - long otherId = outgoing?rel.getSink():rel.getSrc(); -/*FIXME: + int otherId = outgoing?rel.getSink():rel.getSrc(); + SQLiteDatabaseSelectHandler handler = new SQLiteDatabaseSelectHandler(ScvTx.class, database, + "id="+otherId); try { - List scvTx=new SQLiteDatabaseSelectHandler(ScvTx.class, database, "id="+otherId).selectObjects(); - assert(scvTx.size()==1); - ITxStream stream = trStream.getDb().getStreamById(scvTx.get(0).getStream()); - Tx that=(Tx) stream.getTransactionById(otherId); + List res = handler.selectObjects(); + if(res.size()!=1) return null; + List streams = new SQLiteDatabaseSelectHandler(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()); + Tx that = (Tx) tgtStream.getTransactions().get(otherId); if(outgoing) - return new TxRelation(trStream.getDb().getRelationType(rel.getName()), this, that); + return new TxRelation(trStream.getRelationType(rel.getName()), this, that); else - return new TxRelation(trStream.getDb().getRelationType(rel.getName()), that, this); + return new TxRelation(trStream.getRelationType(rel.getName()), that, this); } catch (SecurityException | IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException | SQLException | IntrospectionException e) { - }*/ + e.printStackTrace(); + } + return null; } @@ -165,4 +182,8 @@ public class Tx implements ITx { return this.getBeginTime().compareTo(o.getBeginTime()); } + @Override + public String toString() { + return "tx#"+getId()+"@"+getBeginTime()+"-@"+getEndTime(); + } } diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java index 78311d2..f70cf6b 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxAttribute.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite; import com.minres.scviewer.database.AssociationType; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java index 24f78fc..d62f1d1 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite; import com.minres.scviewer.database.ITx; @@ -40,4 +50,8 @@ public class TxEvent implements ITxEvent { return type; } + @Override + public String toString() { + return type.toString()+"@"+getTime()+" of tx #"+tx.getId(); + } } diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java index 97b3f28..86a1ecd 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite; import java.util.List; @@ -11,7 +21,9 @@ import com.minres.scviewer.database.sqlite.tables.ScvGenerator; public class TxGenerator implements ITxGenerator { private ITxStream stream; + private ScvGenerator scvGenerator; + public TxGenerator(ITxStream stream, ScvGenerator scvGenerator) { this.stream=stream; this.scvGenerator=scvGenerator; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxRelation.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxRelation.java index 74412f5..6a2faf2 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxRelation.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxRelation.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite; import com.minres.scviewer.database.ITxRelation; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java index c85b5b6..797ba4b 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite; import java.beans.IntrospectionException; @@ -5,18 +15,20 @@ import java.lang.reflect.InvocationTargetException; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; 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.google.common.collect.TreeMultimap; 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.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; @@ -33,13 +45,15 @@ public class TxStream extends HierNode implements ITxStream { private ScvStream scvStream; - private HashMap generators; + private TreeMap generators; - private HashMap transactions; + private TreeMap transactions; private Integer maxConcurrency; - private TreeMultimap events; + private TreeMap> events; + + private RelationTypeFactory relationMap; public TxStream(IDatabase database, IWaveformDb waveformDb, ScvStream scvStream) { super(scvStream.getName()); @@ -74,7 +88,7 @@ public class TxStream extends HierNode implements ITxStream { if(generators==null){ SQLiteDatabaseSelectHandler handler = new SQLiteDatabaseSelectHandler( ScvGenerator.class, database, "stream="+scvStream.getId()); - generators=new HashMap(); + generators=new TreeMap(); try { for(ScvGenerator scvGenerator:handler.selectObjects()){ generators.put(scvGenerator.getId(), new TxGenerator(this, scvGenerator)); @@ -120,22 +134,32 @@ public class TxStream extends HierNode implements ITxStream { } @Override - public NavigableMap> getEvents(){ + public NavigableMap> getEvents(){ if(events==null){ - events=TreeMultimap.create(); + events=new TreeMap>(); for(Entry entry:getTransactions().entrySet()){ - events.put(entry.getValue().getBeginTime(), new TxEvent(TxEvent.Type.BEGIN, entry.getValue())); - events.put(entry.getValue().getBeginTime(), new TxEvent(TxEvent.Type.END, entry.getValue())); + putEvent(new TxEvent(TxEvent.Type.BEGIN, entry.getValue())); + putEvent(new TxEvent(TxEvent.Type.END, entry.getValue())); } } - return events.asMap(); + return events; } + private void putEvent(TxEvent ev){ + Long time = ev.getTime(); + if(!events.containsKey(time)){ + Vector vector=new Vector(); + vector.add(ev); + events.put(time, vector); + } else { + events.get(time).add(ev); + } + } - protected HashMap getTransactions() { + protected Map getTransactions() { if(transactions==null){ if(generators==null) getGenerators(); - transactions = new HashMap(); + transactions = new TreeMap(); SQLiteDatabaseSelectHandler handler = new SQLiteDatabaseSelectHandler(ScvTx.class, database, "stream="+scvStream.getId()); try { @@ -155,4 +179,14 @@ public class TxStream extends HierNode implements ITxStream { return getEvents().get(time); } + public void setRelationTypeFactory(RelationTypeFactory rtf) { + this.relationMap=rtf; + + } + + public RelationType getRelationType(String name) { + if(relationMap!=null) return relationMap.getRelationType(name); + return null; + } + } diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/AbstractDatabaseHandler.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/AbstractDatabaseHandler.java index d3a693d..e1d5055 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/AbstractDatabaseHandler.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/AbstractDatabaseHandler.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.db; import java.lang.reflect.Field; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/IDatabase.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/IDatabase.java index 8d61b73..1c3c2b4 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/IDatabase.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/IDatabase.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.db; import java.sql.Connection; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabase.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabase.java index 426101a..7d598c4 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabase.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabase.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.db; import java.sql.Connection; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseInsertHandler.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseInsertHandler.java index c0424a6..9f6cd86 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseInsertHandler.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseInsertHandler.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.db; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java index c6cf7ed..52ebfc9 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/db/SQLiteDatabaseSelectHandler.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.db; import java.beans.IntrospectionException; diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvGenerator.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvGenerator.java index b4ac28d..a3b4596 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvGenerator.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvGenerator.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.tables; public class ScvGenerator { diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvSimProps.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvSimProps.java index 7e128e5..99af033 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvSimProps.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvSimProps.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.tables; public class ScvSimProps { diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvStream.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvStream.java index e413e03..9c662e9 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvStream.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvStream.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.tables; public class ScvStream { diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTx.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTx.java index 84c352c..eac1996 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTx.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTx.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.tables; public class ScvTx { diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxAttribute.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxAttribute.java index 29b6708..04d484d 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxAttribute.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxAttribute.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.tables; public class ScvTxAttribute { diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxEvent.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxEvent.java index 9133c9a..231738c 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxEvent.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxEvent.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.tables; public class ScvTxEvent { diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxRelation.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxRelation.java index 6e2b7c7..9ddd56e 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxRelation.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/tables/ScvTxRelation.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.sqlite.tables; public class ScvTxRelation { diff --git a/com.minres.scviewer.database.test/build.properties b/com.minres.scviewer.database.test/build.properties index fc8c47c..d49042b 100644 --- a/com.minres.scviewer.database.test/build.properties +++ b/com.minres.scviewer.database.test/build.properties @@ -1,5 +1,15 @@ +############################################################################### +# Copyright (c) 2014, 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 +############################################################################### output.. = bin/ bin.includes = META-INF/,\ .,\ - OSGI-INF/component.xml + OSGI-INF/ source.. = src/ diff --git a/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java b/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java index a7489f7..8177a1b 100644 --- a/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java +++ b/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.test; import static org.junit.Assert.assertEquals; @@ -6,18 +16,12 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.File; -import java.net.URISyntaxException; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; import org.junit.Test; import com.minres.scviewer.database.IWaveformDb; -import com.minres.scviewer.database.IWaveformDbLoader; import com.minres.scviewer.database.WaveformDb; public class DatabaseServicesTest { diff --git a/com.minres.scviewer.database.text/build.properties b/com.minres.scviewer.database.text/build.properties index bc5a6df..d49042b 100644 --- a/com.minres.scviewer.database.text/build.properties +++ b/com.minres.scviewer.database.text/build.properties @@ -1,6 +1,15 @@ +############################################################################### +# Copyright (c) 2014, 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 +############################################################################### output.. = bin/ bin.includes = META-INF/,\ .,\ - component.xml,\ OSGI-INF/ source.. = src/ diff --git a/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.groovy b/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.groovy index 8098fab..203d841 100644 --- a/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.groovy +++ b/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.groovy @@ -1,8 +1,8 @@ package com.minres.scviewer.database.text; -import com.minres.scviewer.database.ITx; -import com.minres.scviewer.database.ITxEvent; -import com.minres.scviewer.database.IWaveformEvent; +import com.minres.scviewer.database.ITx +import com.minres.scviewer.database.ITxEvent +import com.minres.scviewer.database.IWaveformEvent class TxEvent implements ITxEvent { @@ -27,6 +27,11 @@ class TxEvent implements ITxEvent { } Long getTime(){ - return type==ITxEvent.Type.BEGIN?transaction.beginTime:transaction.endTime + type==ITxEvent.Type.BEGIN?transaction.beginTime:transaction.endTime + } + + @Override + String toString() { + type.toString()+"@"+getTime()+" of tx #"+transaction.id; } } diff --git a/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.groovy b/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.groovy index cfd7333..d67d8d8 100644 --- a/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.groovy +++ b/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.groovy @@ -15,9 +15,11 @@ 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 @@ -37,7 +39,7 @@ class TxGenerator implements ITxGenerator{ this.name=name } - ITxStream getStream(){ + ITxStream getStream(){ return stream; } diff --git a/com.minres.scviewer.database.vcd/build.properties b/com.minres.scviewer.database.vcd/build.properties index 34d2e4d..608209f 100644 --- a/com.minres.scviewer.database.vcd/build.properties +++ b/com.minres.scviewer.database.vcd/build.properties @@ -1,4 +1,15 @@ +############################################################################### +# Copyright (c) 2014, 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 +############################################################################### source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + OSGI-INF/ diff --git a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/IVCDDatabaseBuilder.java b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/IVCDDatabaseBuilder.java index 4479055..6c8ec9c 100644 --- a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/IVCDDatabaseBuilder.java +++ b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/IVCDDatabaseBuilder.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.vcd; import com.minres.scviewer.database.BitVector; @@ -41,10 +51,10 @@ public interface IVCDDatabaseBuilder { /** * Append transition. * - * @param intValue the int value - * @param fCurrentTime the f current time + * @param signalId the int value + * @param currentTime the current time in ps * @param decodedValues the decoded values */ - public void appendTransition(int intValue, long fCurrentTime, BitVector decodedValues); + public void appendTransition(int signalId, long currentTime, BitVector decodedValues); } diff --git a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java index 8d3bf5e..e3233a6 100644 --- a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java +++ b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.vcd; import java.io.File; @@ -93,7 +103,7 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder { */ @Override public Long getMaxTime() { - return maxTime* TIME_RES; + return maxTime; } /* (non-Javadoc) @@ -157,9 +167,9 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder { */ @SuppressWarnings("unchecked") @Override - public void appendTransition(int signalId, long fCurrentTime, BitVector decodedValues) { + public void appendTransition(int signalId, long currentTime, BitVector decodedValues) { VCDSignal signal = (VCDSignal) signals.get(signalId); - Long time = fCurrentTime* TIME_RES; + Long time = currentTime* TIME_RES; if(signal.getWidth()==1){ ((VCDSignal)signal).values.put(time, new VCDSignalChangeSingle(time, decodedValues.getValue()[0])); } else { diff --git a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDFileParser.java b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDFileParser.java index 82f30ad..ac19794 100644 --- a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDFileParser.java +++ b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDFileParser.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.vcd; import java.io.*; diff --git a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java index 59922cd..4bb459a 100644 --- a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java +++ b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java @@ -1,18 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.vcd; -import java.util.Collection; -import java.util.Map.Entry; import java.util.NavigableMap; import java.util.TreeMap; -import com.google.common.collect.Ordering; -import com.google.common.collect.TreeMultimap; import com.minres.scviewer.database.HierNode; import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignalChange; -import com.minres.scviewer.database.IWaveformEvent; import com.minres.scviewer.database.IWaveform; import com.minres.scviewer.database.IWaveformDb; +import com.minres.scviewer.database.IWaveformEvent; public class VCDSignal extends HierNode implements ISignal { diff --git a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeMulti.java b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeMulti.java index 552a6f3..fc20ed4 100644 --- a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeMulti.java +++ b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeMulti.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.vcd; import com.minres.scviewer.database.BitVector; @@ -25,4 +35,9 @@ public class VCDSignalChangeMulti extends SignalChange implements ISignalChangeM this.value = value; } + @Override + public String toString() { + return value.toHexString()+"@"+getTime(); + } + } diff --git a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeSingle.java b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeSingle.java index 2027c4d..dedb516 100644 --- a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeSingle.java +++ b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignalChangeSingle.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.vcd; import com.minres.scviewer.database.ISignalChangeSingle; @@ -20,4 +30,8 @@ public class VCDSignalChangeSingle extends SignalChange implements ISignalChange this.value = value; } + @Override + public String toString() { + return value+"@"+getTime(); + } } diff --git a/com.minres.scviewer.database/build.properties b/com.minres.scviewer.database/build.properties index 37fc20b..d49042b 100644 --- a/com.minres.scviewer.database/build.properties +++ b/com.minres.scviewer.database/build.properties @@ -1,6 +1,15 @@ +############################################################################### +# Copyright (c) 2014, 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 +############################################################################### output.. = bin/ bin.includes = META-INF/,\ .,\ - OSGI-INF/component.xml,\ - OSGI-INF/component.xml + OSGI-INF/ source.. = src/ diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/AssociationType.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/AssociationType.java index ee38a70..27f440a 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/AssociationType.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/AssociationType.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public enum AssociationType { diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/BitVector.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/BitVector.java index 3130655..a019003 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/BitVector.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/BitVector.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public class BitVector { diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java index 69aed0d..a85b57e 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/DataType.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public enum DataType { diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/HierNode.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/HierNode.java index 196c52c..b849733 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/HierNode.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/HierNode.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; import java.beans.PropertyChangeListener; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/IHierNode.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/IHierNode.java index 623b451..e1af551 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/IHierNode.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/IHierNode.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignal.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignal.java index d5f7ab9..188b057 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignal.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignal.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; import java.util.NavigableMap; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChange.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChange.java index 3d5ea53..a427d5b 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChange.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChange.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public interface ISignalChange extends IWaveformEvent { diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeMulti.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeMulti.java index 12b21bc..a5c02b4 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeMulti.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeMulti.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeSingle.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeSingle.java index df06908..9c35fc8 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeSingle.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ISignalChangeSingle.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public interface ISignalChangeSingle extends ISignalChange{ diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITx.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITx.java index f01b1ae..d20f951 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITx.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITx.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttribute.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttribute.java index e7913c5..4d5d4fc 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttribute.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttribute.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttributeType.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttributeType.java index fd529ac..cc5406b 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttributeType.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxAttributeType.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxEvent.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxEvent.java index 90bbd4a..50edab8 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxEvent.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxEvent.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public interface ITxEvent extends IWaveformEvent { diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxGenerator.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxGenerator.java index c835468..0287f0f 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxGenerator.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxGenerator.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxRelation.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxRelation.java index bc6b0ef..11a5c47 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxRelation.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxRelation.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public interface ITxRelation { diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxStream.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxStream.java index ee916d7..ce580fb 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxStream.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/ITxStream.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; @@ -20,7 +20,7 @@ public interface ITxStream extends IWaveform { public int getMaxConcurrency(); - public NavigableMap> getEvents(); + public NavigableMap> getEvents(); public Collection getWaveformEventsAtTime(Long time); diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java index a71513a..3e9994a 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java index 6263077..fbbbe8b 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDb.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; @@ -18,7 +18,7 @@ public interface IWaveformDb extends IHierNode { public Long getMaxTime(); - public IWaveform getStreamByName(String name); + public IWaveform getStreamByName(String name); public List> getAllWaves(); diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java index 7429886..f9bf63b 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformDbLoader.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; import java.io.File; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformEvent.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformEvent.java index 3f78a98..cccf0bf 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformEvent.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveformEvent.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/InputFormatException.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/InputFormatException.java index 3a1e649..bc5c8a3 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/InputFormatException.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/InputFormatException.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/RelationType.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/RelationType.java index 5fc2c02..c42ea5d 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/RelationType.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/RelationType.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.database; diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/SignalChange.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/SignalChange.java index 78b0c68..c57eeca 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/SignalChange.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/SignalChange.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; public class SignalChange implements IWaveformEvent { diff --git a/com.minres.scviewer.database/src/com/minres/scviewer/database/WaveformDb.java b/com.minres.scviewer.database/src/com/minres/scviewer/database/WaveformDb.java index 9b3a9a3..889423c 100644 --- a/com.minres.scviewer.database/src/com/minres/scviewer/database/WaveformDb.java +++ b/com.minres.scviewer.database/src/com/minres/scviewer/database/WaveformDb.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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; import java.io.File; @@ -44,7 +54,7 @@ public class WaveformDb extends HierNode implements IWaveformDb { } @Override - public IWaveform getStreamByName(String name) { + public IWaveform getStreamByName(String name) { return waveforms.get(name); } diff --git a/com.minres.scviewer.ui/META-INF/MANIFEST.MF b/com.minres.scviewer.ui/META-INF/MANIFEST.MF index ed456e0..1590348 100644 --- a/com.minres.scviewer.ui/META-INF/MANIFEST.MF +++ b/com.minres.scviewer.ui/META-INF/MANIFEST.MF @@ -21,3 +21,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Bundle-ClassPath: ., swing2swt.jar +Import-Package: com.google.common.collect diff --git a/com.minres.scviewer.ui/build.properties b/com.minres.scviewer.ui/build.properties index 4c22541..2ffd695 100644 --- a/com.minres.scviewer.ui/build.properties +++ b/com.minres.scviewer.ui/build.properties @@ -1,10 +1,18 @@ -output.. = bin/ +############################################################################### +# Copyright (c) 2014, 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 +############################################################################### bin.includes = plugin.xml,\ META-INF/,\ .,\ - icons/,\ contexts.xml,\ - res/,\ - swing2swt.jar,\ - OSGI-INF/ + res/ source.. = src/ +jars.compile.order = . +output.. = bin/ diff --git a/com.minres.scviewer.ui/plugin.xml b/com.minres.scviewer.ui/plugin.xml index 3b9348e..ae53bc7 100644 --- a/com.minres.scviewer.ui/plugin.xml +++ b/com.minres.scviewer.ui/plugin.xml @@ -116,8 +116,6 @@ id="com.minres.scviewer.ui.toolbar1"> @@ -130,8 +128,6 @@ @@ -142,8 +138,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -157,9 +302,37 @@ id="com.minres.scviewer.ui.gotoPrev" name="Prev"> + + + + + + + + + + + + + + @@ -170,11 +343,20 @@ + class="com.minres.scviewer.ui.handler.ZoomInOut" + commandId="com.minres.scviewer.ui.zoomin"> + definitionId="com.minres.scviewer.ui.waveEditorActive"> + + + + + + @@ -206,5 +388,30 @@ + + + + + + + + + + + + diff --git a/com.minres.scviewer.ui/res/images/zoom.png b/com.minres.scviewer.ui/res/images/zoom.png new file mode 100644 index 0000000..908612e Binary files /dev/null and b/com.minres.scviewer.ui/res/images/zoom.png differ diff --git a/com.minres.scviewer.ui/res/images/zoom_in.png b/com.minres.scviewer.ui/res/images/zoom_in.png new file mode 100644 index 0000000..cdf0a52 Binary files /dev/null and b/com.minres.scviewer.ui/res/images/zoom_in.png differ diff --git a/com.minres.scviewer.ui/res/images/zoom_out.png b/com.minres.scviewer.ui/res/images/zoom_out.png new file mode 100644 index 0000000..07bf98a Binary files /dev/null and b/com.minres.scviewer.ui/res/images/zoom_out.png differ diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorActionBarContributor.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorActionBarContributor.java index e01adaf..0d1d108 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorActionBarContributor.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorActionBarContributor.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui; import org.eclipse.ui.part.EditorActionBarContributor; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInput.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInput.java index f72645b..043fb0d 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInput.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInput.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui; import java.util.ArrayList; @@ -11,6 +21,8 @@ public class TxEditorInput extends FileEditorInput { private ArrayList streamNames; + private Boolean secondaryLoaded=null; + public TxEditorInput(IFile file) { super(file); streamNames=new ArrayList(); @@ -27,5 +39,13 @@ public class TxEditorInput extends FileEditorInput { public List getStreamNames() { return streamNames; } + + public Boolean isSecondaryLoaded() { + return secondaryLoaded; + } + + public void setSecondaryLoaded(Boolean secondaryLoaded) { + this.secondaryLoaded = secondaryLoaded; + } } diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInputFactory.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInputFactory.java index 15406de..7c0a939 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInputFactory.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorInputFactory.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui; import java.io.ByteArrayInputStream; @@ -21,13 +31,18 @@ public class TxEditorInputFactory implements IElementFactory { * with the "org.eclipse.ui.elementFactories" extension point. */ private static final String ID_FACTORY = "com.minres.scviewer.ui.TxEditorInputFactory"; //$NON-NLS-1$ - /** * Tag for the IFile.fullPath of the file resource. */ private static final String TAG_PATH = "path"; //$NON-NLS-1$ - - private static final String STREAMLIST_PATH = "stream_list"; //$NON-NLS-1$ + /** + * Tag for the secondaryLoade of the resource. + */ + private static final String TAG_SECONDARY = "secondary"; //$NON-NLS-1$ + /** + * Tag for the streamList of the resource. + */ + private static final String TAG_STREAMLIST = "stream_list"; //$NON-NLS-1$ /** * Creates a new factory. @@ -45,13 +60,15 @@ public class TxEditorInputFactory implements IElementFactory { if (fileName == null) { return null; } - // Get a handle to the IFile...which can be a handle // to a resource that does not exist in workspace IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileName)); if (file != null) { TxEditorInput tei = new TxEditorInput(file); - String listData = memento.getString(STREAMLIST_PATH); + Boolean isSecondaryLoaded = memento.getBoolean(TAG_SECONDARY); + if(isSecondaryLoaded!=null) + tei.setSecondaryLoaded(isSecondaryLoaded); + String listData = memento.getString(TAG_STREAMLIST); if (listData != null) { try { ByteArrayInputStream bais = new ByteArrayInputStream(javax.xml.bind.DatatypeConverter.parseHexBinary(listData)); @@ -85,11 +102,12 @@ public class TxEditorInputFactory implements IElementFactory { public static void saveState(IMemento memento, TxEditorInput input) { IFile file = input.getFile(); memento.putString(TAG_PATH, file.getFullPath().toString()); + if(input.isSecondaryLoaded()!=null) memento.putBoolean(TAG_SECONDARY, input.isSecondaryLoaded()); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(input.getStreamNames()); - memento.putString(STREAMLIST_PATH, javax.xml.bind.DatatypeConverter.printHexBinary(baos.toByteArray())); + memento.putString(TAG_STREAMLIST, javax.xml.bind.DatatypeConverter.printHexBinary(baos.toByteArray())); } catch (IOException e) { } } diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java index 0ca7719..1aa6f02 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPart.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui; @@ -20,12 +20,10 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.graphics.Color; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorSite; @@ -40,13 +38,10 @@ import org.eclipse.ui.views.contentoutline.IContentOutlinePage; import org.eclipse.ui.views.properties.IPropertySheetPage; import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; -import com.minres.scviewer.database.IWaveformDb; -import com.minres.scviewer.database.ITxStream; import com.minres.scviewer.database.IWaveform; +import com.minres.scviewer.database.IWaveformDb; +import com.minres.scviewer.database.IWaveformEvent; import com.minres.scviewer.database.WaveformDb; import com.minres.scviewer.ui.handler.GotoDirection; import com.minres.scviewer.ui.swt.TxDisplay; @@ -76,19 +71,6 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage public void createPartControl(Composite parent) { myParent=parent; database=new WaveformDb(); - txDisplay = new TxDisplay(parent); - txDisplay.setMaxTime(0); - getSite().setSelectionProvider(txDisplay); - new Thread(new Runnable() { - @Override - public void run() { - try { - loadDatabases(); - } catch (InvocationTargetException | IOException | InterruptedException e) { - handleLoadException(e); - } - } - }).run(); database.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { @@ -102,6 +84,19 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage } } }); + txDisplay = new TxDisplay(parent); + txDisplay.setMaxTime(0); + getSite().setSelectionProvider(txDisplay); + new Thread(new Runnable() { + @Override + public void run() { + try { + loadDatabases(); + } catch (InvocationTargetException | IOException | InterruptedException e) { + handleLoadException(e); + } + } + }).run(); } /* @@ -121,23 +116,35 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage IProgressService ps = wb.getProgressService(); IEditorInput input = getEditorInput(); File file=null; + boolean loadSecondary=false; + boolean dontAskForSecondary=false; ArrayList filesToLoad=new ArrayList(); - if(input instanceof IFileEditorInput){ - file = ((IFileEditorInput) input).getFile().getLocation().toFile(); + if(input instanceof TxEditorInput){ + TxEditorInput txInput = (TxEditorInput) input; + file = txInput.getFile().getLocation().toFile(); + loadSecondary=txInput.isSecondaryLoaded()==null||txInput.isSecondaryLoaded(); + dontAskForSecondary=txInput.isSecondaryLoaded()!=null; } else if(input instanceof FileStoreEditorInput){ file=new File(((FileStoreEditorInput) input).getURI().getPath()); } if(file.exists()){ filesToLoad.add(file); + if(loadSecondary){ String ext = getFileExtension(file.getName()); if("vcd".equals(ext.toLowerCase())){ - if(askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txdb")))) + if(dontAskForSecondary || askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txdb")))){ filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "txdb"))); - else if(askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txlog")))) + if(input instanceof TxEditorInput) ((TxEditorInput) input).setSecondaryLoaded(true); + }else if(dontAskForSecondary ||askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txlog")))){ filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "txlog"))); + if(input instanceof TxEditorInput) ((TxEditorInput) input).setSecondaryLoaded(true); + } } else if("txdb".equals(ext.toLowerCase()) || "txlog".equals(ext.toLowerCase())){ - if(askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "vcd")))) + if(dontAskForSecondary || askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "vcd")))){ filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "vcd"))); + if(input instanceof TxEditorInput) ((TxEditorInput) input).setSecondaryLoaded(true); + } + } } } @@ -183,7 +190,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage if(TxEditorPart.this.getEditorInput() instanceof TxEditorInput && ((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames().size()>0){ for(String streamName:((TxEditorInput) TxEditorPart.this.getEditorInput()).getStreamNames()){ - IWaveform stream = database.getStreamByName(streamName); + IWaveform stream = database.getStreamByName(streamName); if(stream!=null) txDisplay.getStreamList().add(stream); } @@ -266,7 +273,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage return database; } - public void addStreamToList(IWaveform obj){ + public void addStreamToList(IWaveform obj){ if(getEditorInput() instanceof TxEditorInput && !((TxEditorInput) getEditorInput()).getStreamNames().contains(obj.getFullName())){ ((TxEditorInput) getEditorInput()).getStreamNames().add(obj.getFullName()); txDisplay.getStreamList().add(obj); @@ -275,12 +282,12 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage } - public void addStreamsToList(IWaveform[] iWaveforms){ - for(IWaveform stream:iWaveforms) + public void addStreamsToList(IWaveform[] iWaveforms){ + for(IWaveform stream:iWaveforms) addStreamToList(stream); } - public void removeStreamFromList(IWaveform obj){ + public void removeStreamFromList(IWaveform obj){ if(getEditorInput() instanceof TxEditorInput && ((TxEditorInput) getEditorInput()).getStreamNames().contains(obj.getFullName())){ ((TxEditorInput) getEditorInput()).getStreamNames().remove(obj.getFullName()); txDisplay.getStreamList().remove(obj); @@ -288,12 +295,12 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage txDisplay.getStreamList().remove(obj); } - public void removeStreamsFromList(IWaveform[] iWaveforms){ - for(IWaveform stream:iWaveforms) + public void removeStreamsFromList(IWaveform[] iWaveforms){ + for(IWaveform stream:iWaveforms) removeStreamFromList(stream); } - public List getStreamList(){ + public List> getStreamList(){ return txDisplay.getStreamList(); } @@ -315,4 +322,16 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage txDisplay.moveSelection( next); } + public void setZoomLevel(Integer level) { + txDisplay.setZoomLevel(level); + } + + public void setZoomFit() { + txDisplay.setZoomLevel(6); + } + + public int getZoomLevel() { + return txDisplay.getZoomLevel(); + } + } diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPlugin.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPlugin.java index 22a5bb8..aa34c64 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPlugin.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/TxEditorPlugin.java @@ -1,18 +1,16 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui; import java.io.File; -import java.util.ArrayList; -import java.util.List; import java.util.MissingResourceException; import java.util.ResourceBundle; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/ITransactionPropertySource.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/ITransactionPropertySource.java index d0dba70..7935ae7 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/ITransactionPropertySource.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/ITransactionPropertySource.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.adapter; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java index 941a75f..c5c9cb8 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/TxAdapterFactory.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.adapter; import org.eclipse.core.runtime.IAdapterFactory; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoDirection.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoDirection.java index eaf250d..27f0192 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoDirection.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoDirection.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.handler; public enum GotoDirection {PREV, NEXT} \ No newline at end of file diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoNext.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoNext.java index a86900a..d54fd43 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoNext.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoNext.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.handler; import org.eclipse.core.commands.AbstractHandler; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoPrev.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoPrev.java index d5c74cd..f2d7a1e 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoPrev.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/GotoPrev.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.handler; import org.eclipse.core.commands.AbstractHandler; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/Zoom.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/Zoom.java new file mode 100644 index 0000000..398484c --- /dev/null +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/Zoom.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.handler; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.minres.scviewer.ui.TxEditorPart; + +public class Zoom extends AbstractHandler { + private static final String PARM_MSG = "com.minres.scviewer.ui.zoom.level"; + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IEditorPart editor = HandlerUtil.getActiveEditor(event); + String msg = event.getParameter(PARM_MSG); + if (msg == null) { + if(editor instanceof TxEditorPart){ + ((TxEditorPart)editor).setZoomFit(); + } + } else { + Integer level = Integer.parseInt(msg); + if(editor instanceof TxEditorPart){ + ((TxEditorPart)editor).setZoomLevel(level); + } + } + return null; + } + +} diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/ZoomInOut.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/ZoomInOut.java new file mode 100644 index 0000000..197bcfc --- /dev/null +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/handler/ZoomInOut.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.handler; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.handlers.HandlerUtil; + +import com.minres.scviewer.ui.TxEditorPart; + +public class ZoomInOut extends AbstractHandler { + private static final String ZOOMIN_ID = "com.minres.scviewer.ui.zoomin"; + private static final String ZOOMOUT_ID= "com.minres.scviewer.ui.zoomout"; + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IEditorPart editor = HandlerUtil.getActiveEditor(event); + if(editor instanceof TxEditorPart){ + String id = event.getCommand().getId(); + TxEditorPart txEditor=(TxEditorPart) editor; + if (ZOOMIN_ID.compareTo(id) == 0) + txEditor.setZoomLevel(txEditor.getZoomLevel()-1); + else if(ZOOMOUT_ID.compareTo(id) == 0) + txEditor.setZoomLevel(txEditor.getZoomLevel()+1); + } + return null; + } + +} diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/CursorPainter.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/CursorPainter.java new file mode 100644 index 0000000..77a020a --- /dev/null +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/CursorPainter.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; + +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Rectangle; + +class CursorPainter implements IPainter { + + /** + * + */ + private final WaveformCanvas waveCanvas; + private long time; + + /** + * @param i + * @param txDisplay + */ + CursorPainter(WaveformCanvas txDisplay, long time) { + this.waveCanvas = txDisplay; + this.time=time; + } + + public long getTime() { + return time; + } + + public void setTime(long time) { + this.time = time; + } + + public void paintArea(GC gc, Rectangle area) { + if(this.waveCanvas.streams.size()>0){ + int x = (int) (time/waveCanvas.getScaleFactor()); + if(x>=area.x && x<=(area.x+area.width)){ + gc.setForeground(waveCanvas.colors[WaveformCanvas.Colors.CURSOR.ordinal()]); + gc.drawLine(x, area.y, x, area.y+area.height); + } + } + } +} \ No newline at end of file diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IPainter.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IPainter.java index 15696c3..e57cedc 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IPainter.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IPainter.java @@ -1,7 +1,16 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Rectangle; public interface IPainter { diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IWaveformPainter.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IWaveformPainter.java index 005f0b4..6d93718 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IWaveformPainter.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/IWaveformPainter.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/ObservableList.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/ObservableList.java index ebeba34..a9ee2d7 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/ObservableList.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/ObservableList.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; import java.beans.PropertyChangeEvent; @@ -208,6 +218,7 @@ public class ObservableList implements List { List values = new ArrayList(); if (c != null) { for (Iterator i = c.iterator(); i.hasNext();) { + @SuppressWarnings("unchecked") E element = (E) i.next(); if (this.delegate.contains(element)) { values.add(element); diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/Ruler.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/Ruler.java index 9464f26..5f17f27 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/Ruler.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/Ruler.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; import org.eclipse.swt.SWT; @@ -19,21 +29,26 @@ public class Ruler extends Composite { static final int tickY = 15; static final int majorTickY = 5; - static final int rulerTickMinor = 10; - static final int rulerTickMajor = 100; + static final int rulerTickMinorC = 10; + static final int rulerTickMajorC = 100; private int length; - private int start; + private long start; private TxEditorPlugin plugin; private Color headerBgColor; private Color headerFgColor; private int bottom; private int baselineY; - - Ruler(Composite parent, int style, int lenght) { + private long scaleFactor=1000000; + private long rulerScaleFactor=1000000; + private long rulerTickMinor = rulerTickMinorC*scaleFactor; + private long rulerTickMajor = rulerTickMajorC*scaleFactor; + private String unit=""; + + Ruler(Composite parent, int style) { super(parent, style | SWT.DOUBLE_BUFFERED); - this.length=lenght; + this.length=0; headerBgColor=getDisplay().getSystemColor(SWT.COLOR_WHITE); headerFgColor=getDisplay().getSystemColor(SWT.COLOR_BLACK); plugin=TxEditorPlugin.getDefault(); @@ -71,10 +86,10 @@ public class Ruler extends Composite { void paintControl(PaintEvent e) { GC gc = e.gc; - int startMinorIncr = start; - int modulo = start % rulerTickMinor; + long startMinorIncr = start; + long modulo = start % rulerTickMinor; startMinorIncr+=rulerTickMinor-modulo; - int end=start+e.width; + long end=start+e.width*scaleFactor; gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); gc.fillRectangle(new Rectangle(e.x, e.y, e.width, height)); @@ -83,10 +98,10 @@ public class Ruler extends Composite { gc.setForeground(headerFgColor); gc.drawLine(0, bottom, e.width, bottom); - for (int tick = startMinorIncr; tick < end; tick += rulerTickMinor) { - int x0 = tick-start; + for (long tick = startMinorIncr; tick < end; tick += rulerTickMinor) { + int x0 = (int) ((tick-start)/scaleFactor); if ((tick % rulerTickMajor) == 0) { - gc.drawText(Integer.toString(tick), x0, 0); + gc.drawText(Double.toString(tick/rulerScaleFactor)+unit, (int) x0, 0); gc.drawLine(x0, majorTickY, x0, bottom); } else { gc.drawLine(x0, tickY, x0, bottom); @@ -99,8 +114,34 @@ public class Ruler extends Composite { return new Point(0, height); } - public void setStartPoint(int start) { - this.start=start; + public void setStartPoint(long l) { + this.start=l; + redraw(); + } + + public void setScaleFactor(long scaleFactor) { + this.scaleFactor=scaleFactor; + if(scaleFactor<1000L){ + unit="fs"; + rulerScaleFactor=(long) 1e0; + }else if(scaleFactor<1000000L){ + unit="ps"; + rulerScaleFactor=(long) 1e3; + }else if(scaleFactor<1000000000L){ + unit="ns"; + rulerScaleFactor=(long) 1e6; + }else if(scaleFactor<1000000000000L){ + unit="us"; + rulerScaleFactor=(long) 1e9; + }else if(scaleFactor<1000000000000000L){ + unit="ms"; + rulerScaleFactor=(long) 1e9; + }else{ + unit="s"; + rulerScaleFactor=(long) 1e12; + } + this.rulerTickMinor = rulerTickMinorC*scaleFactor; + this.rulerTickMajor = rulerTickMajorC*scaleFactor; redraw(); } } diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/SignalPainter.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/SignalPainter.java index 69f27b9..b838117 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/SignalPainter.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/SignalPainter.java @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; import java.util.Map.Entry; @@ -32,7 +42,10 @@ class SignalPainter implements IWaveformPainter { } public void paintArea(GC gc, Rectangle area) { - gc.setBackground(this.waveCanvas.colors[even?WaveformCanvas.Colors.TRACK_BG_EVEN.ordinal():WaveformCanvas.Colors.TRACK_BG_ODD.ordinal()]); + if(waveCanvas.currentWaveformSelection!=null && waveCanvas.currentWaveformSelection.getId()==signal.getId()) + gc.setBackground(this.waveCanvas.colors[WaveformCanvas.Colors.TRACK_BG_HIGHLITE.ordinal()]); + else + gc.setBackground(this.waveCanvas.colors[even?WaveformCanvas.Colors.TRACK_BG_EVEN.ordinal():WaveformCanvas.Colors.TRACK_BG_ODD.ordinal()]); gc.setFillRule(SWT.FILL_EVEN_ODD); gc.fillRectangle(area); Entry firstChange=signal.getEvents().floorEntry(area.x*this.waveCanvas.getScaleFactor()); @@ -128,4 +141,8 @@ class SignalPainter implements IWaveformPainter { return height; } + public ISignal getSignal() { + return signal; + } + } \ No newline at end of file diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/StreamPainter.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/StreamPainter.java index 7811f65..e78ea64 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/StreamPainter.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/StreamPainter.java @@ -1,11 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; import java.util.Collection; -import java.util.Map; +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; @@ -22,6 +35,7 @@ class StreamPainter implements IWaveformPainter{ private int height, upper, txHeight; private int totalHeight; private boolean even; + private TreeSet seenTx; public StreamPainter(WaveformCanvas txDisplay, boolean even, int height, ITxStream stream) { this.waveCanvas = txDisplay; @@ -31,10 +45,15 @@ class StreamPainter implements IWaveformPainter{ this.txHeight=3*this.waveCanvas.getTrackHeight()/5; this.totalHeight=stream.getMaxConcurrency()*this.waveCanvas.getTrackHeight(); this.even=even; + this.seenTx=new TreeSet(); } + @SuppressWarnings("unchecked") public void paintArea(GC gc, Rectangle area) { - gc.setBackground(this.waveCanvas.colors[even?WaveformCanvas.Colors.TRACK_BG_EVEN.ordinal():WaveformCanvas.Colors.TRACK_BG_ODD.ordinal()]); + if(waveCanvas.currentWaveformSelection!=null && waveCanvas.currentWaveformSelection.getId()==stream.getId()) + gc.setBackground(this.waveCanvas.colors[WaveformCanvas.Colors.TRACK_BG_HIGHLITE.ordinal()]); + else + gc.setBackground(this.waveCanvas.colors[even?WaveformCanvas.Colors.TRACK_BG_EVEN.ordinal():WaveformCanvas.Colors.TRACK_BG_ODD.ordinal()]); gc.setFillRule(SWT.FILL_EVEN_ODD); gc.fillRectangle(area); Entry firstTx=stream.getEvents().floorEntry(area.x*waveCanvas.getScaleFactor()); @@ -45,24 +64,42 @@ class StreamPainter implements IWaveformPainter{ } else if(lastTx==null){ lastTx=stream.getEvents().lastEntry(); } - gc.setForeground(this.waveCanvas.colors[WaveformCanvas.Colors.LINE.ordinal()]); - gc.setBackground(this.waveCanvas.colors[WaveformCanvas.Colors.TX_BG.ordinal()]); gc.setFillRule(SWT.FILL_EVEN_ODD); gc.setLineStyle(SWT.LINE_SOLID); gc.setLineWidth(1); + gc.setForeground(this.waveCanvas.colors[WaveformCanvas.Colors.LINE.ordinal()]); for(int y1=area.y+this.waveCanvas.getTrackHeight()/2; y1)firstTx.getValue()) drawTx(gc, area, x.getTransaction()); else{ - for(Entry tx: stream.getEvents().subMap(firstTx.getKey(), true, lastTx.getKey(), true).entrySet()) - for(ITxEvent x:(Collection)tx.getValue()) - if(x.getType()==ITxEvent.Type.END) drawTx(gc, area, x.getTransaction()); + seenTx.clear(); + NavigableMap entries = stream.getEvents().subMap(firstTx.getKey(), true, lastTx.getKey(), true); + for(Entry tx: entries.entrySet()) + for(ITxEvent x:(Collection)tx.getValue()){ + if(x.getType()==ITxEvent.Type.BEGIN) + seenTx.add(x.getTransaction()); + if(x.getType()==ITxEvent.Type.END){ + drawTx(gc, area, x.getTransaction()); + seenTx.remove(x.getTransaction()); + } + + } + for(ITx tx:seenTx){ + drawTx(gc, area, tx); + } } } protected void drawTx(GC gc, Rectangle area, ITx tx) { + if(waveCanvas.currentSelection!=null && waveCanvas.currentSelection.getId()==tx.getId()){ + gc.setForeground(this.waveCanvas.colors[WaveformCanvas.Colors.LINE_HIGHLITE.ordinal()]); + gc.setBackground(this.waveCanvas.colors[WaveformCanvas.Colors.TX_BG_HIGHLITE.ordinal()]); + }else { + gc.setForeground(this.waveCanvas.colors[WaveformCanvas.Colors.LINE.ordinal()]); + gc.setBackground(this.waveCanvas.colors[WaveformCanvas.Colors.TX_BG.ordinal()]); + } int offset = tx.getConcurrencyIndex()*this.waveCanvas.getTrackHeight(); Rectangle bb = new Rectangle( (int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()), area.y+offset+upper, @@ -82,4 +119,26 @@ class StreamPainter implements IWaveformPainter{ return height; } + public Object getClicked(Point point) { + int lane=point.y/waveCanvas.getTrackHeight(); + Entry> firstTx=stream.getEvents().floorEntry(point.x*waveCanvas.getScaleFactor()); + if(firstTx!=null){ + do { + ITx tx = getTxFromEntry(lane, firstTx); + if(tx!=null) return tx; + firstTx=stream.getEvents().lowerEntry(firstTx.getKey()); + }while(firstTx!=null); + } + return stream; + } + + protected ITx getTxFromEntry(int lane, Entry> firstTx) { + for(ITxEvent evt:firstTx.getValue()){ + if(evt.getType()==ITxEvent.Type.BEGIN && evt.getTransaction().getConcurrencyIndex()==lane){ + return evt.getTransaction(); + } + } + return null; + } + } \ No newline at end of file diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TrackPainter.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TrackPainter.java index 569d92d..5720eb1 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TrackPainter.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TrackPainter.java @@ -1,8 +1,17 @@ +/******************************************************************************* + * Copyright (c) 2014, 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.ui.swt; import java.util.Map.Entry; -import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Rectangle; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TxDisplay.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TxDisplay.java index 375adf2..900e257 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TxDisplay.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/TxDisplay.java @@ -1,21 +1,20 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.swt; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.util.Collection; import java.util.HashMap; import java.util.List; -import java.util.NavigableMap; +import java.util.Vector; import java.util.Map.Entry; import java.util.TreeMap; @@ -33,24 +32,21 @@ import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.ControlAdapter; import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.graphics.TextLayout; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -68,45 +64,44 @@ import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.ITxEvent; import com.minres.scviewer.database.ITxStream; import com.minres.scviewer.database.IWaveform; +import com.minres.scviewer.database.IWaveformEvent; import com.minres.scviewer.ui.handler.GotoDirection; public class TxDisplay implements PropertyChangeListener, ISelectionProvider, MouseListener{ private ListenerList listeners = new ListenerList(); - private IWaveform currentStreamSelection; + + private static final String SELECTION="selection"; private ITx currentSelection; - private IWaveform currentWaveformSelection; + private IWaveform currentWaveformSelection; private ScrolledComposite nameListScrolled; private ScrolledComposite valueListScrolled; private Canvas nameList; private Canvas valueList; - private WaveformCanvas trackList; + WaveformCanvas trackList; private Composite top; - ObservableList streams; + + protected ObservableList> streams; + Vector cursorPainters; + private Composite trackPane; private Ruler ruler; - TreeMap trackVerticalOffset; - + TreeMap> trackVerticalOffset; + HashMap, String> actualValues; // private long maxTime=0; - private Font nameFont; - private Font valueFont; + private Font nameFont, nameFontB; public TxDisplay(Composite parent) { - trackVerticalOffset = new TreeMap(); - Display d =parent.getDisplay(); - parent.addDisposeListener(new DisposeListener() { - @Override - public void widgetDisposed(DisposeEvent e) { - dispose(); - } - }); - FontDescriptor fontDescriptor = FontDescriptor.createFrom(d.getSystemFont()).setStyle(SWT.BOLD); - nameFont = fontDescriptor.createFont(d); - valueFont = fontDescriptor.createFont(d); + trackVerticalOffset = new TreeMap>(); + actualValues= new HashMap, String>(); + cursorPainters=new Vector(); + + nameFont = parent.getDisplay().getSystemFont(); + nameFontB = SWTResourceManager.getBoldFont(nameFont); - streams=new ObservableList(); + streams=new ObservableList>(); streams.addPropertyChangeListener(this); top = new Composite(parent, SWT.NONE); @@ -184,13 +179,17 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo trackPane = new Composite(topSash, SWT.NONE); trackPane.setLayout(new BorderLayout(0, 0)); - ruler = new Ruler(trackPane, SWT.NONE, 0); + ruler = new Ruler(trackPane, SWT.NONE); ruler.setLayoutData(BorderLayout.NORTH); trackList = new WaveformCanvas(trackPane, SWT.NONE); trackList.setLayoutData(BorderLayout.CENTER); - trackList.streams=streams; - trackList.addTrackPainter(new TrackPainter(trackList)); + trackList.setStreams(streams); + trackList.setRuler(ruler); + trackList.addPainter(new TrackPainter(trackList)); + CursorPainter cp = new CursorPainter(trackList, trackList.getScaleFactor()*10); + trackList.addPainter(cp); + cursorPainters.add(cp); trackList.setMaxTime(1); trackList.addMouseListener(this); @@ -208,11 +207,6 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo trackList.scrollToY(y); } }); - trackList.getHorizontalBar().addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - ruler.setStartPoint(trackList.getHorizontalBar().getSelection()); - } - }); trackList.getVerticalBar().addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { int y = trackList.getVerticalBar().getSelection(); @@ -225,10 +219,6 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo } - protected void dispose() { - nameFont.dispose(); - valueFont.dispose(); - } private Composite createTextPane(SashForm leftSash, String text) { Composite namePane = new Composite(leftSash, SWT.NONE); @@ -261,40 +251,54 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo } } + @SuppressWarnings("unchecked") protected void updateTracklist() { int yoffs=0; int nameMaxWidth=0; - int valueMaxWidth=0; IWaveformPainter painter=null; trackVerticalOffset.clear(); + actualValues.clear(); trackList.clearAllWavefromPainter(); boolean even=true; TextLayout tl = new TextLayout(trackList.getDisplay()); - for(IWaveform waveform:streams){ + tl.setFont(nameFontB); + for(IWaveform waveform:streams){ int height=trackList.getTrackHeight(); - if(waveform instanceof ITxStream){ - height*=((ITxStream)waveform).getMaxConcurrency(); - painter= new StreamPainter(trackList, even, height, (ITxStream) waveform); + if(waveform instanceof ITxStream){ + height*=((ITxStream)waveform).getMaxConcurrency(); + painter= new StreamPainter(trackList, even, height, (ITxStream) waveform); + actualValues.put(waveform, ""); } else if(waveform instanceof ISignal){ painter= new SignalPainter(trackList, even, height, (ISignal) waveform); + actualValues.put(waveform, "---"); } trackList.addWavefromPainter(yoffs, painter); trackVerticalOffset.put(yoffs, waveform); tl.setText(waveform.getFullName()); nameMaxWidth=Math.max(nameMaxWidth, tl.getBounds().width); - valueMaxWidth=nameMaxWidth; yoffs+=height; even=!even; } - valueList.setSize(nameMaxWidth, yoffs); - nameList.setSize(valueMaxWidth, yoffs); - valueList.redraw(); + nameList.setSize(nameMaxWidth+15, yoffs); + valueList.setSize(calculateValueWidth(), yoffs); nameList.redraw(); + valueList.redraw(); trackList.redraw(); top.layout(new Control[]{valueList, nameList, trackList}); } + private int calculateValueWidth() { + TextLayout tl = new TextLayout(trackList.getDisplay()); + tl.setFont(nameFontB); + int valueMaxWidth=0; + for(String v:actualValues.values()){ + tl.setText(v); + valueMaxWidth=Math.max(valueMaxWidth, tl.getBounds().width); + } + return valueMaxWidth+15; + } + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { listeners.add(listener); @@ -309,12 +313,13 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo public ISelection getSelection() { if(currentSelection!=null) return new StructuredSelection(currentSelection); - else if(currentStreamSelection!=null) - return new StructuredSelection(currentStreamSelection); + else if(currentWaveformSelection!=null) + return new StructuredSelection(currentWaveformSelection); else return null; } + @SuppressWarnings("unchecked") @Override public void setSelection(ISelection selection) { boolean selectionChanged=false; @@ -324,9 +329,9 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo currentSelection=(ITx) sel; currentWaveformSelection = currentSelection.getStream(); selectionChanged=true; - } else if(sel instanceof IWaveform && currentStreamSelection!=sel){ + } else if(sel instanceof IWaveform && currentWaveformSelection!=sel){ currentSelection=null; - currentWaveformSelection = (IWaveform) sel; + currentWaveformSelection = (IWaveform) sel; selectionChanged=true; } } else { @@ -335,6 +340,10 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo currentWaveformSelection = null; } if(selectionChanged){ + trackList.setSelected(currentSelection, currentWaveformSelection); + nameList.setData(SELECTION, currentWaveformSelection); + valueList.redraw(); + nameList.redraw(); Object[] list = listeners.getListeners(); for (int i = 0; i < list.length; i++) { ((ISelectionChangedListener) list[i]).selectionChanged(new SelectionChangedEvent(this, selection)); @@ -342,21 +351,40 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo } } + @SuppressWarnings("unchecked") public void moveSelection(GotoDirection direction) { - if(currentStreamSelection instanceof ITxStream){ - ITxStream stream = (ITxStream) currentStreamSelection; + if(currentWaveformSelection instanceof ITxStream){ + ITxStream stream = (ITxStream) currentWaveformSelection; ITx transaction=null; if(direction==GotoDirection.NEXT){ - Entry> entry = stream.getEvents().higherEntry(currentSelection.getBeginTime()); + Entry> entry = stream.getEvents().higherEntry(currentSelection.getBeginTime()); if(entry!=null) - transaction = entry.getValue().iterator().next().getTransaction(); + do { + for(ITxEvent evt:entry.getValue()){ + if(evt.getType()==ITxEvent.Type.BEGIN){ + transaction=evt.getTransaction(); + break; + } + } + if(transaction==null) + entry=stream.getEvents().higherEntry(entry.getKey()); + }while(entry!=null && transaction==null); }else if(direction==GotoDirection.PREV){ - Entry> entry = stream.getEvents().lowerEntry(currentSelection.getBeginTime()); + Entry> entry = stream.getEvents().lowerEntry(currentSelection.getBeginTime()); if(entry!=null) - transaction = entry.getValue().iterator().next().getTransaction(); + do { + for(ITxEvent evt:entry.getValue()){ + if(evt.getType()==ITxEvent.Type.BEGIN) + transaction=evt.getTransaction(); + break; + } + if(transaction==null) + entry=stream.getEvents().lowerEntry(entry.getKey()); + }while(entry!=null && transaction==null); + } + if(transaction!=null){ + setSelection(new StructuredSelection(transaction)); } - if(transaction!=null) - setSelection(new StructuredSelection(transaction)); } } @@ -367,11 +395,13 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo @Override public void mouseDown(MouseEvent e) { if(e.widget==trackList){ - - }else if(e.widget==valueList){ - - }else if(e.widget==nameList){ - + Object o = trackList.getClicked(new Point(e.x, e.y)); + if(o !=null) + setSelection(new StructuredSelection(o)); + }else if(e.widget==valueList || e.widget==nameList){ + Entry> entry = trackVerticalOffset.floorEntry(e.y); + if(entry!=null) + setSelection(new StructuredSelection(entry.getValue())); } } @@ -379,45 +409,66 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo public void mouseUp(MouseEvent e) { } - public List getStreamList(){ + public List> getStreamList(){ return streams; } protected void paintNames(GC gc, Rectangle rect) { if(streams.size()>0){ + IWaveform wave = (IWaveform) nameList.getData(SELECTION); Integer firstKey=trackVerticalOffset.floorKey(rect.y); if(firstKey==null) firstKey=trackVerticalOffset.firstKey(); Integer lastKey = trackVerticalOffset.floorKey(rect.y+rect.height); - Rectangle subArea = new Rectangle(rect.x, 0, rect.width, 0); + Rectangle subArea = new Rectangle(rect.x, 0, rect.width, trackList.getTrackHeight()); if(lastKey==firstKey){ - drawTextFormat(gc, subArea, firstKey, trackVerticalOffset.get(firstKey).getFullName()); + IWaveform w = trackVerticalOffset.get(firstKey); + if(w instanceof ITxStream) + subArea.height*=((ITxStream)w).getMaxConcurrency(); + drawTextFormat(gc, subArea, firstKey, w.getFullName(), wave!=null && w.getId()==wave.getId()); }else{ - for(Entry entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true).entrySet()){ - drawTextFormat(gc, subArea, entry.getKey(), entry.getValue().getFullName()); + for(Entry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true).entrySet()){ + IWaveform w = entry.getValue(); + subArea.height=trackList.getTrackHeight(); + if(w instanceof ITxStream) + subArea.height*=((ITxStream)w).getMaxConcurrency(); + drawTextFormat(gc, subArea, entry.getKey(), w.getFullName(), wave!=null && w.getId()==wave.getId()); } } } } + @SuppressWarnings("unchecked") protected void paintValues(GC gc, Rectangle rect) { if(streams.size()>0){ + IWaveform wave = (IWaveform) nameList.getData(SELECTION); Integer firstKey=trackVerticalOffset.floorKey(rect.y); if(firstKey==null) firstKey=trackVerticalOffset.firstKey(); Integer lastKey = trackVerticalOffset.floorKey(rect.y+rect.height); - Rectangle subArea = new Rectangle(rect.x, 0, rect.width, 0); + Rectangle subArea = new Rectangle(rect.x, 0, rect.width, trackList.getTrackHeight()); if(lastKey==firstKey){ - drawTextFormat(gc, subArea, firstKey, trackVerticalOffset.get(firstKey).getFullName()); + IWaveform w = trackVerticalOffset.get(firstKey); + if(w instanceof ITxStream) + subArea.height*=((ITxStream)w).getMaxConcurrency(); + drawTextFormat(gc, subArea, firstKey, actualValues.get(w), wave!=null && w.getId()==wave.getId()); }else{ - for(Entry entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true).entrySet()){ - drawTextFormat(gc, subArea, entry.getKey(), "---"); + for(Entry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true).entrySet()){ + IWaveform w = entry.getValue(); + subArea.height=trackList.getTrackHeight(); + if(w instanceof ITxStream) + subArea.height*=((ITxStream)w).getMaxConcurrency(); + drawTextFormat(gc, subArea, entry.getKey(), actualValues.get(w), wave!=null && w.getId()==wave.getId()); } } } } - protected void drawTextFormat(GC gc, Rectangle subArea, int yOffset, String p) { - Point size = gc.textExtent(p); - gc.drawText(p, subArea.x, subArea.y + yOffset+(trackList.getTrackHeight()-size.y)/2, true); + protected void drawTextFormat(GC gc, Rectangle subArea, int yOffset, String value, boolean highlite) { + Point size = gc.textExtent(value); + if(highlite) + gc.setFont(nameFontB); + else + gc.setFont(nameFont); + gc.drawText(value, subArea.x+5, subArea.y + yOffset+(trackList.getTrackHeight()-size.y)/2, true); } public long getMaxTime() { @@ -428,4 +479,14 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo this.trackList.setMaxTime(maxTime); } + public void setZoomLevel(int scale) { + trackList.setZoomLevel(scale); + } + + public int getZoomLevel() { + return trackList.getZoomLevel(); + } +// public long getScaleFactor(){ +// return trackList.getScaleFactor(); +// } } diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/WaveformCanvas.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/WaveformCanvas.java index 105cdcb..50d2332 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/WaveformCanvas.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/swt/WaveformCanvas.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 MINRES Technologies GmbH. + * Copyright (c) 2014, 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 @@ -10,11 +10,10 @@ *******************************************************************************/ package com.minres.scviewer.ui.swt; -import java.awt.geom.AffineTransform; -import java.awt.geom.Point2D; import java.util.HashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map.Entry; import java.util.TreeMap; import org.eclipse.swt.SWT; @@ -26,11 +25,9 @@ import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.graphics.Region; import org.eclipse.swt.graphics.Transform; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; @@ -38,7 +35,10 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.wb.swt.SWTResourceManager; +import com.google.common.collect.Lists; +import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.IWaveform; +import com.minres.scviewer.database.IWaveformEvent; public class WaveformCanvas extends Canvas { public enum Colors { @@ -54,25 +54,27 @@ public class WaveformCanvas extends Canvas { SIGNAL1, SIGNALZ, SIGNALX, - SIGNAL_TEXT + SIGNAL_TEXT, + CURSOR } Color[] colors=new Color[Colors.values().length]; - - /* zooming rates in x and y direction are equal.*/ - final float ZOOMIN_RATE = 1.1f; /* zoomin rate */ - final float ZOOMOUT_RATE = 0.9f; /* zoomout rate */ private int trackHeight = 50; private long scaleFactor = 1000000L; + private int level=6; private long maxTime; - protected Point origin; /* original size */ protected Transform transform; - + protected Ruler ruler; protected List painterList; TreeMap trackVerticalOffset; - List streams; + + protected List> streams; + + ITx currentSelection; + IWaveform currentWaveformSelection; + /** * Constructor for ScrollableCanvas. @@ -112,8 +114,8 @@ public class WaveformCanvas extends Canvas { colors[Colors.LINE.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_RED); colors[Colors.LINE_HIGHLITE.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_CYAN); colors[Colors.TRACK_BG_EVEN.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_BLACK); - colors[Colors.TRACK_BG_ODD.ordinal()]=SWTResourceManager.getColor(25,25,25); - colors[Colors.TRACK_BG_HIGHLITE.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_GRAY); + colors[Colors.TRACK_BG_ODD.ordinal()]=SWTResourceManager.getColor(40,40,40); + colors[Colors.TRACK_BG_HIGHLITE.ordinal()]=SWTResourceManager.getColor(40,40,80); colors[Colors.TX_BG.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_GREEN); colors[Colors.TX_BG_HIGHLITE.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN); colors[Colors.TX_BORDER.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_RED); @@ -122,9 +124,30 @@ public class WaveformCanvas extends Canvas { colors[Colors.SIGNALZ.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_GRAY); colors[Colors.SIGNALX.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_RED); colors[Colors.SIGNAL_TEXT.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_WHITE); + colors[Colors.CURSOR.ordinal()]=SWTResourceManager.getColor(SWT.COLOR_DARK_RED); } } + public List> getStreams() { + return streams; + } + + public void setStreams(List> streams) { + this.streams = streams; + } + + public Ruler getRuler(){ + return ruler; + } + + public void setRuler(Ruler ruler) { + this.ruler=ruler; + } + + public Object getOrigin() { + return origin; + } + public long getMaxTime() { return maxTime; } @@ -143,20 +166,27 @@ public class WaveformCanvas extends Canvas { syncScrollBars(); } + public void setZoomLevel(int level) { + this.level=level; + this.scaleFactor = (long) Math.pow(10, level); + if(ruler!=null) ruler.setStartPoint(-origin.x*scaleFactor); + syncScrollBars(); + } + + public int getZoomLevel() { + return level; + } + public long getScaleFactor() { return scaleFactor; } - public void setScaleFactor(long scaleFactor) { - this.scaleFactor = scaleFactor; - } - - public void addTrackPainter(IPainter painter) { + public void addPainter(IPainter painter) { painterList.add(painter); redraw(); } - public void removeTrackPainter(IPainter painter){ + public void removePainter(IPainter painter){ painterList.remove(painter); redraw(); } @@ -196,6 +226,7 @@ public class WaveformCanvas extends Canvas { private void scrollHorizontally(ScrollBar scrollBar) { if (painterList.size()==0) return; origin.x= -scrollBar.getSelection(); + if(ruler!=null) ruler.setStartPoint(-origin.x*scaleFactor); syncScrollBars(); } @@ -271,6 +302,7 @@ public class WaveformCanvas extends Canvas { } vertical.setSelection(-origin.y); vertical.setThumb(ch); + ruler.setScaleFactor(scaleFactor); redraw(); } @@ -293,5 +325,44 @@ public class WaveformCanvas extends Canvas { initScrollBars(); } } - + + public Object getClicked(Point point) { + for(IPainter p:Lists.reverse(painterList)){ + if(p instanceof TrackPainter){ + int y= point.y-origin.y; + int x=point.x-origin.x; + Entry entry = trackVerticalOffset.floorEntry(y); + if(entry!=null){ + if(entry.getValue() instanceof StreamPainter){ + return ((StreamPainter)entry.getValue()).getClicked(new Point(x,y-entry.getKey())); + }else if(entry.getValue() instanceof SignalPainter) + return ((SignalPainter)entry.getValue()).getSignal(); + } + }else if(p instanceof CursorPainter){ + if(Math.abs(point.x*scaleFactor-((CursorPainter)p).getTime())<2){ + return p; + } + } + } + return null; + } + + public void setSelected(ITx currentSelection, IWaveform currentWaveformSelection) { + this.currentSelection=currentSelection; + this.currentWaveformSelection=currentWaveformSelection; + if(currentSelection!=null) reveal(currentSelection.getBeginTime(), currentSelection.getEndTime()); + redraw(); + } + + public void reveal(Long beginTime, Long endTime) { + int lower = (int) (beginTime/scaleFactor); + int higher=(int) (endTime/scaleFactor); + Point size = getSize(); + if(lower<-origin.x){ + scrollToX(lower); + } else if(higher>(size.x-origin.x)){ + scrollToX(higher-size.x); + } + } + } diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/SelectionTableView.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/SelectionTableView.java index 7c94cb7..7ce350f 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/SelectionTableView.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/SelectionTableView.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.views; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TransactionPropertySheet.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TransactionPropertySheet.java index 70c7dfc..e2caaa1 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TransactionPropertySheet.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TransactionPropertySheet.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.views; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TxOutlinePage.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TxOutlinePage.java index 68d41df..6f82a7e 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TxOutlinePage.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/TxOutlinePage.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.views; @@ -27,20 +27,16 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.IActionBars; import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.ActionFactory; import org.eclipse.ui.part.IPageSite; -import org.eclipse.ui.views.contentoutline.ContentOutline; import org.eclipse.ui.views.contentoutline.ContentOutlinePage; import com.minres.scviewer.database.IHierNode; -import com.minres.scviewer.database.ITxStream; -import com.minres.scviewer.database.ITx; import com.minres.scviewer.database.IWaveform; +import com.minres.scviewer.database.IWaveformEvent; import com.minres.scviewer.ui.TxEditorPart; import com.minres.scviewer.ui.views.provider.TxDbTreeContentProvider; import com.minres.scviewer.ui.views.provider.TxDbTreeLabelProvider; @@ -119,7 +115,7 @@ public class TxOutlinePage extends ContentOutlinePage implements ISelectionList */ public void init(IPageSite pageSite) { super.init(pageSite); - IActionBars bars = pageSite.getActionBars(); +// IActionBars bars = pageSite.getActionBars(); } private void fillContextMenu(IMenuManager menuMgr) { @@ -181,21 +177,22 @@ public class TxOutlinePage extends ContentOutlinePage implements ISelectionList private Action makeStreamAction(String text, String imgDescriptor, final IStructuredSelection selection, boolean enabled, final boolean remove) { Action action = new Action() { + @SuppressWarnings("unchecked") public void run() { if(selection!=null) for(Object obj :selection.toArray()){ if(obj instanceof IWaveform){ if(remove) - editor.removeStreamFromList((IWaveform) obj); + editor.removeStreamFromList((IWaveform) obj); else - editor.addStreamToList((IWaveform) obj); + editor.addStreamToList((IWaveform) obj); } else if(obj instanceof IHierNode){ LinkedList queue = new LinkedList(); - LinkedList streams = new LinkedList(); + LinkedList> streams = new LinkedList>(); queue.add((IHierNode)obj); while(queue.size()>0){ IHierNode n = queue.poll(); - if(n instanceof IWaveform) streams.add((IWaveform) n); + if(n instanceof IWaveform) streams.add((IWaveform) n); queue.addAll(n.getChildNodes()); } if(remove) diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeContentProvider.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeContentProvider.java index fc56f10..da695d7 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeContentProvider.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeContentProvider.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.views.provider; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java index 83b315a..aaee2d5 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.views.provider; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java index deee30f..a355263 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/AttributeProperty.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.views.sections; diff --git a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java index f12acfd..bee399e 100644 --- a/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java +++ b/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/sections/RelatedProperty.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2012 IT Just working. + * Copyright (c) 2014, 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: - * IT Just working - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package com.minres.scviewer.ui.views.sections; diff --git a/com.minres.scviewer.ui/src/org/eclipse/wb/swt/SWTResourceManager.java b/com.minres.scviewer.ui/src/org/eclipse/wb/swt/SWTResourceManager.java index 429964e..53472ad 100644 --- a/com.minres.scviewer.ui/src/org/eclipse/wb/swt/SWTResourceManager.java +++ b/com.minres.scviewer.ui/src/org/eclipse/wb/swt/SWTResourceManager.java @@ -1,12 +1,12 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2014, 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: - * Google, Inc. - initial API and implementation + * MINRES Technologies GmbH - initial API and implementation *******************************************************************************/ package org.eclipse.wb.swt; diff --git a/scv_tr_sqlite/src/scv_tr_sqlite.cpp b/scv_tr_sqlite/src/scv_tr_sqlite.cpp index 261efff..6fea0f1 100644 --- a/scv_tr_sqlite/src/scv_tr_sqlite.cpp +++ b/scv_tr_sqlite/src/scv_tr_sqlite.cpp @@ -1,3 +1,13 @@ +/******************************************************************************* + * Copyright (c) 2014, 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 + *******************************************************************************/ #include #include #include