Removed obsolete mote class reference in simulation configs

This commit is contained in:
nifi 2010-02-04 15:32:41 +00:00
parent 8cf4821a73
commit 86f6bbf61a

View file

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: Simulation.java,v 1.61 2010/02/03 15:49:25 fros4943 Exp $ * $Id: Simulation.java,v 1.62 2010/02/04 15:32:41 nifi Exp $
*/ */
package se.sics.cooja; package se.sics.cooja;
@ -503,7 +503,6 @@ public class Simulation extends Observable implements Runnable {
// Motes // Motes
for (Mote mote : motes) { for (Mote mote : motes) {
element = new Element("mote"); element = new Element("mote");
element.setText(mote.getClass().getName());
Collection<Element> moteConfig = mote.getConfigXML(); Collection<Element> moteConfig = mote.getConfigXML();
if (moteConfig == null) { if (moteConfig == null) {
@ -641,18 +640,20 @@ public class Simulation extends Observable implements Runnable {
/* Mote */ /* Mote */
if (element.getName().equals("mote")) { if (element.getName().equals("mote")) {
String moteClassName = element.getText().trim();
/* Read mote type identifier */ /* Read mote type identifier */
MoteType moteType = null; MoteType moteType = null;
for (Element subElement: (Collection<Element>) element.getChildren()) { for (Element subElement: (Collection<Element>) element.getChildren()) {
if (subElement.getName().equals("motetype_identifier")) { if (subElement.getName().equals("motetype_identifier")) {
moteType = getMoteType(subElement.getText()); moteType = getMoteType(subElement.getText());
if (moteType == null) {
throw new Exception("No mote type '" + subElement.getText() + "' for mote");
}
break; break;
} }
} }
if (moteType == null) { if (moteType == null) {
throw new Exception("No mote type for mote: " + moteClassName); throw new Exception("No mote type specified for mote");
} }
/* Create mote using mote type */ /* Create mote using mote type */