Skip to content
Snippets Groups Projects
Commit 0dedee69 authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

enable rerun

parent 738e9f28
Branches
Tags
No related merge requests found
...@@ -91,9 +91,9 @@ public class BenchmarkSPIMController implements FXFrame.Controller { ...@@ -91,9 +91,9 @@ public class BenchmarkSPIMController implements FXFrame.Controller {
private void initMenu() { private void initMenu() {
TableViewContextMenu<Job> menu = new TableViewContextMenu<>(jobs); TableViewContextMenu<Job> menu = new TableViewContextMenu<>(jobs);
menu.addItem("Create job", x -> executeJobActionAsync("Creating job", p -> manager.createJob()), j -> true); menu.addItem("Create job", x -> executeJobActionAsync("Creating job", false, p -> manager.createJob()), j -> true);
menu.addItem("Start job", job -> executeJobActionAsync("Starting job", p -> job.startJob(p)), menu.addItem("Start job", job -> executeJobActionAsync("Starting job", p -> job.startJob(p)),
job -> notNullValue(job, j -> j.getState() == JobState.Configuring)); job -> notNullValue(job, j -> j.getState() == JobState.Configuring || j.getState() == JobState.Finished));
menu.addItem("Download result", job -> executeJobActionAsync("Downloading data", p -> job.downloadData(p)), menu.addItem("Download result", job -> executeJobActionAsync("Downloading data", p -> job.downloadData(p)),
job -> notNullValue(job, job -> notNullValue(job,
j -> EnumSet.of(JobState.Failed, JobState.Finished).contains(j.getState()) && !j.downloaded())); j -> EnumSet.of(JobState.Failed, JobState.Finished).contains(j.getState()) && !j.downloaded()));
...@@ -120,13 +120,19 @@ public class BenchmarkSPIMController implements FXFrame.Controller { ...@@ -120,13 +120,19 @@ public class BenchmarkSPIMController implements FXFrame.Controller {
} }
private void executeJobActionAsync(String title, P_JobAction action) { private void executeJobActionAsync(String title, P_JobAction action) {
executeJobActionAsync(title, true, action);
}
private void executeJobActionAsync(String title, boolean update, P_JobAction action) {
executorService.execute(() -> { executorService.execute(() -> {
try { try {
ProgressDialog dialog = ModalDialogs.doModal(new ProgressDialog(root, title), ProgressDialog dialog = ModalDialogs.doModal(new ProgressDialog(root, title),
WindowConstants.DO_NOTHING_ON_CLOSE); WindowConstants.DO_NOTHING_ON_CLOSE);
action.doAction(dialog); action.doAction(dialog);
dialog.done(); dialog.done();
if(update) {
updateJobs(); updateJobs();
}
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment