示例#1
0
  public void putf(NslData data) {
    try {
      StringBuffer strbuf = new StringBuffer();

      strbuf.append(data.nslGetParent().nslGetRealName()); //  Object name
      strbuf.append("." + data.nslGetName() + " ");
      strbuf.append(data.getDataType() + " "); //  Class name
      strbuf.append(data.getDimensions() + " "); //  Dimension

      strbuf.append("{ "); //  Sizes
      int dim[] = data.getSizes();
      for (int i = 0; i < data.getDimensions(); i++) {
        strbuf.append(dim[i] + " ");
      }
      strbuf.append("} ");

      strbuf.append("{ "); //  Data
      strbuf.append(data.toString());
      strbuf.append("} ");

      pwr.println(strbuf.toString());

      if (pwr.checkError()) {
        System.err.println("NslFile: An error happened while writing in file: " + name);
      }
    } catch (Exception e) {
      System.err.println("NslFile: Can't write line in file " + name);
    }
  }
示例#2
0
 public void gets(NslData data) {
   try {
     String temp = brd.readLine();
     String command =
         "nsl set "
             + data.nslGetParent().nslGetRealName()
             + "."
             + data.nslGetName()
             + " { "
             + temp
             + " }";
     // System.err.println(command);
     Executive.interp.eval(command);
   } catch (IOException e) {
     System.err.println("NslFile: Can't read line in file " + name);
   } catch (TclException e) {
     System.err.println("NslFile: Asignation error reading " + name);
   }
 }