Painter base waveform canvas implemented
Fixed Copyright information
This commit is contained in:
+19
-15
@@ -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<String, RelationType> relationMap = new HashMap<String, RelationType>();
|
||||
private RelationTypeFactory rtf = new RelationTypeFactory();
|
||||
|
||||
private IWaveformDb db;
|
||||
|
||||
private ScvSimProps scvSimProps;
|
||||
|
||||
public SQLiteDbLoader() {
|
||||
}
|
||||
|
||||
@@ -43,7 +53,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
|
||||
try {
|
||||
List<ScvTxEvent> 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<IWaveform<? extends IWaveformEvent>>();
|
||||
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<ScvSimProps> handler = new SQLiteDatabaseSelectHandler<ScvSimProps>(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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user