Package jaron.components

Examples of jaron.components.Signal


   * @param key         a string that identifies the FG ouput data
   * @param listener    the listener to be added
   * @see SignalListener
   */
  public void addSignalListener(String key, SignalListener listener) {
    Signal signal = signals.get(key);
    if (signal == null) signal = new Signal();
    signal.addSignalListener(listener);
    signals.put(key, signal);
  }
View Full Code Here


          // a hack to prevalidate the xml code (against timing issues)
          if(s.matches("<\\?xml.*</data>")) {
            if (parser.parse(s)) {
              // fire the signal update events
              for (String key : signals.keySet()) {
                Signal signal = signals.get(key);
                signal.setValue(parser.getDouble(key));
              }
              if (debug) System.out.println("FlightGearReceiver::run(): Data published");
            }
          }
          else {
View Full Code Here

   */
  public void addGraph(String label, int color) {
    GraphData graph = new GraphData();
    graph.color = color;
    graph.label = label;
    graph.signal = new Signal();
    graph.data = new double[(int )content.getWidth()];
    graphs.put(label, graph);

    setLabelBottomHeight((graphs.size() * Fonts.LINE_HEIGHT) + Fonts.LINE_SPACING);
  }
View Full Code Here

   */
  public Signal createGraph(String label, int color) {
    GraphData graph = new GraphData();
    graph.color = color;
    graph.label = label;
    graph.signal = new Signal();
    graph.data = new double[(int )content.getWidth()];
    graphs.put(label, graph);

    setLabelBottomHeight((graphs.size() * Fonts.LINE_HEIGHT) + Fonts.LINE_SPACING);
   
View Full Code Here

    applet.pushMatrix();
    applet.translate(content.getLeft(), content.getTop());
    applet.fill(Colors.TEXT);
    int y = Fonts.LINE_HEIGHT;
    for (String key : lines.keySet()) {
      Signal line = lines.get(key);
      applet.textFont(Fonts.getFontBold(applet), Fonts.FONT_SIZE);
      applet.textAlign(PApplet.LEFT);
      applet.text(key, Fonts.LINE_SPACING, y);
      applet.textFont(Fonts.getFontPlain(applet), Fonts.FONT_SIZE);
      applet.textAlign(PApplet.RIGHT);
      applet.text(String.format("%1.2f", line.getValue()), (int )content.getWidth() - Fonts.LINE_SPACING, y);
      y += Fonts.LINE_HEIGHT;
    }
    applet.popMatrix();

    // restore the graphics environment
View Full Code Here

  
   * @param   label the label of the line's value
   * @return  a new <code>Signal</code> object representing a line's value
   */
  public Signal createTextLine(String label) {
    Signal line = new Signal();
    lines.put(label, line);
    return line;
  }
View Full Code Here

   * @param width     the component's width
   */
  public ArtificialHorizon(PApplet applet, int left, int top, int width, int height) {
    super(left, top, width, height);
    this.applet = applet;
    roll = new Signal();
    roll.setValue(0F);
    pitch = new Signal();
    pitch.setValue(0F);
    elevator = new Signal();
    aileron = new Signal();
    elevator.setValue(0F);
    aileron.setValue(0F);
  }
View Full Code Here

   */
  public FlightGearSender(String ip, int port) {
    this.targetAddress = ip;
    this.targetPort = port;

    elevator = new Signal();
    aileron = new Signal();
    rudder = new Signal();
    throttle = new Signal();

    // start polling the server
    new Thread() {
      @Override public void run() {
        while (true) {
View Full Code Here

    super();
    this.start = start;
    this.path = path;
   
    // the hook for switching the axis on and off
    power = new Signal();
    power.setBandwidth(0, 1);
    power.setValue(power.getHigh())// default is on

    setBandwidth(-1, 1);
    setValue(0);
View Full Code Here

    setBandwidthY(-1, 1);
    setValueX(0);
    setValueY(0);

    // the power signal is used to switch the actuator on and off
    power = new Signal();
    power.setBandwidth(0, 1);
    power.setValue(power.getHigh())// default is on
    // hook the axis to the power signal
    power.addSignalListener(axisX.getPowerSignal());
    power.addSignalListener(axisY.getPowerSignal());
View Full Code Here

TOP

Related Classes of jaron.components.Signal

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.