Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Stavor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
Stavor
Commits
4992c225
Commit
4992c225
authored
10 years ago
by
Xavier Gibert
Browse files
Options
Downloads
Patches
Plain Diff
Clean TODOs
parent
77f83e4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cs/si/stavor/MainActivity.java
+3
-134
3 additions, 134 deletions
src/cs/si/stavor/MainActivity.java
src/cs/si/stavor/MissionActivity.java
+0
-2
0 additions, 2 deletions
src/cs/si/stavor/MissionActivity.java
src/cs/si/stavor/app/Installer.java
+0
-4
0 additions, 4 deletions
src/cs/si/stavor/app/Installer.java
with
3 additions
and
140 deletions
src/cs/si/stavor/MainActivity.java
+
3
−
134
View file @
4992c225
...
...
@@ -214,80 +214,6 @@ public class MainActivity extends ActionBarActivity implements
setContentView
(
R
.
layout
.
activity_main
);
//setProgressBarVisibility(true);
/* end of file server
server = new WebServer();
try {
server.start();
} catch(IOException ioe) {
Log.w("Httpd", "The server could not start.");
}
Log.w("Httpd", "Web server initialized.");
*/
// Setup a new instance
/*HttpServer server = new HttpServer();
server.addRequestHandler(new HttpRequestHandler() {
@Override
public HttpResponse handleRequest(HttpRequest request) {
String documentRoot = "www/orbit";
//String documentRootPath = null;
String uri = request.getUri();
InputStream iStream = null;
try {
uri = URLDecoder.decode(uri, "UTF-8");
} catch (UnsupportedEncodingException e1) {
uri = uri.replace("%20", " ");
}
if(uri.equals("/"))
uri = "/index.html";
try {
System.out.println("GET: "+documentRoot+uri);
iStream = getAssets().open(documentRoot+uri);
//File file = new File(iStream);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}*/
//File file = new File(documentRoot, uri);
/*if (file.exists() && !file.isDirectory()) {
try {
if (documentRootPath == null) {
documentRootPath = documentRoot.getAbsolutePath();
if (documentRootPath.endsWith("/") || documentRootPath.endsWith(".")) {
documentRootPath = documentRootPath.substring(0, documentRootPath.length() - 1);
}
}
String requestPath = file.getCanonicalPath();
if (requestPath.endsWith("/")) {
requestPath = requestPath.substring(0, requestPath.length() - 1);
}
if (!requestPath.startsWith(documentRootPath)) {
return new HttpResponse(HttpStatus.BAD_REQUEST, HttpStatus.BAD_REQUEST.toString());
}
} catch (IOException e) {
return new HttpResponse(HttpStatus.INTERNAL_SERVER_ERROR, HttpStatus.INTERNAL_SERVER_ERROR.toString());
}*/
/*try {
HttpResponse res = new HttpResponse(HttpStatus.OK, iStream);
res.setResponseLength(iStream.available());
return res;
} catch (IOException e) {
e.printStackTrace();
}
//}
return null;
}
});*/
// Bind it to port 8081
/*try {
server.bind(8080);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}*/
// Start the server thread
//server.start();
// find the retained fragment on activity restarts
FragmentManager
fm
=
getFragmentManager
();
dataFragment
=
(
RetainedFragment
)
fm
.
findFragmentByTag
(
"data"
);
...
...
@@ -508,6 +434,9 @@ public class MainActivity extends ActionBarActivity implements
case
9
:
mTitle
=
getString
(
R
.
string
.
title_section9
);
break
;
case
10
:
mTitle
=
getString
(
R
.
string
.
title_section10
);
break
;
}
}
...
...
@@ -790,64 +719,4 @@ public class MainActivity extends ActionBarActivity implements
public
void
setHudPanelOpen
(
boolean
open
){
hud_panel_open
=
open
;
}
/*
private class WebServer extends NanoHTTPD {
public static final String MIME_JAVASCRIPT = "text/javascript";
public static final String MIME_CSS = "text/css";
public static final String MIME_JPEG = "image/jpeg";
public static final String MIME_PNG = "image/png";
public static final String MIME_SVG = "image/svg+xml";
public static final String MIME_JSON = "application/json";
public WebServer() {
super(8081);
}
@Override public Response serve(IHTTPSession session) {
String mime_type = NanoHTTPD.MIME_HTML;
Method method = session.getMethod();
String uri = session.getUri();
System.out.println(method + " '" + uri + "' ");
InputStream descriptor = null;
if(method.toString().equalsIgnoreCase("GET")){
String path;
if(uri.equals("/")){
path="/index.html";
}else{
path = uri;
try{
if(path.endsWith(".js")){
mime_type = MIME_JAVASCRIPT;
}else if(path.endsWith(".css")){
mime_type = MIME_CSS;
}else if(path.endsWith(".html")){
mime_type = MIME_HTML;
}else if(path.endsWith(".jpeg")){
mime_type = MIME_JPEG;
}else if(path.endsWith(".png")){
mime_type = MIME_PNG;
}else if(path.endsWith(".jpg")){
mime_type = MIME_JPEG;
}else if(path.endsWith(".svg")){
mime_type = MIME_SVG;
}else if(path.endsWith(".json")){
mime_type = MIME_JSON;
}
}catch(Exception e){
}
}
try {
// Open file from SD Card
descriptor = getAssets().open("www/attitude"+path);
} catch(IOException ioe) {
Log.w("Httpd", ioe.toString());
}
}
return new NanoHTTPD.Response( Response.Status.OK,mime_type,descriptor);
}
}*/
}
This diff is collapsed.
Click to expand it.
src/cs/si/stavor/MissionActivity.java
+
0
−
2
View file @
4992c225
...
...
@@ -29,7 +29,6 @@ import android.widget.Switch;
import
android.widget.TextView
;
import
android.widget.TimePicker
;
import
android.widget.Toast
;
import
android.widget.ViewSwitcher
;
import
android.widget.CompoundButton.OnCheckedChangeListener
;
/**
...
...
@@ -71,7 +70,6 @@ public class MissionActivity extends Activity{
try
{
utc
=
TimeScalesFactory
.
getUTC
();
}
catch
(
OrekitException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
onBackPressed
();
}
...
...
This diff is collapsed.
Click to expand it.
src/cs/si/stavor/app/Installer.java
+
0
−
4
View file @
4992c225
...
...
@@ -203,10 +203,8 @@ public class Installer {
try
{
mission
.
initial_date
=
new
AbsoluteDate
(
2008
,
7
,
4
,
0
,
0
,
0.0
,
TimeScalesFactory
.
getUTC
());
}
catch
(
IllegalArgumentException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
catch
(
OrekitException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
...
...
@@ -240,10 +238,8 @@ public class Installer {
try
{
mission
.
initial_date
=
new
AbsoluteDate
(
2008
,
1
,
3
,
0
,
0
,
0.0
,
TimeScalesFactory
.
getUTC
());
}
catch
(
IllegalArgumentException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
catch
(
OrekitException
e1
)
{
// TODO Auto-generated catch block
e1
.
printStackTrace
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment