Examples of Led


Examples of se.sics.cooja.interfaces.LED

      observer = null;
    }
  }

  private void addMoteObservers(Mote mote, final MoteEvents moteEvents) {
    final LED moteLEDs = mote.getInterfaces().getLED();
    final Radio moteRadio = mote.getInterfaces().getRadio();
    final Log moteLog = mote.getInterfaces().getLog();
    /* TODO Watchpoints? */

    /* LEDs */
    if (moteLEDs != null) {
      LEDEvent startupEv = new LEDEvent(
          simulation.getSimulationTime(),
          moteLEDs.isRedOn(),
          moteLEDs.isGreenOn(),
          moteLEDs.isYellowOn()
      );
      moteEvents.addLED(startupEv);
      Observer observer = new Observer() {
        public void update(Observable o, Object arg) {
          LEDEvent ev = new LEDEvent(
              simulation.getSimulationTime(),
              moteLEDs.isRedOn(),
              moteLEDs.isGreenOn(),
              moteLEDs.isYellowOn()
          );

          moteEvents.addLED(ev);
        }
      };

      moteLEDs.addObserver(observer);
      activeMoteObservers.add(new MoteObservation(mote, moteLEDs, observer));
    }

    /* Radio HW */
    if (moteRadio != null) {
View Full Code Here

Examples of se.sics.cooja.interfaces.LED

    public String getDescription(Visualizer visualizer, Mote mote) {
      return "Show LEDs on " + mote;
    }
    public void doAction(Visualizer visualizer, Mote mote) {
      Simulation simulation = mote.getSimulation();
      LED led = mote.getInterfaces().getLED();
      if (led == null) {
        return;
      }

      /* Extract description (input to plugin) */
 
View Full Code Here

Examples of se.sics.cooja.interfaces.LED

  private void addMoteObservers(final Mote mote, final MoteEvents moteEvents) {
    /* TODO Log: final Log moteLog = mote.getInterfaces().getLog(); */
    /* TODO Unknown state event */

    /* LEDs */
    final LED moteLEDs = mote.getInterfaces().getLED();
    if (moteLEDs != null) {
      LEDEvent startupEv = new LEDEvent(
          simulation.getSimulationTime(),
          moteLEDs.isRedOn(),
          moteLEDs.isGreenOn(),
          moteLEDs.isYellowOn()
      );
      moteEvents.addLED(startupEv);
      Observer observer = new Observer() {
        public void update(Observable o, Object arg) {
          LEDEvent ev = new LEDEvent(
              simulation.getSimulationTime(),
              moteLEDs.isRedOn(),
              moteLEDs.isGreenOn(),
              moteLEDs.isYellowOn()
          );

          moteEvents.addLED(ev);
        }
      };

      moteLEDs.addObserver(observer);
      activeMoteObservers.add(new MoteObservation(mote, moteLEDs, observer));
    }

    /* Radio HW, RXTX */
    final Radio moteRadio = mote.getInterfaces().getRadio();
View Full Code Here

Examples of se.sics.cooja.interfaces.LED

  public void paintAfterMotes(Graphics g) {
    /* Paint LEDs left of each mote */
    Mote[] allMotes = simulation.getMotes();
    for (Mote mote: allMotes) {
      LED leds = mote.getInterfaces().getLED();
      if (leds == null) {
        continue;
      }

      Position pos = mote.getInterfaces().getPosition();
      Point pixel = visualizer.transformPositionToPixel(pos);

      int x = pixel.x - 2*Visualizer.MOTE_RADIUS;
     
      int y = pixel.y - Visualizer.MOTE_RADIUS;
      g.setColor(Color.RED);
      if (leds.isRedOn()) {
        g.fillRect(x, y, 7, 4);
      } else {
        g.drawRect(x, y, 7, 4);
      }

      y += 6;
      g.setColor(Color.GREEN);
      if (leds.isGreenOn()) {
        g.fillRect(x, y, 7, 4);
      } else {
        g.drawRect(x, y, 7, 4);
      }

      y += 6;
      g.setColor(Color.BLUE);
      if (leds.isYellowOn()) {
        g.fillRect(x, y, 7, 4);
      } else {
        g.drawRect(x, y, 7, 4);
      }
    }
View Full Code Here

Examples of sw_digitalworks.Model.LED

//        Set<InPort> inports = new HashSet<InPort>();
//        Set<OutPort> outports = new HashSet<OutPort>();

        // TODO code application logic here
        //LEDList leds = new LEDList();
        ComponentModel.leds.add(new LED("LED 1"));
       ComponentModel.leds.add(new LED("LED 2"));
//        inports.add(leds.getByName("LED 1").getInPort());
//        inports.add(leds.getByName("LED 1").getInPort());
//        ComponentModel.add(leds.getByName("LED 2"));
        InteractiveInput ip1 = new InteractiveInput("IP 1");
        InteractiveInput ip2 = new InteractiveInput("IP 2");
View Full Code Here

Examples of sw_digitalworks.Model.LED

    /**
     * LED létrehozása a led parancs hatására ezzel a függvénnyel történik
     */
    private void createLED() {
        if (param1.equals("") && param2.equals("")) {
            LED led = new LED();
            Main.controller.getDisplayView().addComponentView(new LEDView(getPosX(param1), getPosY(param1), led));
            System.out.println(led.getName() + " CREATED.");
            output += led.getName() + " CREATED.\n";
            //Prototype.PrintStateAfterUpdate(led);


        } else if (Pattern.matches("\\(\\d{1,4}\\,\\d{1,4}\\)", param1) && param2.equals("") && param3.equals("")) {
            LED led = new LED();
            Main.controller.getDisplayView().addComponentView(new LEDView(getPosX(param1), getPosY(param1), led));
            System.out.println(led.getName() + " CREATED.");
            output += led.getName() + " CREATED.\n";


        } else {
            System.out.println("Bad command for creating led. Try led");
            output += "Bad command for creating led. Try led\n";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.