diff options
Diffstat (limited to 'modules/xcos')
-rwxr-xr-x | modules/xcos/build/classes/org/scilab/modules/xcos/block/AfficheBlock$UpdateValueListener.class | bin | 2517 -> 3705 bytes | |||
-rwxr-xr-x | modules/xcos/jar/org.scilab.modules.xcos.jar | bin | 540638 -> 541291 bytes | |||
-rwxr-xr-x | modules/xcos/src/java/org/scilab/modules/xcos/block/AfficheBlock.java | 75 |
3 files changed, 75 insertions, 0 deletions
diff --git a/modules/xcos/build/classes/org/scilab/modules/xcos/block/AfficheBlock$UpdateValueListener.class b/modules/xcos/build/classes/org/scilab/modules/xcos/block/AfficheBlock$UpdateValueListener.class Binary files differindex 2fa496fea..abe4e413d 100755 --- a/modules/xcos/build/classes/org/scilab/modules/xcos/block/AfficheBlock$UpdateValueListener.class +++ b/modules/xcos/build/classes/org/scilab/modules/xcos/block/AfficheBlock$UpdateValueListener.class diff --git a/modules/xcos/jar/org.scilab.modules.xcos.jar b/modules/xcos/jar/org.scilab.modules.xcos.jar Binary files differindex e4c484afa..e9a26f59d 100755 --- a/modules/xcos/jar/org.scilab.modules.xcos.jar +++ b/modules/xcos/jar/org.scilab.modules.xcos.jar diff --git a/modules/xcos/src/java/org/scilab/modules/xcos/block/AfficheBlock.java b/modules/xcos/src/java/org/scilab/modules/xcos/block/AfficheBlock.java index 24898c188..20634dc50 100755 --- a/modules/xcos/src/java/org/scilab/modules/xcos/block/AfficheBlock.java +++ b/modules/xcos/src/java/org/scilab/modules/xcos/block/AfficheBlock.java @@ -40,6 +40,18 @@ import com.mxgraph.util.mxRectangle; import com.mxgraph.view.mxCellState; import com.mxgraph.view.mxGraphView; +// modified_shank +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.management.ClassLoadingMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.lang.management.ThreadMXBean; +import java.util.List; +// + /** * Implement the AFFICH_m block */ @@ -98,6 +110,63 @@ public final class AfficheBlock extends BasicBlock { if (cell != null) { final XcosDiagram diag = Xcos.findParent(cell); final String value = getText(data); + +////// modified_shank + BufferedWriter bw = null; + FileWriter fw = null; + String filename = null ; +final String jvmName = ManagementFactory.getRuntimeMXBean().getName(); + final int index = jvmName.indexOf('@'); +String pid = (Long.toString(Long.parseLong(jvmName.substring(0, index)))); + + if (index < 1) { + // part before '@' empty (index = 0) / '@' not found (index = -1) + + } + + try { + filename = "scilab-log-"+pid+".txt"; + } catch (NumberFormatException e) { + // ignore + } + +try { + fw = new FileWriter(filename, true); + bw = new BufferedWriter(fw); + + String content = value.toString(); + content = content.replaceAll("\\s+", " "); + content = pid+" || Block Identifier 20"+content+"\n"; + bw.write(content); + + // no need to close it. + //bw.close(); + + //System.out.println("Done"); + + } catch (IOException e) { + + e.printStackTrace(); + + }finally { + + try { + + if (bw != null) + bw.close(); + + if (fw != null) + fw.close(); + + } catch (IOException ex) { + + ex.printStackTrace(); + + } + + } +// + diag.getModel().setValue(cell, value); @@ -234,9 +303,12 @@ public final class AfficheBlock extends BasicBlock { value.append(SPACE); } value.append(NEW_LINE); + } src.setValue(value.toString()); + + } /** @@ -257,6 +329,8 @@ public final class AfficheBlock extends BasicBlock { AbstractElement.incrementIndexes(index, true); } + + /* * Apply style */ @@ -320,6 +394,7 @@ public final class AfficheBlock extends BasicBlock { if (GraphicsEnvironment.isHeadless()) { return; } + synchronized (values) { values.put(uid, value); |