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

3rd mission example in default missions

parent e397c4da
No related branches found
No related tags found
No related merge requests found
......@@ -205,6 +205,34 @@ public class Installer {
e.printStackTrace();
}
// Insert the new row, returning the primary key value of the new row
newRowId = db.insert(
MissionEntry.TABLE_NAME,
null,
values);
if(newRowId==-1)
result=false;
//Third Example
mission = new Mission();
mission.name="Example LEO-Polar";
mission.description="polar LEO mission example";
mission.initial_orbit.a=7.0E6;
mission.initial_orbit.e=0.0;
mission.initial_orbit.i=1.57;
mission.initial_orbit.raan=0.0;
mission.sim_duration=100000.0;
mission.sim_step=10.0;
values = new ContentValues();
values.put(MissionEntry.COLUMN_NAME_NAME, mission.name);
values.put(MissionEntry.COLUMN_NAME_DESCRIPTION, mission.description);
try {
values.put(MissionEntry.COLUMN_NAME_CLASS, SerializationUtil.serialize(mission));
} catch (IOException e) {
e.printStackTrace();
}
// Insert the new row, returning the primary key value of the new row
newRowId = db.insert(
MissionEntry.TABLE_NAME,
......
......@@ -174,7 +174,7 @@ public final class SimulatorFragment extends Fragment implements LoaderCallbacks
public void onClick(View arg0) {
if(activeMissionId==-1){
Toast.makeText(getActivity().getApplicationContext(), getString(R.string.sim_local_select_first_a_mission), Toast.LENGTH_LONG).show();
}else if (activeMissionId==0 ||activeMissionId==1 ||activeMissionId==2 ){
}else if (activeMissionId==0 ||activeMissionId==1 ||activeMissionId==2 || activeMissionId==3 ){
Toast.makeText(getActivity().getApplicationContext(), getString(R.string.sim_local_mission_not_removable), Toast.LENGTH_LONG).show();
}else{
showDeleteMissionDialog(activeMissionId, activeMissionName);
......@@ -200,7 +200,7 @@ public final class SimulatorFragment extends Fragment implements LoaderCallbacks
public void onClick(View arg0) {
if(activeMissionId==-1){
Toast.makeText(getActivity().getApplicationContext(), getString(R.string.sim_local_select_first_a_mission), Toast.LENGTH_LONG).show();
}else if (activeMissionId==0 ||activeMissionId==1 ||activeMissionId==2 ){
}else if (activeMissionId==0 ||activeMissionId==1 ||activeMissionId==2 ||activeMissionId==3){
Toast.makeText(getActivity().getApplicationContext(), getString(R.string.sim_local_mission_not_editable), Toast.LENGTH_LONG).show();
}else{
MissionAndId mis = getSelectedMission();
......
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