Skip to content
Snippets Groups Projects
Commit d37c1264 authored by Xavier Gibert's avatar Xavier Gibert
Browse files

Main branch commits merged here

parent 36819c5c
No related branches found
Tags STAVOR_v1.0.6
No related merge requests found
......@@ -337,6 +337,7 @@ public final class HudFragment extends Fragment {
@Override
public void onDetach() {
((MainActivity)getActivity()).resetBrowserProgressBar();
simulator.clearHud();
//XWalk
if (mXwalkView != null) {
//mXwalkView.onDestroy();
......
......@@ -169,6 +169,7 @@ public final class OrbitFragment extends Fragment {
@Override
public void onDetach() {
((MainActivity)getActivity()).resetBrowserProgressBarOrbit();
simulator.clearHud();
//XWalk
if (mXwalkView != null) {
//mXwalkView.onDestroy();
......
package cs.si.stavor.model;
public enum Browsers {
Attitude, Orbit;
None, Attitude, Orbit;
}
......@@ -39,7 +39,7 @@ public class ModelSimulation {
private View view;
private XWalkView browser;
private boolean isBrowserLoaded;
private Browsers selectedBrowser = Browsers.Attitude;
private Browsers selectedBrowser = Browsers.None;
public ModelSimulation(MainActivity acv){
isBrowserLoaded = false;
......@@ -88,6 +88,13 @@ public class ModelSimulation {
browser = mBrowser;
}
public void clearHud(){
selectedBrowser = Browsers.None;
view = null;
uninitViews();
browser = null;
}
/**
* Set the loaded status of the browser
* @param is
......@@ -110,14 +117,6 @@ public class ModelSimulation {
return gson.toJson(config_orbit);
}
/**
* Returns the simulation step for the WebGL model in a JavaScript readable format
* @return
*/
/*public synchronized String getStateJSON() {
return gson.toJson(state);
}*/
/**
* Method used by the simulator to update the simulation state.
* It triggers the update of the Java UI HUD parameters.
......@@ -237,14 +236,11 @@ public class ModelSimulation {
AbsoluteDate date = scs.getAttitude().getDate();
try {
//Frame fix_frame = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
//Frame fix_frame = FramesFactory.getITRF2008(true);
Rotation rot = scs.getFrame().getTransformTo(earthFixedFrame, date).getRotation();
new_state.value_earth_rotation = new Quat(rot);
} catch (OrekitException e) {
e.printStackTrace();
}
//XGGDEBUG: correct values
Vector3D spacecraft = scs.getPVCoordinates().getPosition();
new_state.value_spacecraft[0] = spacecraft.getX();
......
......@@ -137,6 +137,10 @@ public class Simulator {
simulation.setHud(type, v,x);
}
public void clearHud(){
simulation.clearHud();
}
public void setBrowserLoaded(boolean is){
simulation.setBrowserloaded(is);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment