Changeset 2463


Ignore:
Timestamp:
03/16/07 13:26:05 (13 years ago)
Author:
curtis
Message:

Insert Thread.sleep call in MacroManager thread to avoid 100% CPU usage.
Comment out macro recording logic for now, because it causes the macro
recorder window to pop up.

Location:
trunk/loci/plugins/browser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/browser/CustomWindow.java

    r2427 r2463  
    2727import ij.*; 
    2828import ij.gui.*; 
    29 import ij.macro.MacroRunner; 
     29//import ij.macro.MacroRunner; 
    3030import ij.measure.Calibration; 
    3131import ij.process.*; 
    3232import java.awt.*; 
    3333import java.awt.event.*; 
    34 import java.util.Vector; 
     34//import java.util.Vector; 
    3535import javax.swing.*; 
    3636import javax.swing.event.ChangeEvent; 
     
    347347      ImageProcessor clone = db.manager.getSlice(index).duplicate(); 
    348348      imp.setProcessor(patternTitle, clone); 
     349 
    349350      // now execute macros as needed 
    350  
    351       Vector macros = db.macro.getMacros(); 
    352       for (int i=0; i<macros.size(); i++) { 
    353         MacroRunner runner = new MacroRunner((String) macros.get(i)); 
    354       } 
     351// TODO: macros 
     352//      Vector macros = db.macro.getMacros(); 
     353//      for (int i=0; i<macros.size(); i++) { 
     354//        MacroRunner runner = new MacroRunner((String) macros.get(i)); 
     355//      } 
    355356       
    356357      index = 1; 
     
    371372   
    372373    // now execute macros as needed  
    373  
    374     Vector macros = db.macro.getMacros(); 
    375     for (int i=0; i<macros.size(); i++) { 
    376       MacroRunner runner = new MacroRunner((String) macros.get(i)); 
    377     } 
     374// TODO: macros 
     375//    Vector macros = db.macro.getMacros(); 
     376//    for (int i=0; i<macros.size(); i++) { 
     377//      MacroRunner runner = new MacroRunner((String) macros.get(i)); 
     378//    } 
    378379     
    379380    repaint(); 
  • trunk/loci/plugins/browser/LociDataBrowser.java

    r2425 r2463  
    8383  protected CacheManager manager; 
    8484 
    85   /** Macro manager - allows us to perform operations on a virtual stack. */ 
    86   protected MacroManager macro; 
    87  
    88   /** Macro manager thread. */ 
    89   protected Thread macroThread; 
     85//  /** Macro manager - allows us to perform operations on a virtual stack. */ 
     86//  protected MacroManager macro; 
     87 
     88//  /** Macro manager thread. */ 
     89//  protected Thread macroThread; 
    9090 
    9191  /** Series to use in a multi-series file. */ 
     
    100100    fStitch = new FileStitcher(); 
    101101    reader = new ChannelSeparator(fStitch); 
    102     macro = new MacroManager(); 
    103     macroThread = new Thread(macro, "MacroRecorder"); 
    104     macroThread.start();  
     102// TODO: macros 
     103//    macro = new MacroManager(); 
     104//    macroThread = new Thread(macro, "MacroRecorder"); 
     105//    macroThread.start();  
    105106  } 
    106107 
     
    280281 
    281282  public void run(String arg) { 
    282     macro = new MacroManager(); 
    283     macroThread = new Thread(macro, "MacroRecorder"); 
    284     macroThread.start();  
     283// TODO: macros 
     284//    macro = new MacroManager(); 
     285//    macroThread = new Thread(macro, "MacroRecorder"); 
     286//    macroThread.start();  
    285287     
    286288    LociOpener lociOpener = new LociOpener(); 
  • trunk/loci/plugins/browser/MacroManager.java

    r2427 r2463  
    6666    while (true) { 
    6767      String cmds = textBox.getText(); 
    68       if (previousText == null || !cmds.equals(previousText)) {  
     68      if (previousText == null || !cmds.equals(previousText)) { 
    6969        StringTokenizer st = new StringTokenizer(cmds, "\n"); 
    7070        for (int i=0; i<macros.size(); i++) st.nextToken(); 
     
    7878        previousText = cmds;  
    7979      } 
     80      try { 
     81        Thread.sleep(50); 
     82      } 
     83      catch (InterruptedException exc) { exc.printStackTrace(); } 
    8084    } 
    8185  } 
Note: See TracChangeset for help on using the changeset viewer.