Package avrora.core

Examples of avrora.core.LoadableProgram


   * @param fileELF ELF file
   * @param cpu MSP430 cpu
   * @throws Exception
   */
  protected void prepareMote(File file) throws Exception {
    program = new LoadableProgram(file);
    program.load();
    PlatformFactory factory = new MicaZ.Factory();
    micaZ = (MicaZ) factory.newPlatform(1, program.getProgram());
    myCpu = (AtmelMicrocontroller) micaZ.getMicrocontroller();
    eeprom = (EEPROM) myCpu.getDevice("eeprom");
View Full Code Here


        while (i.hasNext()) {

            if (args.length <= cntr) break;

            String pname = args[cntr++];
            LoadableProgram lp = new LoadableProgram(pname);
            lp.load();

            // create a number of nodes with the same program
            int max = StringUtil.evaluateIntegerLiteral((String)i.next());
            for (int node = 0; node < max; node++) {
                SensorNode n = (SensorNode)createNode(pf, lp);
View Full Code Here

            Avrora.userError("Simulation error", "No program specified");
        if ( args.length > 1 )
            Avrora.userError("Simulation error", "Single node simulation accepts only one program");
        Main.checkFilesExist(args);

        LoadableProgram p = new LoadableProgram(args[0]);
        p.load();
        PlatformFactory pf = getPlatform();
        createNode(pf, p);

    }
View Full Code Here

        //actually selected a file
        if (currentFileAllInfo == null) {
            return true;
        }

        LoadableProgram pp = new LoadableProgram(currentFileAllInfo);
        try {
            pp.load();
        } catch ( Exception e ) {
            // TODO: display exception loading file
            throw Avrora.failure(e.toString());
        }
        PlatformFactory pf = Defaults.getPlatform("mica2");
View Full Code Here

   @return the ID of the new Node;
   *  <code>Const.NODE_CREATION_FAILED</code> if creation was not successful
   */
  public int createNode(String filename) {
    int             hash = Const.NODE_CREATION_FAILED;
    LoadableProgram lp;
   
    Utils.debugMsg("createNode()", this);
    System.out.println("**"+filename+"**");
    try {
      // Testen, ob schon mind. ein Knoten mit diesem Prog existiert
      if (loadableProgMap.containsKey(filename)) {
        lp = (LoadableProgram) loadableProgMap.get(filename);
      } else {
        lp = new LoadableProgram(filename);
        lp.load();
        loadableProgMap.put(filename, lp);
      }

      Simulation.Node n = (Simulation.Node) sim.createNode(pf,lp);
     
View Full Code Here

   * @param fileELF ELF file
   * @param cpu MSP430 cpu
   * @throws Exception
   */
  protected void prepareMote(File file) throws Exception {
    program = new LoadableProgram(file);
    program.load();
    PlatformFactory factory = new MicaZ.Factory();
    micaZ = (MicaZ) factory.newPlatform(1, program.getProgram());
    myCpu = (AtmelMicrocontroller) micaZ.getMicrocontroller();
    eeprom = (EEPROM) myCpu.getDevice("eeprom");
View Full Code Here

   * @param fileELF ELF file
   * @param cpu MSP430 cpu
   * @throws Exception
   */
  protected void prepareMote(File file) throws Exception {
    program = new LoadableProgram(file);
    program.load();
    PlatformFactory factory = new MicaZ.Factory();
    micaZ = (MicaZ) factory.newPlatform(1, program.getProgram());
    myCpu = (AtmelMicrocontroller) micaZ.getMicrocontroller();
    eeprom = (EEPROM) myCpu.getDevice("eeprom");
View Full Code Here

TOP

Related Classes of avrora.core.LoadableProgram

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.