@Override public void startLiveWindowMode() { m_tableListener = new ITableListener() { @Override public void valueChanged(ITable itable, String key, Object value, boolean bln) { String val = ((String) value); if (val.equals("Off")) { set(Value.kOff); } else if (val.equals("On")) { set(Value.kOn); } else if (val.equals("Forward")) { set(Value.kForward); } else if (val.equals("Reverse")) { set(Value.kReverse); } } }; m_table.addTableListener("Value", m_tableListener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { set(Value.kOff); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { // TODO: this is bad also if (value.toString().equals("Reverse")) set(Value.kReverse); else if (value.toString().equals("Forward")) set(Value.kForward); else set(Value.kOff); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * Creates an ITableListener for the LiveWindow table for this CAN speed * controller. */ public default ITableListener createTableListener() { return (table, key, value, isNew) -> { switch(key) { case "Enabled": if ((Boolean) value) { enable(); } else { disable(); } break; case "Value": set((Double) value); break; case "Mode": setControlMode(((Double) value).intValue()); break; } if(getControlMode().isPID()) { switch(key) { case "p": setP((Double) value); break; case "i": setI((Double) value); break; case "d": setD((Double) value); break; case "f": setF((Double) value); break; } } }; }
/** * {@inheritDoc} */ @Override public void startLiveWindowMode() { m_table_listener = new ITableListener() { @Override public void valueChanged(ITable itable, String key, Object value, boolean bln) { String val = ((String) value); if (val.equals("Off")) { set(Value.kOff); } else if (val.equals("On")) { set(Value.kOn); } else if (val.equals("Forward")) { set(Value.kForward); } else if (val.equals("Reverse")) { set(Value.kReverse); } } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { set(Value.kOff); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { //TODO: this is bad also if (value.toString().equals("Reverse")) set(Value.kReverse); else if (value.toString().equals("Forward")) set(Value.kForward); else set(Value.kOff); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { String val = ((String) value); if (val.equals("Off")) { set(Value.kOff); } else if (val.equals("Forward")) { set(Value.kForward); } else if (val.equals("Reverse")) { set(Value.kReverse); } } }; m_table.addTableListener("Value", m_table_listener, true); }
private static void initCatcherTable(){ m_table.putBoolean(NETTABLE_CATCHER_CATCHER_STATE, m_solenoidCatcher.get()); m_table.putBoolean(NETTABLE_CATCHER_FLIPPER_STATE, m_solenoidFlipper.get()); m_table.putNumber(NETTABLE_CATCHER_SPINDLE_SCALE, m_spindleScale); m_tableListener = new ITableListener(){ public void valueChanged(ITable table, String key, Object value, boolean isNew){ if(key.equals(NETTABLE_CATCHER_CATCHER_STATE)){ m_solenoidCatcher.set(((Boolean)value).booleanValue()); }else if(key.equals(NETTABLE_CATCHER_FLIPPER_STATE)){ m_solenoidFlipper.set(((Boolean)value).booleanValue()); }else if(key.equals(NETTABLE_CATCHER_SPINDLE_SCALE)){ setSpindleScale(((Double)value).doubleValue()); } } }; m_table.addTableListener(m_tableListener, true); }
private static void initDriveTable(){ m_table.putNumber(NETTABLE_DRIVETRAIN_DRIVEMODE, DriveMode.ARCADE.getMode()); m_table.putString(NETTABLE_DRIVETRAIN_DRIVEMODE_STRING, DriveMode.ARCADE.toString()); m_table.putBoolean(NETTABLE_DRIVETRAIN_SOLENOID, DriveMode.ARCADE.getSolenoid()); m_table.putString(NETTABLE_DRIVETRAIN_DEFAULT_COMMAND, DriveMode.ARCADE.getCommand().getName()); m_table.putNumber(NETTABLE_DRIVETRAIN_SCALE, m_scale); m_tableListener = new ITableListener(){ public void valueChanged(ITable table, String key, Object value, boolean isNew){ if(key.equalsIgnoreCase(NETTABLE_DRIVETRAIN_DRIVEMODE)){ new C_ChangeDrivemode(table.getNumber(NETTABLE_DRIVETRAIN_DRIVEMODE)).start(); }else if(key.equals(NETTABLE_DRIVETRAIN_SCALE)){ m_scale = table.getNumber(NETTABLE_DRIVETRAIN_SCALE); } } }; m_table.addTableListener(m_tableListener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { set(Value.kOff); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { System.out.println(key+": "+value); //TODO: this is bad also if (value.toString().equals("Reverse")) set(Value.kReverse); else if (value.toString().equals("Forward")) set(Value.kForward); else set(Value.kOff); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { System.out.println(key+": "+value); String val = ((String) value); if (val.equals("Off")) { set(Value.kOff); } else if (val.equals("Forward")) { set(Value.kForward); } else if (val.equals("Reverse")) { set(Value.kReverse); } } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ @Override public void startLiveWindowMode() { stopMotor(); // Stop for safety m_table_listener = new ITableListener() { @Override public void valueChanged(ITable itable, String key, Object value, boolean bln) { set(((Double) value).doubleValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
private void initializeTrajectoryListener() { ITable mTable = NetworkTable.getTable(SmartDashBoardNames.sSPLINE_NAMESPACE); ITableListener idealSplineListener = new ITableListener() { @Override public void valueChanged(ITable arg0, String arg1, Object arg2, boolean arg3) { mCoordinateGui.setPath(IdealSplineSerializer.deserializePath(arg2.toString())); } }; mTable.addTableListener(SmartDashBoardNames.sSPLINE_IDEAL_POINTS, idealSplineListener, true); }
@Override public void startLiveWindowMode() { m_tableListener = new ITableListener() { @Override public void valueChanged(ITable itable, String key, Object value, boolean bln) { set((Boolean) value); } }; m_table.addTableListener("Value", m_tableListener, true); }
@Override public void startLiveWindowMode() { setSpeed(0); // Stop for safety m_tableListener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { setSpeed((Double) value); } }; m_table.addTableListener("Value", m_tableListener, true); }
/** * Creates an ITableListener for the LiveWindow table for this CAN speed controller. */ default ITableListener createTableListener() { return (table, key, value, isNew) -> { switch (key) { case "Enabled": if ((Boolean) value) { enable(); } else { disable(); } break; case "Value": set((Double) value); break; case "Mode": setControlMode(((Double) value).intValue()); break; default: break; } if (getControlMode().isPID()) { switch (key) { case "p": setP((Double) value); break; case "i": setI((Double) value); break; case "d": setD((Double) value); break; case "f": setF((Double) value); break; default: break; } } }; }
@Override public void startLiveWindowMode() { m_tableListener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { set(((Double) value).doubleValue()); } }; m_table.addTableListener("Value", m_tableListener, true); }
/** * {@inheritDoc} */ @Override public void startLiveWindowMode() { m_table_listener = new ITableListener() { @Override public void valueChanged(ITable itable, String key, Object value, boolean bln) { set(((Boolean) value).booleanValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { setSpeed(0); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { setSpeed(((Double) value).doubleValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { set(false); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { set(((Boolean) value).booleanValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { set(((Double) value).doubleValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
@Override public void addTableListener(ITableListener listener, boolean immediateNotify) { if (immediateNotify) { for (String key : getKeys()) { listener.valueChanged(this, key, getValue(key), false); } } addTableListener(listener); }
@Override public void addTableListener(String key, ITableListener listener, boolean immediateNotify) { if (immediateNotify) { listener.valueChanged(this, key, getValue(key), false); } listeners.computeIfAbsent(key, k -> new ArrayList<>()).add(listener); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { set(((Boolean) value).booleanValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { set(0); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { set(((Double) value).doubleValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
private static void initLauncherTable(){ m_table.putBoolean(NETTABLE_LAUNCHER_READY, isPreped()); m_tableListener = new ITableListener(){ public void valueChanged(ITable table, String key, Object value, boolean isNew){ } }; m_table.addTableListener(m_tableListener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { System.out.println(key+": "+value); set(((Boolean) value).booleanValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { set(false); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { System.out.println(key+": "+value); set(((Boolean) value).booleanValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { set(0); // Stop for safety m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { System.out.println(key+": "+value); set(((Double) value).doubleValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
/** * {@inheritDoc} */ public void startLiveWindowMode() { m_table_listener = new ITableListener() { public void valueChanged(ITable itable, String key, Object value, boolean bln) { System.out.println(key+": "+value); set(((Double) value).doubleValue()); } }; m_table.addTableListener("Value", m_table_listener, true); }
public void addChangeListener(ITableListener aListener) { mSendableChooser.getTable().addTableListener(aListener); }
public void addChangeListener(ITableListener aListener) { mPickPoint.getTable().addTableListener(aListener); }
public void addChangeListener(ITableListener aListener) { mDefenseInFront.getTable().addTableListener(aListener); }
@Override public void addTableListener(ITableListener listener) { listeners.computeIfAbsent("", k -> new ArrayList<>()).add(listener); }