mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-10-10 16:24:09 +00:00
use regular api for configuring mote type, instead of directly calling contiki compile method
This commit is contained in:
parent
fb8fab739a
commit
f4333ab089
@ -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: 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;
|
package se.sics.cooja;
|
||||||
@ -114,7 +114,6 @@ import se.sics.cooja.VisPlugin.PluginRequiresVisualizationException;
|
|||||||
import se.sics.cooja.contikimote.ContikiMoteType;
|
import se.sics.cooja.contikimote.ContikiMoteType;
|
||||||
import se.sics.cooja.dialogs.AddMoteDialog;
|
import se.sics.cooja.dialogs.AddMoteDialog;
|
||||||
import se.sics.cooja.dialogs.ConfigurationWizard;
|
import se.sics.cooja.dialogs.ConfigurationWizard;
|
||||||
import se.sics.cooja.dialogs.ContikiMoteCompileDialog;
|
|
||||||
import se.sics.cooja.dialogs.CreateSimDialog;
|
import se.sics.cooja.dialogs.CreateSimDialog;
|
||||||
import se.sics.cooja.dialogs.ExternalToolsDialog;
|
import se.sics.cooja.dialogs.ExternalToolsDialog;
|
||||||
import se.sics.cooja.dialogs.MessageList;
|
import se.sics.cooja.dialogs.MessageList;
|
||||||
@ -1066,18 +1065,16 @@ public class GUI extends Observable {
|
|||||||
|
|
||||||
logger.info("> Creating mote type");
|
logger.info("> Creating mote type");
|
||||||
ContikiMoteType moteType = new ContikiMoteType();
|
ContikiMoteType moteType = new ContikiMoteType();
|
||||||
moteType.setConfig(simulation.getGUI().getProjectConfig().clone());
|
|
||||||
moteType.setContikiSourceFile(new File(source));
|
moteType.setContikiSourceFile(new File(source));
|
||||||
moteType.setDescription("Contiki Mote Type (" + 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 {
|
try {
|
||||||
moteType.doInit();
|
boolean compileOK = moteType.configureAndInit(GUI.getTopParentContainer(), simulation, true);
|
||||||
} catch (MoteTypeCreationException e) {
|
if (!compileOK) {
|
||||||
|
logger.fatal("Mote type initialization failed, aborting quickstart");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (MoteTypeCreationException e1) {
|
||||||
logger.fatal("Mote type initialization failed, aborting quickstart");
|
logger.fatal("Mote type initialization failed, aborting quickstart");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user