minor updates due to deleted static variables

This commit is contained in:
fros4943 2007-01-09 10:02:16 +00:00
parent d579da7a8a
commit 6a6b900955
3 changed files with 12 additions and 11 deletions

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: MantisMote.java,v 1.1 2006/11/09 19:31:15 fros4943 Exp $ * $Id: MantisMote.java,v 1.2 2007/01/09 10:02:16 fros4943 Exp $
*/ */
package se.sics.cooja.mantismote; package se.sics.cooja.mantismote;
@ -188,7 +188,7 @@ public class MantisMote implements Mote {
} }
public boolean setConfigXML(Simulation simulation, public boolean setConfigXML(Simulation simulation,
Collection<Element> configXML) { Collection<Element> configXML, boolean visAvailable) {
mySimulation = simulation; mySimulation = simulation;
for (Element element : configXML) { for (Element element : configXML) {
@ -201,7 +201,7 @@ public class MantisMote implements Mote {
.getMoteInterfaces()); .getMoteInterfaces());
} else if (name.equals("interface_config")) { } else if (name.equals("interface_config")) {
Class<? extends MoteInterface> moteInterfaceClass = GUI.currentGUI Class<? extends MoteInterface> moteInterfaceClass = simulation.getGUI()
.tryLoadClass(this, MoteInterface.class, element.getText().trim()); .tryLoadClass(this, MoteInterface.class, element.getText().trim());
if (moteInterfaceClass == null) { if (moteInterfaceClass == null) {
@ -213,7 +213,7 @@ public class MantisMote implements Mote {
MoteInterface moteInterface = myInterfaceHandler MoteInterface moteInterface = myInterfaceHandler
.getInterfaceOfType(moteInterfaceClass); .getInterfaceOfType(moteInterfaceClass);
if (moteInterface != null) if (moteInterface != null)
moteInterface.setConfigXML(element.getChildren()); moteInterface.setConfigXML(element.getChildren(), visAvailable);
else else
logger logger
.warn("Can't restore configuration for non-existing interface: " .warn("Can't restore configuration for non-existing interface: "

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: MantisMoteType.java,v 1.1 2006/11/09 19:31:15 fros4943 Exp $ * $Id: MantisMoteType.java,v 1.2 2007/01/09 10:02:16 fros4943 Exp $
*/ */
package se.sics.cooja.mantismote; package se.sics.cooja.mantismote;
@ -355,7 +355,8 @@ public class MantisMoteType implements MoteType {
return new MantisMote(this, mySimulation); return new MantisMote(this, mySimulation);
} }
public boolean configureAndInit(JFrame parentFrame, Simulation simulation) { public boolean configureAndInit(JFrame parentFrame, Simulation simulation, boolean visAvailable) {
if (!visAvailable) logger.fatal(">>>>>>> NOT IMPLEMENTED");
return MantisMoteTypeDialog.showDialog(parentFrame, simulation, this); return MantisMoteTypeDialog.showDialog(parentFrame, simulation, this);
} }
@ -383,7 +384,7 @@ public class MantisMoteType implements MoteType {
} }
public boolean setConfigXML(Simulation simulation, public boolean setConfigXML(Simulation simulation,
Collection<Element> configXML) { Collection<Element> configXML, boolean visAvailable) {
mySimulation = simulation; mySimulation = simulation;
for (Element element : configXML) { for (Element element : configXML) {
@ -400,7 +401,7 @@ public class MantisMoteType implements MoteType {
} }
} }
boolean createdOK = configureAndInit(GUI.frame, simulation); boolean createdOK = configureAndInit(GUI.frame, simulation, visAvailable);
return createdOK; return createdOK;
} }

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: MantisMoteTypeDialog.java,v 1.1 2006/11/09 19:31:14 fros4943 Exp $ * $Id: MantisMoteTypeDialog.java,v 1.2 2007/01/09 10:02:16 fros4943 Exp $
*/ */
package se.sics.cooja.mantismote; package se.sics.cooja.mantismote;
@ -156,12 +156,12 @@ public class MantisMoteTypeDialog extends JDialog {
} }
// Load all mote interface classes // Load all mote interface classes
String[] moteInterfaces = GUI.currentGUI.getPlatformConfig().getStringArrayValue(MantisMoteType.class, "MOTE_INTERFACES"); String[] moteInterfaces = simulation.getGUI().getPlatformConfig().getStringArrayValue(MantisMoteType.class, "MOTE_INTERFACES");
myDialog.moteInterfaceClasses = new Vector<Class<? extends MoteInterface>>(); myDialog.moteInterfaceClasses = new Vector<Class<? extends MoteInterface>>();
for (String moteInterface : moteInterfaces) { for (String moteInterface : moteInterfaces) {
try { try {
Class<? extends MoteInterface> newMoteInterfaceClass = Class<? extends MoteInterface> newMoteInterfaceClass =
GUI.currentGUI.tryLoadClass(GUI.currentGUI, MoteInterface.class, moteInterface); simulation.getGUI().tryLoadClass(simulation.getGUI(), MoteInterface.class, moteInterface);
myDialog.moteInterfaceClasses.add(newMoteInterfaceClass); myDialog.moteInterfaceClasses.add(newMoteInterfaceClass);
/*logger.info("Loaded Mantis mote interface: " + newMoteInterfaceClass);*/ /*logger.info("Loaded Mantis mote interface: " + newMoteInterfaceClass);*/
} catch (Exception e) { } catch (Exception e) {