+ support for configurable buffer sizes (currently only for log output events)
This commit is contained in:
parent
7a228fea41
commit
739e21caaf
5 changed files with 283 additions and 12 deletions
|
@ -24,7 +24,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: Simulation.java,v 1.49 2009/07/02 12:04:28 fros4943 Exp $
|
||||
* $Id: Simulation.java,v 1.50 2009/07/03 13:37:41 fros4943 Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja;
|
||||
|
@ -413,7 +413,7 @@ public class Simulation extends Observable implements Runnable {
|
|||
* @return Current simulation config
|
||||
*/
|
||||
public Collection<Element> getConfigXML() {
|
||||
Vector<Element> config = new Vector<Element>();
|
||||
ArrayList<Element> config = new ArrayList<Element>();
|
||||
|
||||
Element element;
|
||||
|
||||
|
@ -445,18 +445,23 @@ public class Simulation extends Observable implements Runnable {
|
|||
element = new Element("radiomedium");
|
||||
element.setText(currentRadioMedium.getClass().getName());
|
||||
|
||||
Collection radioMediumXML = currentRadioMedium.getConfigXML();
|
||||
Collection<Element> radioMediumXML = currentRadioMedium.getConfigXML();
|
||||
if (radioMediumXML != null) {
|
||||
element.addContent(radioMediumXML);
|
||||
}
|
||||
config.add(element);
|
||||
|
||||
/* Event central */
|
||||
element = new Element("events");
|
||||
element.addContent(eventCentral.getConfigXML());
|
||||
config.add(element);
|
||||
|
||||
// Mote types
|
||||
for (MoteType moteType : getMoteTypes()) {
|
||||
element = new Element("motetype");
|
||||
element.setText(moteType.getClass().getName());
|
||||
|
||||
Collection moteTypeXML = moteType.getConfigXML();
|
||||
Collection<Element> moteTypeXML = moteType.getConfigXML();
|
||||
if (moteTypeXML != null) {
|
||||
element.addContent(moteTypeXML);
|
||||
}
|
||||
|
@ -468,7 +473,7 @@ public class Simulation extends Observable implements Runnable {
|
|||
element = new Element("mote");
|
||||
element.setText(mote.getClass().getName());
|
||||
|
||||
Collection moteXML = mote.getConfigXML();
|
||||
Collection<Element> moteXML = mote.getConfigXML();
|
||||
if (moteXML != null) {
|
||||
element.addContent(moteXML);
|
||||
}
|
||||
|
@ -560,6 +565,11 @@ public class Simulation extends Observable implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
/* Event central */
|
||||
if (element.getName().equals("events")) {
|
||||
eventCentral.setConfigXML(this, element.getChildren(), visAvailable);
|
||||
}
|
||||
|
||||
// Mote type
|
||||
if (element.getName().equals("motetype")) {
|
||||
String moteTypeClassName = element.getText().trim();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue