|
From: vito <vit...@gm...> - 2010-09-29 20:46:58
|
Hi all,
i have add the following code in RadioLogger.java
public void save2file(String fileName) {
File saveFile = new File(fileName);
try {
PrintWriter outStream = new PrintWriter(new FileWriter(saveFile));
for(int i=0; i < connections.size(); i++) {
outStream.print("" + dataTable.getValueAt(i, COLUMN_TIME) +
'\t');
outStream.print("" + dataTable.getValueAt(i, COLUMN_FROM) +
'\t');
outStream.print("" + getDestString(connections.get(i)) + '\t');
outStream.print("" + dataTable.getValueAt(i, COLUMN_DATA) +
'\n');
}
outStream.close();
} catch (Exception ex) {
logger.fatal("Could not write to file: " + saveFile);
}
};
So, I have modified
the rpl-udp.csc simulation to include the following script:
TIMEOUT(60000,mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.RadioLogger").save2file("RadioLogger.log"));
while (true) {
log.log(time + ":" + id + ":" + msg + "\n");
YIELD();
}
with gui is perfect, but with no gui the system response whit error no call save2file().
anybody have a solution for this problem.
thank a lot gui.
|