Package zephyropen.command

Examples of zephyropen.command.Command


           
            /** test the input */
            if( valid(input, sendersIp) ) { 
             
               /** build a command and dispatch it to the API */
              Command command = xmlParser.parse(input);
             
              /** dispatch the command */
              CommandDispatcher.dispatch(command);  
                 
            }
View Full Code Here


   */
  public HxmDevice(String deviceName) {
   
    port = new SearchSPP(deviceName);
   
    command = new Command(PrototypeFactory.hxm);
   
    command.add(ZephyrOpen.deviceName, getDeviceName());
  }
View Full Code Here

            /** loop forever, waiting to receive packets */
            double j = 0;
            double i = 0;
            double y = 45;
            double peroid = 0.1;
            Command feedback = null;
            Random rand = new Random();
            while (true) {

                j += peroid;
                i = (float) ((float) (Math.sin(j) * y) + y);
                // i = (float) ((float)(Math.cos(j + rand.nextDouble()) * y) + y)+1; 

                i += rand.nextDouble() * 5;

                feedback = WiiUtils.create(i, i, i, i);
                feedback.send();

                System.out.println(feedback.toString());
                Utils.delay(500);

            }
        } catch (Exception e) {
            constants.shutdown(e);
View Full Code Here

   * Fill an XML command from an OSC message
   *
   * @return the XML command object
   */
  public static Command create(String mote, double acc, double p, double r, double y) {
    Command command = new Command(PrototypeFactory.wii);
    command.add(PrototypeFactory.mote, mote);
    command.add(PrototypeFactory.pitch, Utils.formatFloat(p, ZephyrOpen.PRECISION));
    command.add(PrototypeFactory.roll, Utils.formatFloat(r, ZephyrOpen.PRECISION));
    command.add(PrototypeFactory.yaw, Utils.formatFloat(y, ZephyrOpen.PRECISION));
    command.add(PrototypeFactory.accel, Utils.formatFloat(acc, ZephyrOpen.PRECISION));
    return command;
  }
View Full Code Here

        if (xml == null || xml.equals(""))
            return null;

        // send back  command object
        Command command = null;

        try {

            // find the outer most tag
            // the '<type>' of xml command  
            String type = getType(xml);
            if (type != null) {

                command = new Command(type);

                // cut out outer most 'type' tags 
                xml = removeOuterElementTags(xml);

            } else {

                // make a default, no-name command 
                command = new Command();
            }

            // parse the xml fragment
            for (;;) {

                /* end of parse? */
                if (xml.length() <= 0)
                    break;

                /* parse the element name and value */
                String elementName = getType(xml);
                String elementValue = get(elementName, xml);

                /* add the name/value pair to the command */
                command.add(elementName, elementValue);

                /* remove the parsed element from the xml fragment */
                xml = removeElement(elementName, xml);

            }
View Full Code Here

    try {

      freader = new FileReader(file);
      lnreader = new LineNumberReader(freader);
      String line = "";
      Command command;

      long start = System.currentTimeMillis();
      while ((line = lnreader.readLine()) != null) {
        command = xmlParser.parse(line);
        if (command != null) {
View Full Code Here

TOP

Related Classes of zephyropen.command.Command

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.