def solveBallast(self):
    if (not self.assert_selection_valid()):
        return
    code = 'from DAVE.solvers.ballast import BallastSystemSolver'
    code += '\nballast_solver = BallastSystemSolver(s["{}"])\n'.format(self._bs.name)
    code += 'ballast_solver.ballast_to(cogx = s.required_ballast[1], cogy = s.required_ballast[2], weight = -s.required_ballast[0])\n'
    self.guiRunCodeCallback(code, guiEventType.SELECTED_NODE_MODIFIED)
def solveBallast(self):
    if (not self.assert_selection_valid()):
        return
    code = 'from DAVE.solvers.ballast import BallastSystemSolver'
    code += '\nballast_solver = BallastSystemSolver(s["{}"])\n'.format(self._bs.name)
    code += 'ballast_solver.ballast_to(cogx = s.required_ballast[1], cogy = s.required_ballast[2], weight = -s.required_ballast[0])\n'
    self.guiRunCodeCallback(code, guiEventType.SELECTED_NODE_MODIFIED)