Package com.grt192.utils

Examples of com.grt192.utils.GRTFileIO


                                this.halt();
                        }
                        for(int i=0; i<actuatorCommandListeners.size(); i++){
                            ((ActuatorCommandListener)
                                actuatorCommandListeners.elementAt(i)).commandDidComplete(
                                           new ActuatorEvent(this,
                                           ActuatorEvent.COMMAND_COMPLETE,
                                           this.current));
                        }
                       
                    }
                }
                //minimum loop sleep
                sleep(SLEEP_INTERVAL);
            }catch(Exception e){
                //On exception kill this actuator, as it is
                //unsafe to continue operation
                for(int i=0; i<actuatorCommandListeners.size(); i++){
                    ((ActuatorCommandListener)
                        actuatorCommandListeners.elementAt(i)).commandDidComplete(
                                           new ActuatorEvent(this,
                                           ActuatorEvent.COMMAND_FAILED,
                                           this.current));
                }
                e.printStackTrace();
                stopActuator();
View Full Code Here


                                this.halt();
                        }
                        for(int i=0; i<actuatorCommandListeners.size(); i++){
                            ((ActuatorCommandListener)
                                actuatorCommandListeners.elementAt(i)).commandDidComplete(
                                           new ActuatorEvent(this,
                                           ActuatorEvent.COMMAND_COMPLETE,
                                           this.current));
                        }
                       
                    }
                }
                //minimum loop sleep
                sleep(SLEEP_INTERVAL);
            }catch(Exception e){
                //On exception kill this actuator, as it is
                //unsafe to continue operation
                for(int i=0; i<actuatorCommandListeners.size(); i++){
                    ((ActuatorCommandListener)
                        actuatorCommandListeners.elementAt(i)).commandDidComplete(
                                           new ActuatorEvent(this,
                                           ActuatorEvent.COMMAND_FAILED,
                                           this.current));
                }
                e.printStackTrace();
                stopActuator();
View Full Code Here

        }
    }

    protected void notifyGlobalListeners(String key) {
        for (int i = 0; i < globalListeners.size(); i++) {
            ((GlobalListener) globalListeners.elementAt(i)).globalChanged(new GlobalEvent(GlobalEvent.DEFAULT, key,
                    globals));
        }
    }
View Full Code Here

        }
    }

    protected void notifyGlobalListeners(String key) {
        for (int i = 0; i < globalListeners.size(); i++) {
            ((GlobalListener) globalListeners.elementAt(i)).globalChanged(new GlobalEvent(GlobalEvent.DEFAULT, key,
                    globals));
        }
    }
View Full Code Here

    private void notifyButtonListeners(String button, double previousState) {
        for (int i = 0; i < buttonListeners.size(); i++) {
            if (getState(button) == TRUE && getState(button) != previousState) {
                ((ButtonListener) buttonListeners.elementAt(i)).buttonDown(
                        new SensorEvent(this,
                        SensorEvent.DATA_AVAILABLE,
                        this.state), button);
            } else if (getState(button) != TRUE && getState(button) != previousState) {
                ((ButtonListener) buttonListeners.elementAt(i)).buttonUp(
                        new SensorEvent(this,
                        SensorEvent.DATA_AVAILABLE,
                        this.state),
                        button);
            }
        }
View Full Code Here

  }

  protected void notifyDataListeners() {
    for (int i = 0; i < sensorDataListeners.size(); i++) {
      ((SensorDataListener) sensorDataListeners.elementAt(i))
          .didRecieveData(new SensorEvent(this,
              SensorEvent.DATA_AVAILABLE, this.state));
    }
  }
View Full Code Here

  protected void notifySensorChangeListeners(String key, double previousState) {
    for (int i = 0; i < sensorChangeListeners.size(); i++) {
      if (getState(key) != previousState) {
        ((SensorChangeListener) sensorChangeListeners.elementAt(i))
            .sensorStateChanged(new SensorEvent(this,
                SensorEvent.DATA_AVAILABLE, this.state), key);
      }
    }
  }
View Full Code Here

  }

  protected void notifyAccelerometerSpike(int axis, double value) {
    for (int i = 0; i < accelerometerListeners.size(); i++) {
      ((ADXL345Listener) accelerometerListeners.elementAt(i))
          .didAccelerationSpike(new ADXL345Event(this, axis, value));
    }
  }
View Full Code Here

  }

  protected void notifyAccelerometerChange(int axis, double value) {
    for (int i = 0; i < accelerometerListeners.size(); i++) {
      ((ADXL345Listener) accelerometerListeners.elementAt(i))
          .didAccelerationChange(new ADXL345Event(this, axis, value));
    }
  }
View Full Code Here

  }

  protected void notifyADXL345Listeners(int axis, double value) {
    for (int i = 0; i < accelerometerListeners.size(); i++) {
      ((ADXL345Listener) accelerometerListeners.elementAt(i))
          .didReceiveAcceleration(new ADXL345Event(this, axis, value));
    }
  }
View Full Code Here

TOP

Related Classes of com.grt192.utils.GRTFileIO

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.