[no commit message]

This commit is contained in:
Alexander Nozik 2016-05-06 22:58:12 +03:00
parent 3a10cc0672
commit aa9cac6e8a
4 changed files with 22 additions and 12 deletions

View File

@ -11,7 +11,7 @@ import hep.dataforge.tables.TableFormatBuilder
import hep.dataforge.tables.ListTable import hep.dataforge.tables.ListTable
import hep.dataforge.tables.MapPoint import hep.dataforge.tables.MapPoint
import hep.dataforge.tables.Table import hep.dataforge.tables.Table
import inr.numass.data.NumassData import inr.numass.storage.NumassData
import inr.numass.data.* import inr.numass.data.*
import javafx.stage.FileChooser import javafx.stage.FileChooser

View File

@ -5,10 +5,18 @@ if (!hasProperty('mainClass')) {
} }
mainClassName = mainClass mainClassName = mainClass
version = "0.3.0" version = "0.3.1"
description = "The viewer for numass data" description = "The viewer for numass data"
configurations {
compile.exclude module: 'groovy-all'
compile.exclude module: 'fontawesomefx'
compile.exclude module: 'commons-math3'
compile.exclude module: 'httpclient'
compile.exclude module: 'httpcore'
}
dependencies { dependencies {
compile project(':numass-main') compile project(':numass-main')
compile project(':dataforge-fx') compile project(':dataforge-fx')

View File

@ -134,14 +134,14 @@ public class MainViewerController implements Initializable {
private void loadDirectory(String path) { private void loadDirectory(String path) {
getContext().processManager().post("viewer.loadDirectory", (ProcessManager.Callback callback) -> { getContext().processManager().post("viewer.loadDirectory", (ProcessManager.Callback callback) -> {
callback.updateTitle("Load storage (" + path + ")"); callback.updateTitle("Load storage (" + path + ")");
callback.updateProgress(-1, 1); callback.setProgress(-1);
callback.updateMessage("Building numass storage tree..."); callback.updateMessage("Building numass storage tree...");
try { try {
NumassStorage root = NumassStorage.buildNumassRoot(path, true, false); NumassStorage root = NumassStorage.buildNumassRoot(path, true, false);
setRootStorage(root); setRootStorage(root);
Platform.runLater(() -> storagePathLabel.setText("Storage: " + path)); Platform.runLater(() -> storagePathLabel.setText("Storage: " + path));
} catch (StorageException ex) { } catch (StorageException ex) {
callback.updateProgress(0, 1); callback.setProgress(0);
callback.updateMessage("Failed to load storage " + path); callback.updateMessage("Failed to load storage " + path);
Logger.getLogger(MainViewerController.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(MainViewerController.class.getName()).log(Level.SEVERE, null, ex);
} }
@ -157,7 +157,7 @@ public class MainViewerController implements Initializable {
getContext().processManager().cleanup(); getContext().processManager().cleanup();
getContext().processManager().post("viewer.storage.load", (ProcessManager.Callback callback) -> { getContext().processManager().post("viewer.storage.load", (ProcessManager.Callback callback) -> {
callback.updateTitle("Fill data to UI (" + root.getName() + ")"); callback.updateTitle("Fill data to UI (" + root.getName() + ")");
// callback.updateProgress(-1, 1); callback.setProgress(-1);
Platform.runLater(() -> statusBar.setProgress(-1)); Platform.runLater(() -> statusBar.setProgress(-1));
callback.updateMessage("Loading numass storage tree..."); callback.updateMessage("Loading numass storage tree...");
@ -178,9 +178,10 @@ public class MainViewerController implements Initializable {
Logger.getLogger(MainViewerController.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(MainViewerController.class.getName()).log(Level.SEVERE, null, ex);
} }
// callback.updateProgress(1, 1); // callback.setProgress(1, 1);
Platform.runLater(() -> statusBar.setProgress(0)); Platform.runLater(() -> statusBar.setProgress(0));
callback.updateMessage("Numass storage tree loaded."); callback.updateMessage("Numass storage tree loaded.");
callback.setProgressToMax();
}); });
mspController = new MspViewController(getContext(), mspPlotPane); mspController = new MspViewController(getContext(), mspPlotPane);

View File

@ -54,6 +54,7 @@ public class NumassLoaderTreeBuilder {
// callback.updateTitle("Load numass data (" + rootStorage.getName() + ")"); // callback.updateTitle("Load numass data (" + rootStorage.getName() + ")");
TreeItem<TreeItemValue> root = buildNode(rootStorage, numassViewBuilder, callback); TreeItem<TreeItemValue> root = buildNode(rootStorage, numassViewBuilder, callback);
// callback.updateMessage("finished loading numass tree");
root.setExpanded(true); root.setExpanded(true);
// numassLoaderDataTree.setShowRoot(true); // numassLoaderDataTree.setShowRoot(true);
@ -122,8 +123,8 @@ public class NumassLoaderTreeBuilder {
} }
callback.updateMessage("Building storage " + storage.getName()); callback.updateMessage("Building storage " + storage.getName());
callback.updateProgress(-1, 1); callback.setProgress(0);
callback.updateProgress(0, storage.loaders().size()); callback.setMaxProgress(storage.loaders().size());
for (Loader loader : storage.loaders().values()) { for (Loader loader : storage.loaders().values()) {
if (loader instanceof NumassData) { if (loader instanceof NumassData) {
callback.updateMessage("Building numass data loader " + loader.getName()); callback.updateMessage("Building numass data loader " + loader.getName());
@ -140,18 +141,18 @@ public class NumassLoaderTreeBuilder {
// }); // });
list.add(numassLoaderTreeItem); list.add(numassLoaderTreeItem);
} }
callback.changeProgress(1, 0); callback.increaseProgress(1);
} }
callback.updateMessage("Loading legacy DAT files"); callback.updateMessage("Loading legacy DAT files");
callback.updateProgress(-1, 1); callback.setProgress(0);
List<NumassData> legacyFiles = storage.legacyFiles(); List<NumassData> legacyFiles = storage.legacyFiles();
callback.updateProgress(0, legacyFiles.size()); callback.setMaxProgress(legacyFiles.size());
//adding legacy data files //adding legacy data files
for (NumassData legacyDat : legacyFiles) { for (NumassData legacyDat : legacyFiles) {
callback.updateMessage("Loading numass DAT file " + legacyDat.getName()); callback.updateMessage("Loading numass DAT file " + legacyDat.getName());
TreeItem<TreeItemValue> numassLoaderTreeItem = new TreeItem<>(buildValue(legacyDat)); TreeItem<TreeItemValue> numassLoaderTreeItem = new TreeItem<>(buildValue(legacyDat));
callback.changeProgress(1, 0); callback.increaseProgress(1);
list.add(numassLoaderTreeItem); list.add(numassLoaderTreeItem);
} }