Add command line parsing in GUI mode and headless Windows support #498

Merged
merged 1 commit into from Feb 15, 2016

Projects

None yet

3 participants

@ThomasJClark
Contributor

In GUI mode, a file name can be specified to open, and --headless can be
added to the command to make it not really open the GUI.

In headless mode, we don't really need to listen for hangup signals
(since the wrapper script will kill any old instances of GRIP), so we
can remove that to make it work on non-unix systems.

Closes #493
Closes #492

@codecov-io

Current coverage is 50.30%

Merging #498 into master will decrease coverage by -0.04% as of 5d28256

@@            master   #498   diff @@
=====================================
  Files          130    130       
  Stmts         3879   3884     +5
  Branches       426    428     +2
  Methods          0      0       
=====================================
+ Hit           1953   1954     +1
+ Partial        110    107     -3
- Missed        1816   1823     +7

Review entire Coverage Diff as of 5d28256


Uncovered Suggestions

  1. +0.54% via .../ExceptionAlert.java#83...103
  2. +0.39% via ...cketPreviewView.java#88...102
  3. +0.39% via ...indowController.java#219...233
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

@ThomasJClark ThomasJClark Add command line parsing in GUI mode and headless Windows support
In GUI mode, a file name can be specified to open, and --headless can be
added to the command to make it not really open the GUI.

In headless mode, we don't really need to listen for hangup signals
(since the wrapper script will kill any old instances of GRIP), so we
can remove that to make it work on non-unix systems.
5757d17
@JLLeitschuh JLLeitschuh commented on the diff Feb 15, 2016
core/src/main/java/edu/wpi/grip/core/Main.java
@SuppressWarnings("PMD.SystemPrintln")
public static void main(String[] args) throws IOException, InterruptedException {
- // Close GRIP when we get SIGHUP. This signal is sent, for example, when GRIP is run in an SSH session
- // and the session is closed.
- Signal.handle(new Signal("HUP"), signal -> SafeShutdown.exit(0));
-
- System.out.println("Loading Dependency Injection Framework");
@JLLeitschuh
JLLeitschuh Feb 15, 2016 Member

If you're going to remove this put something in its place instead.

@JLLeitschuh JLLeitschuh commented on the diff Feb 15, 2016
core/src/main/java/edu/wpi/grip/core/Main.java
@SuppressWarnings("PMD.SystemPrintln")
public static void main(String[] args) throws IOException, InterruptedException {
- // Close GRIP when we get SIGHUP. This signal is sent, for example, when GRIP is run in an SSH session
- // and the session is closed.
- Signal.handle(new Signal("HUP"), signal -> SafeShutdown.exit(0));
@JLLeitschuh
JLLeitschuh Feb 15, 2016 Member

Now GRIP on a remote device will continue to publish after you disconnect.
The deployed script should respond to the hangup instead.

@ThomasJClark
ThomasJClark Feb 15, 2016 Contributor

Why is that bad? If you're testing robot code and deploying new GRIP stuff, I don't understand why you would want it to stop when you're disconnected. The reason we used to do that was to avoid letting multiple GRIPs run at the same time, but that's not a problem anymore with the wrapper script

@JLLeitschuh JLLeitschuh merged commit 9e5d577 into WPIRoboticsProjects:master Feb 15, 2016

2 of 5 checks passed

codacy/pr Not so good... This pull request quality could be better.
Details
codecov/patch 0.00% of diff hit (target 70.00%)
Details
codecov/project 50.30% (-0.04%) compared to 05bb96e at 50.34%
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment