Exemplo n.º 1
0
    def btnStopAllTORPrograms_clicked(self):
        with WaitCursor():
            jobs = []
            for c in self.cds:
                j = copy.deepcopy(DefaultJobs.WAIT)
                j.ClientId = c.Id
                jobs.append(j)
            DBManager.saveJobs(jobs)

            allWaiting = False
            while allWaiting == False:
                time.sleep(5)
                busyClients = DBManager.getBusyClients()
                if len(busyClients) == 0:
                    allWaiting = True
                else:
                    msg = "waiting for {} boxes to finish...".format(len(busyClients))
                    log.info(msg)
                    self.addStatusText(msg)

            msg = "all boxes ready waiting..."
            log.info(msg)
            self.addStatusText(msg)
            time.sleep(3)
            self.executeCommandOnTORServer(TORCommands.INTERACTIVE_STOP)
            self.executeCommandOnAllClients(TORCommands.CLIENT_SERVICE_STOP)
            self.executeCommandOnTORServer(TORCommands.SERVER_SERVICE_STOP)
            DBManager.clearAllCurrentStates()
            time.sleep(3)
            self.executeCommandOnAllClients(TORCommands.CLIENT_TURN_OFF_LEDS)
Exemplo n.º 2
0
 def btnStartAllTORPrograms_clicked(self):
     with WaitCursor():
         DBManager.clearAllCurrentStates()
         self.executeCommandOnTORServer(TORCommands.SERVER_SERVICE_START)
         self.executeCommandOnAllClients(TORCommands.CLIENT_SERVICE_START, onlyActive=True)
         self.executeCommandOnTORServer(TORCommands.INTERACTIVE_START)