@Override public void onStart() { super.onStart(); if (DEBUG) Log.d(TAG, "onStart()"); connectTouch(); SeekBar altitudeBar = (SeekBar) getActivity().findViewById(R.id.altitude_slider); if (altitudeBar != null) altitudeBar.setOnSeekBarChangeListener( new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { UAVObject desired = objMngr.getObject("PathDesired"); if (desired != null) { if (DEBUG) Log.d(TAG, "Updating path desired"); desired.getField("End").setDouble(-progress, 2); desired.updated(); if (uav != null) uav.invalidate(); } } @Override public void onStartTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } @Override public void onStopTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } }); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); return inflater.inflate(R.layout.map_positioner, container, false); }
@Override public void onResume() { super.onResume(); resumed = true; init(); }
@Override public void onConnected(UAVObjectManager objMngr) { super.onConnected(objMngr); connected = true; init(); }
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString("org.taulabs.androidgcs.ObjectName", objectName); outState.putLong("org.taulabs.androidgcs.ObjectId", objectID); outState.putLong("org.taulabs.androidgcs.InstId", instID); outState.putBoolean("org.taulabs.androidgcs.updated", updated); }
@Override public void onOPConnected(UAVObjectManager objMngr) { super.onOPConnected(objMngr); if (DEBUG) Log.d(TAG, "On connected"); UAVObject obj = objMngr.getObject("PositionActual"); if (obj != null) registerObjectUpdates(obj); objectUpdated(obj); obj = objMngr.getObject("PathDesired"); if (obj != null) registerObjectUpdates(obj); objectUpdated(obj); }
@Override public void onDisconnected() { super.onDisconnected(); connected = false; }