Package net.sf.mzmine.taskcontrol

Examples of net.sf.mzmine.taskcontrol.Task


  public ExitCode runModule(@Nonnull ParameterSet parameters,
      @Nonnull Collection<Task> tasks) {
    RawDataFile[] dataFiles = parameters.getParameter(
        TargetedPeakDetectionParameters.rawDataFile).getValue();
    for (RawDataFile dataFile : dataFiles) {
      Task newTask = new TargetedPeakDetectionModuleTask(parameters,
          dataFile);
      tasks.add(newTask);
    }
    return ExitCode.OK;
  }
View Full Code Here


    RawDataFile dataFiles[] = parameters.getParameter(
        BaselineCorrectionParameters.dataFiles).getValue();

    for (final RawDataFile dataFile : dataFiles) {

      Task newTask = new BaselineCorrectionTask(dataFile, parameters);
      tasks.add(newTask);
    }

    return ExitCode.OK;
  }
View Full Code Here

        .getTaskController();

    WrappedTask currentQueue[] = taskController.getTaskQueue()
        .getQueueSnapshot();

    Task selectedTask = null;

    int selectedRow = taskTable.getSelectedRow();

    if ((selectedRow < currentQueue.length) && (selectedRow >= 0))
      selectedTask = currentQueue[selectedRow].getActualTask();

    Object src = event.getSource();

    if (src == cancelTaskMenuItem) {
      if (selectedTask == null)
        return;
      TaskStatus status = selectedTask.getStatus();
      if ((status == TaskStatus.WAITING)
          || (status == TaskStatus.PROCESSING)) {
        selectedTask.cancel();
      }
    }

    if (src == cancelAllMenuItem) {
      for (WrappedTask wrappedTask : currentQueue) {
        Task task = wrappedTask.getActualTask();
        TaskStatus status = task.getStatus();
        if ((status == TaskStatus.WAITING)
            || (status == TaskStatus.PROCESSING)) {
          task.cancel();
        }
      }
    }

    if (src == highPriorityMenuItem) {
View Full Code Here

  /**
   * @see java.lang.Runnable#run()
   */
  public void run() {

    Task actualTask = wrappedTask.getActualTask();

    logger.finest("Starting processing of task: "
        + actualTask.getTaskDescription());

    try {

      // Process the actual task
      actualTask.run();

      // Check if task finished with an error
      if (actualTask.getStatus() == TaskStatus.ERROR) {
        logger.severe("Task error: " + actualTask.getErrorMessage());

        String errorMsg = actualTask.getErrorMessage();
        if (errorMsg == null)
          errorMsg = "Unspecified error";

        MZmineCore.getDesktop().displayErrorMessage(
            "Error of task " + actualTask.getTaskDescription(),
            errorMsg);
      }

      /*
       * This is important to allow the garbage collector to remove the
       * task, while keeping the task description in the
       * "Tasks in progress" window
       */
      wrappedTask.removeTaskReference();

    } catch (Throwable e) {

      /*
       * This should never happen, it means the task did not handle its
       * exception properly, or there was some severe error, like
       * OutOfMemoryError
       */

      logger.log(Level.SEVERE,
          "Unhandled exception " + e + " while processing task "
              + actualTask.getTaskDescription(), e);

      e.printStackTrace();

      MZmineCore.getDesktop().displayErrorMessage(
          "Unhandled exception in task "
              + actualTask.getTaskDescription() + ": "
              + ExceptionUtils.exceptionToString(e));

    }

    /*
 
View Full Code Here

    PeakList peakLists[] = parameters.getParameter(
        ShapeModelerParameters.peakLists).getValue();

    for (final PeakList peakList : peakLists) {
      Task newTask = new ShapeModelerTask(peakList, parameters);
      tasks.add(newTask);
    }

    return ExitCode.OK;
  }
View Full Code Here

      @Nonnull Collection<Task> tasks) {
    PeakList peakLists[] = parameters.getParameter(
        SmoothingParameters.peakLists).getValue();

    for (final PeakList peakList : peakLists) {
      Task newTask = new SmoothingTask(peakList, parameters);
      tasks.add(newTask);
    }

    return ExitCode.OK;
  }
View Full Code Here

      @Nonnull Collection<Task> tasks) {

    final PeakList[] peakLists = parameters.getParameter(
        PeakListIdentificationParameters.peakLists).getValue();
    for (final PeakList peakList : peakLists) {
      Task newTask = new PeakListIdentificationTask(parameters, peakList);
      tasks.add(newTask);
    }

    return ExitCode.OK;
  }
View Full Code Here

    PeakList peakLists[] = parameters.getParameter(
        CameraSearchParameters.PEAK_LISTS).getValue();

    for (PeakList peakList : peakLists) {
      Task newTask = new CameraSearchTask(parameters, peakList);
      tasks.add(newTask);
    }

    return ExitCode.OK;
  }
View Full Code Here

    PeakList peakLists[] = parameters.getParameter(
        ComplexSearchParameters.peakLists).getValue();

    for (PeakList peakList : peakLists) {
      Task newTask = new ComplexSearchTask(parameters, peakList);
      tasks.add(newTask);
    }

    return ExitCode.OK;
  }
View Full Code Here

    PeakList peakLists[] = parameters.getParameter(
        MascotParameters.peakLists).getValue();

    for (PeakList peakList : peakLists) {
      Task newTask = new MascotSearchTask(parameters, peakList);
      tasks.add(newTask);
    }

    return ExitCode.OK;
  }
View Full Code Here

TOP

Related Classes of net.sf.mzmine.taskcontrol.Task

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.