Some minor cleanup

This commit is contained in:
Eyck Jentzsch 2015-01-03 17:25:09 +01:00
parent 37ee5bd5e6
commit a76c99dfb9
10 changed files with 19 additions and 16 deletions

View File

@ -1,6 +1,6 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: Sqlite transaction database Bundle-Name: SQLite transaction database
Bundle-SymbolicName: com.minres.scviewer.database.sqlite Bundle-SymbolicName: com.minres.scviewer.database.sqlite
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: MINRES Technologies GmbH Bundle-Vendor: MINRES Technologies GmbH

View File

@ -12,7 +12,10 @@ a SQLite based recording as well as the built-in text base recording.
<copyright> <copyright>
Copyright (c) 2015 MINRES Technologies GmbH. Copyright (c) 2015 MINRES Technologies GmbH.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License
v1.0 which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
</copyright> </copyright>
<license url="%licenseURL"> <license url="%licenseURL">

View File

@ -4,6 +4,5 @@
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="swing2swt.jar"/> <classpathentry kind="lib" path="swing2swt.jar"/>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@ -4,7 +4,7 @@ Bundle-Name: Graph
Bundle-SymbolicName: com.minres.scviewer.ui;singleton:=true Bundle-SymbolicName: com.minres.scviewer.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.minres.scviewer.ui.TxEditorPlugin Bundle-Activator: com.minres.scviewer.ui.TxEditorPlugin
Bundle-Vendor: ITJW Bundle-Vendor: MINRES Technologies GmbH
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources, org.eclipse.core.resources,
org.eclipse.jface.text, org.eclipse.jface.text,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

View File

@ -21,7 +21,8 @@
class="com.minres.scviewer.ui.TxEditorPart" class="com.minres.scviewer.ui.TxEditorPart"
contributorClass="com.minres.scviewer.ui.TxEditorActionBarContributor" contributorClass="com.minres.scviewer.ui.TxEditorActionBarContributor"
extensions="txdb" extensions="txdb"
icon="icons/sample.gif" filenames="*.txdb,*.txlog"
icon="icons/scviewer.gif"
id="com.minres.scviewer.ui.TxEditorPart" id="com.minres.scviewer.ui.TxEditorPart"
name="Wave Viewer"> name="Wave Viewer">
</editor> </editor>

View File

@ -136,10 +136,10 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
} }
} }
} }
} catch (InvalidSyntaxException e) { } catch (Exception e) {
} }
MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
"Error loading database", "Could not find database loader implementation"); "Error loading database", "Could not find an usable and applicable database loader implementation");
database=null; database=null;
// if(TxEditorPlugin.getDefault().getTransactionDbFactory()!=null){ // if(TxEditorPlugin.getDefault().getTransactionDbFactory()!=null){
// database = TxEditorPlugin.getDefault().getTransactionDbFactory().createDatabase(); // database = TxEditorPlugin.getDefault().getTransactionDbFactory().createDatabase();

View File

@ -1,3 +1,3 @@
/Debug/ /Debug/
/my_db.log /*.txlog
/my_db.tx /*.txdb

View File

@ -81,16 +81,16 @@ typedef scv_extensions_if::data_type data_type;
static void dbCb(const scv_tr_db& _scv_tr_db, scv_tr_db::callback_reason reason, void* data) { static void dbCb(const scv_tr_db& _scv_tr_db, scv_tr_db::callback_reason reason, void* data) {
// This is called from the scv_tr_db ctor. // This is called from the scv_tr_db ctor.
static string my_sqlite_file_name("DEFAULT_scv_tr_sqlite"); static string fName("DEFAULT_scv_tr_sqlite");
switch (reason) { switch (reason) {
case scv_tr_db::CREATE: case scv_tr_db::CREATE:
if ((_scv_tr_db.get_name() != NULL) && (strlen(_scv_tr_db.get_name()) != 0)) { if ((_scv_tr_db.get_name() != NULL) && (strlen(_scv_tr_db.get_name()) != 0))
my_sqlite_file_name = _scv_tr_db.get_name(); fName = _scv_tr_db.get_name();
}
try { try {
my_sqlite_file_name+=".tx"; if(fName.size()<5 || fName.find(".txdb", fName.size() - 5) == string::npos)
remove(my_sqlite_file_name.c_str()); fName+=".txdb";
db.open(my_sqlite_file_name.c_str()); remove(fName.c_str());
db.open(fName.c_str());
// scv_out << "TB Transaction Recording has started, file = " << my_sqlite_file_name << endl; // scv_out << "TB Transaction Recording has started, file = " << my_sqlite_file_name << endl;
db.exec("CREATE TABLE IF NOT EXISTS " STREAM_TABLE "(id INTEGER NOT NULL PRIMARY KEY, name TEXT, kind TEXT);"); db.exec("CREATE TABLE IF NOT EXISTS " STREAM_TABLE "(id INTEGER NOT NULL PRIMARY KEY, name TEXT, kind TEXT);");
db.exec("CREATE TABLE IF NOT EXISTS " GENERATOR_TABLE "(id INTEGER NOT NULL PRIMARY KEY, stream INTEGER REFERENCES " STREAM_TABLE "(id), name TEXT, begin_attr INTEGER, end_attr INTEGER);"); db.exec("CREATE TABLE IF NOT EXISTS " GENERATOR_TABLE "(id INTEGER NOT NULL PRIMARY KEY, stream INTEGER REFERENCES " STREAM_TABLE "(id), name TEXT, begin_attr INTEGER, end_attr INTEGER);");