Example #1
0
 private void undo(Cell cell) {
   if (!CVS.isDELIB(cell.getLibrary())) return;
   File libraryFile = TextUtils.getFile(cell.getLibrary().getLibFile());
   if (libraryFile == null) return;
   String libfile = libraryFile.getPath();
   // get cell directory if not already added before
   // check cell files
   File cellFile = new File(libfile, DELIB.getCellFile(cell));
   if (undo(cellFile)) {
     State state = CVSLibrary.getState(cell);
     if (state == State.ADDED) CVSLibrary.setState(cell, State.UNKNOWN);
     if (state == State.REMOVED) CVSLibrary.setState(cell, State.NONE);
   }
 }
Example #2
0
 /**
  * Method to return a pointer to the model referenced by the calling argument character string.
  * Returns zero on error.
  *
  * <p>Calling Arguments: modelName = pointer to a string which contains the name of the model to
  * be located by the search procedure
  */
 private ALS.Model findModel(String modelName) {
   // convert to proper name
   StringBuffer sb = new StringBuffer();
   for (int i = 0; i < modelName.length(); i++) {
     char chr = modelName.charAt(i);
     if (!TextUtils.isLetterOrDigit(chr)) chr = '_';
     sb.append(chr);
   }
   String properName = sb.toString();
   for (ALS.Model modHead : als.modelList) {
     if (modHead.name.equals(properName)) return modHead;
   }
   System.out.println("ERROR: Model '" + properName + "' not found, simulation aborted");
   return null;
 }
Example #3
0
    private void generate(StringBuffer buf, Library lib, String useDir) {
      // see if library file is in CVS
      File libraryFile = TextUtils.getFile(lib.getLibFile());
      if (libraryFile == null) return;
      String libfile = libraryFile.getPath();

      add(buf, libfile, useDir);
      if (CVS.isDELIB(lib)) {
        // see if cell directories are in CVS
        for (Iterator<Cell> it = lib.getCells(); it.hasNext(); ) {
          generate(buf, it.next(), useDir);
        }
        // add header file
        File headerFile = new File(libfile, DELIB.getHeaderFile());
        add(buf, headerFile.getPath(), useDir);
      }
    }
Example #4
0
 private void undo(Library lib) {
   // see if library file is in CVS
   File libraryFile = TextUtils.getFile(lib.getLibFile());
   if (libraryFile == null) return;
   String libfile = libraryFile.getPath();
   if (!CVS.isDELIB(lib)) {
     if (undo(new File(libfile))) {
       State state = CVSLibrary.getState(lib);
       if (state == State.ADDED) CVSLibrary.setState(lib, State.UNKNOWN);
       if (state == State.REMOVED) CVSLibrary.setState(lib, State.NONE);
     }
   } else {
     for (Iterator<Cell> it = lib.getCells(); it.hasNext(); ) {
       undo(it.next());
     }
     // undo header file
     File headerFile = new File(libfile, DELIB.getHeaderFile());
     undo(headerFile);
   }
 }
Example #5
0
 private void generate(StringBuffer buf, Cell cell, String useDir) {
   if (!CVS.isDELIB(cell.getLibrary())) return;
   File libraryFile = TextUtils.getFile(cell.getLibrary().getLibFile());
   if (libraryFile == null) return;
   String libfile = libraryFile.getPath();
   // get cell directory if not already added before
   File celldirFile = new File(libfile, DELIB.getCellSubDir(cell.getId()));
   String celldir = celldirFile.getPath();
   if (!addedCellDirs.containsKey(celldir) && !libfile.equals(celldir)) {
     if (celldirFile.exists()) add(buf, celldir, useDir);
     addedCellDirs.put(celldir, null);
   }
   // check cell files
   File cellFile = new File(libfile, DELIB.getCellFile(cell));
   add(buf, cellFile.getPath(), useDir);
   // check that header is added or in cvs, or library is going to be added
   if (add) {
     File headerFile = new File(libfile, DELIB.getHeaderFile());
     if (!libs.contains(cell.getLibrary()) && !CVS.isFileInCVS(headerFile)) {
       add(buf, headerFile.getPath(), useDir);
     }
   }
 }