Run simulation at low process priority.
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 28 Nov 2018 01:42:16 +0000 (17:42 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 28 Nov 2018 01:42:16 +0000 (17:42 -0800)
CHANGELOG.md
src/py/bbctrl/plan.py

index f75effb280f64deb925f9b43954e93e2e6f5322b..3c74a3e007800aaefb37a2481c240fa42d8ae1af 100644 (file)
@@ -11,6 +11,7 @@ Buildbotics CNC Controller Firmware Changelog
  - Removed tool-reversed option.  Use tool-direction-mode instead.
  - Handle zero length dwell correctly.
  - Fixed problem with cached GCode file upload when file changed on disk.
+ - Run simulation at low process priority.
 
 ## v0.4.1
  - Fix toolpath view axes bug.
index dffaf8283c27ba6fe43229ad1e77c8ef5c3e2057..d3e84a00a7b2a1e3f1509a3a8f9daa9eeacc59fe 100755 (executable)
@@ -333,11 +333,14 @@ parser.add_argument('--max-time', default = 600,
                     type = int, help = 'Maximum planning time in seconds')
 parser.add_argument('--max-loop', default = 30,
                     type = int, help = 'Maximum time in loop in seconds')
+parser.add_argument('--priority', default = 1,
+                    type = int, help = 'Set "nice" process priority')
 
 args = parser.parse_args()
 
 state = json.loads(args.state)
 config = json.loads(args.config)
 
+os.nice(args.priority)
 plan = Plan(args.gcode, state, config)
 plan.run()