Skip to content

Rework Simulation Runtime Environment window so it has a progress bar #119

@king-shak

Description

@king-shak

Background

As of now in Workbench, when you start a simulation you are presented with a dialog (see below) that contains a record of everything that Workbench has done to run the simulation (just a vertically scrollable area with text) and a button labeled "Analyze" in the lower-right hand corner. To check whether the sim is done, you have to press this button, enter your credentials for the machine, and check whether it retrieved all the output and log files from the sim. If it didn't, you have to wait and try again later. This is obviously not very convenient, as the user doesn't know how long they should be waiting for.

image

Another issue with how this is currently implemented is that if you close and re-open Workbench in the midst of simulation being run, it won't re-open the simulation you were running. This is crucial, becuase while we on the Workbench team are running simulations that may only take a second, the people developing and using Graphitti can be running sims that last hours, days, or even weeks.

This needs to be re-done so that it has a progress bar instead, clearly indicating the simulator's progress. Additionally, if you closed Workbench whilst running a sim, and open it again later, it should open the Simulation Runtime Environment (SRE - that's actually a terrible name, whoever works on this should rename it) up with that uncompleted sim, updating the progress bar.

New Dialog Wireframe

image

This is what I had in mind, but it doesn't need to be strictly followed, it can be modified or just thrown out for something else if necessary.

One of the challenges here will be working out the behavior of the "Analyze"/"Update Now" button. We'd probably want to have Workbench check in periodically automatically to see if the simulation is done, though we don't want to do this too often as right now, we still have to prompt the user whenever we connect to the remote machine. The "Analyze" button could there to skip the waiting period and check immediately.

Changes to be Made to Workbench

For this we need to re-work the SRE. This can be found in WorkbenchProject/src/main/java/edu.uwb.braingrid/workbench/ui/SimulationRuntimeDialog.

The main things I see needing to be modified is:

  • Obviously updating the UI (try to use JavaFX for this rather than Swing!).
  • Re-doing the event handler for the "Analyze" button.
  • The dialog will need to periodically check-in with the remote machine, so it needs some sort of thread or something running in the background to trigger this. Perhaps an AnimationTimer? From my experience they have very little overhead, but, I'm not sure whether it's a part of Swing or JavaFX.

There will also need to be some investigation for how the SRE interacts with the other bits of Workbench (for re-connecting to a incomplete sim upon re-opening Workbench). My concern is whether you can just simply start up a SRE or if there is anything else that is needed. A starting point could be looking into what exactly workbenchManager.analyzeScriptOutput() does (this is called in the event handler for the "Analyze" button), and what it requires. From this investigation we can identify everything that needs to be saved to re-connect to a incomplete sim.

Important Note

Whoever is working on this should ensure this issue from Graphitti will be resolved (you would likely be working with someone from the Graphitti team at the same time) before working on this - Graphitti needs to be logging otherwise there's no way to test the progress bar.

Related Issues

#59
#64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions