[no commit message]
This commit is contained in:
parent
3a10cc0672
commit
aa9cac6e8a
@ -11,7 +11,7 @@ import hep.dataforge.tables.TableFormatBuilder
|
||||
import hep.dataforge.tables.ListTable
|
||||
import hep.dataforge.tables.MapPoint
|
||||
import hep.dataforge.tables.Table
|
||||
import inr.numass.data.NumassData
|
||||
import inr.numass.storage.NumassData
|
||||
import inr.numass.data.*
|
||||
import javafx.stage.FileChooser
|
||||
|
||||
|
@ -5,10 +5,18 @@ if (!hasProperty('mainClass')) {
|
||||
}
|
||||
mainClassName = mainClass
|
||||
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
|
||||
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 {
|
||||
compile project(':numass-main')
|
||||
compile project(':dataforge-fx')
|
||||
|
@ -134,14 +134,14 @@ public class MainViewerController implements Initializable {
|
||||
private void loadDirectory(String path) {
|
||||
getContext().processManager().post("viewer.loadDirectory", (ProcessManager.Callback callback) -> {
|
||||
callback.updateTitle("Load storage (" + path + ")");
|
||||
callback.updateProgress(-1, 1);
|
||||
callback.setProgress(-1);
|
||||
callback.updateMessage("Building numass storage tree...");
|
||||
try {
|
||||
NumassStorage root = NumassStorage.buildNumassRoot(path, true, false);
|
||||
setRootStorage(root);
|
||||
Platform.runLater(() -> storagePathLabel.setText("Storage: " + path));
|
||||
} catch (StorageException ex) {
|
||||
callback.updateProgress(0, 1);
|
||||
callback.setProgress(0);
|
||||
callback.updateMessage("Failed to load storage " + path);
|
||||
Logger.getLogger(MainViewerController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
@ -157,7 +157,7 @@ public class MainViewerController implements Initializable {
|
||||
getContext().processManager().cleanup();
|
||||
getContext().processManager().post("viewer.storage.load", (ProcessManager.Callback callback) -> {
|
||||
callback.updateTitle("Fill data to UI (" + root.getName() + ")");
|
||||
// callback.updateProgress(-1, 1);
|
||||
callback.setProgress(-1);
|
||||
Platform.runLater(() -> statusBar.setProgress(-1));
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// callback.updateProgress(1, 1);
|
||||
// callback.setProgress(1, 1);
|
||||
Platform.runLater(() -> statusBar.setProgress(0));
|
||||
callback.updateMessage("Numass storage tree loaded.");
|
||||
callback.setProgressToMax();
|
||||
});
|
||||
|
||||
mspController = new MspViewController(getContext(), mspPlotPane);
|
||||
|
@ -54,6 +54,7 @@ public class NumassLoaderTreeBuilder {
|
||||
|
||||
// callback.updateTitle("Load numass data (" + rootStorage.getName() + ")");
|
||||
TreeItem<TreeItemValue> root = buildNode(rootStorage, numassViewBuilder, callback);
|
||||
// callback.updateMessage("finished loading numass tree");
|
||||
root.setExpanded(true);
|
||||
|
||||
// numassLoaderDataTree.setShowRoot(true);
|
||||
@ -122,8 +123,8 @@ public class NumassLoaderTreeBuilder {
|
||||
}
|
||||
|
||||
callback.updateMessage("Building storage " + storage.getName());
|
||||
callback.updateProgress(-1, 1);
|
||||
callback.updateProgress(0, storage.loaders().size());
|
||||
callback.setProgress(0);
|
||||
callback.setMaxProgress(storage.loaders().size());
|
||||
for (Loader loader : storage.loaders().values()) {
|
||||
if (loader instanceof NumassData) {
|
||||
callback.updateMessage("Building numass data loader " + loader.getName());
|
||||
@ -140,18 +141,18 @@ public class NumassLoaderTreeBuilder {
|
||||
// });
|
||||
list.add(numassLoaderTreeItem);
|
||||
}
|
||||
callback.changeProgress(1, 0);
|
||||
callback.increaseProgress(1);
|
||||
}
|
||||
|
||||
callback.updateMessage("Loading legacy DAT files");
|
||||
callback.updateProgress(-1, 1);
|
||||
callback.setProgress(0);
|
||||
List<NumassData> legacyFiles = storage.legacyFiles();
|
||||
callback.updateProgress(0, legacyFiles.size());
|
||||
callback.setMaxProgress(legacyFiles.size());
|
||||
//adding legacy data files
|
||||
for (NumassData legacyDat : legacyFiles) {
|
||||
callback.updateMessage("Loading numass DAT file " + legacyDat.getName());
|
||||
TreeItem<TreeItemValue> numassLoaderTreeItem = new TreeItem<>(buildValue(legacyDat));
|
||||
callback.changeProgress(1, 0);
|
||||
callback.increaseProgress(1);
|
||||
list.add(numassLoaderTreeItem);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user