Changeset 1076


Ignore:
Timestamp:
May 15, 2009, 5:27:03 PM (14 years ago)
Author:
Jari Häkkinen
Message:

Adding context checks for number of channels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/base2/net.sf.basedb.pluginutilities/trunk/src/net/sf/basedb/plugins/AbstractRunBinaryPlugin.java

    r1046 r1076  
    3030import net.sf.basedb.core.BioAssaySet;
    3131import net.sf.basedb.core.DbControl;
     32import net.sf.basedb.core.Experiment;
     33import net.sf.basedb.core.Item;
    3234import net.sf.basedb.core.ItemParameterType;
    3335import net.sf.basedb.core.Job;
     
    256258          List<BioAssay> assays = sourceBAS.getBioAssays().list(dc);
    257259          PluginParameter<BioAssay> par = new PluginParameter<BioAssay>
    258             ( selectBASid, "Select assays", selectBASdescription,
     260            ( selectBASid, selectBASlabel, selectBASdescription,
    259261              new ItemParameterType<BioAssay>(BioAssay.class, assays.get(0),
    260262                                              true, assays.size(), assays) );
     
    316318    signalHandler = new ThreadSignalHandler();
    317319    return signalHandler;
     320  }
     321
     322
     323  public String isInContext(GuiContext context, Object item)
     324  {
     325    DbControl dc = sc.newDbControl();
     326    try {
     327      Experiment e=Experiment.getById
     328        (dc, sc.getCurrentContext(Item.EXPERIMENT).getId());
     329      int channels=e.getRawDataType().getChannels();
     330      if (channels<minNofChannels || channels>maxNofChannels)
     331        return ("Number of channels must be between " + minNofChannels +
     332                " and " + maxNofChannels);
     333    }
     334    finally {
     335      if (dc != null)
     336        dc.close();
     337    }
     338    return null;
    318339  }
    319340
     
    415436  protected BioAssaySet sourceBAS = null;
    416437  protected BioAssaySet selectBAS = null;
     438
     439  protected int minNofChannels=0;
     440  protected int maxNofChannels=0;
     441
    417442  protected Boolean selectBASconfigure = false;
    418443  protected String selectBASdescription = null;
    419444  protected final String selectBASid = "selectBAS";
     445  protected String selectBASlabel = "Select assays";
    420446
    421447  // files
Note: See TracChangeset for help on using the changeset viewer.