use regular api for configuring mote type, instead of directly calling contiki compile method

This commit is contained in:
fros4943 2009-03-13 14:33:48 +00:00
parent fb8fab739a
commit f4333ab089

View file

@ -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: GUI.java,v 1.116 2009/03/12 15:10:00 fros4943 Exp $
* $Id: GUI.java,v 1.117 2009/03/13 14:33:48 fros4943 Exp $
*/
package se.sics.cooja;
@ -114,7 +114,6 @@ import se.sics.cooja.VisPlugin.PluginRequiresVisualizationException;
import se.sics.cooja.contikimote.ContikiMoteType;
import se.sics.cooja.dialogs.AddMoteDialog;
import se.sics.cooja.dialogs.ConfigurationWizard;
import se.sics.cooja.dialogs.ContikiMoteCompileDialog;
import se.sics.cooja.dialogs.CreateSimDialog;
import se.sics.cooja.dialogs.ExternalToolsDialog;
import se.sics.cooja.dialogs.MessageList;
@ -1066,18 +1065,16 @@ public class GUI extends Observable {
logger.info("> Creating mote type");
ContikiMoteType moteType = new ContikiMoteType();
moteType.setConfig(simulation.getGUI().getProjectConfig().clone());
moteType.setContikiSourceFile(new File(source));
moteType.setDescription("Contiki Mote Type (" + source + ")");
boolean compileOK = ContikiMoteCompileDialog.showDialog(frame, simulation, moteType);
if (!compileOK) {
logger.fatal("Contiki compilation failed, aborting quickstart");
return false;
}
try {
moteType.doInit();
} catch (MoteTypeCreationException e) {
boolean compileOK = moteType.configureAndInit(GUI.getTopParentContainer(), simulation, true);
if (!compileOK) {
logger.fatal("Mote type initialization failed, aborting quickstart");
return false;
}
} catch (MoteTypeCreationException e1) {
logger.fatal("Mote type initialization failed, aborting quickstart");
return false;
}