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
7f5ecf28
Commit
7f5ecf28
authored
10 years ago
by
Xavier Gibert
Browse files
Options
Downloads
Patches
Plain Diff
BugFix of S/C view, lookAt center
parent
b44aa912
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/www/update.js
+5
-2
5 additions, 2 deletions
assets/www/update.js
src/simulator/SocketsThread.java
+0
-23
0 additions, 23 deletions
src/simulator/SocketsThread.java
with
5 additions
and
25 deletions
assets/www/update.js
+
5
−
2
View file @
7f5ecf28
...
...
@@ -11,6 +11,7 @@ function update()
}
else
{
controls
.
update
();
}
camera
.
lookAt
(
scene
.
position
);
//Ligts
light
.
position
.
set
(
camera
.
position
.
x
,
camera
.
position
.
y
,
camera
.
position
.
z
);
...
...
@@ -39,9 +40,11 @@ function update()
// SPACECRAFT UPDATE
//-----------------------------------------------------------------------------------------------------------------------
//if(show_spacecraft){
spacecraft
.
quaternion
.
copy
(
value_attitude
);
/*
spacecraft.quaternion.copy(value_attitude);
spacecraft.matrixWorldNeedsUpdate = true;
spacecraft
.
updateMatrix
();
spacecraft.updateMatrix();*/
spacecraft
.
rotation
.
x
+=
0.01
;
spacecraft
.
rotation
.
y
+=
0.01
;
//}
//-----------------------------------------------------------------------------------------------------------------------
// SUN UPDATE
...
...
This diff is collapsed.
Click to expand it.
src/simulator/SocketsThread.java
+
0
−
23
View file @
7f5ecf28
...
...
@@ -36,7 +36,6 @@ public class SocketsThread extends AsyncTask<ModelSimulation, Void, Boolean>{
try
{
socket
.
close
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
...
...
@@ -46,25 +45,19 @@ public class SocketsThread extends AsyncTask<ModelSimulation, Void, Boolean>{
protected
Boolean
doInBackground
(
ModelSimulation
...
params
)
{
if
(
simulator
.
getSimulatorStatus
().
equals
(
SimulatorStatus
.
Disconnected
)){
Log
.
d
(
"Sim"
,
System
.
currentTimeMillis
()+
": "
+
"simulator connecting socket"
);
try
{
//socket = new Socket(dstAddress, dstPort);
socket
=
new
Socket
();
socket
.
connect
(
new
InetSocketAddress
(
dstAddress
,
dstPort
),
Parameters
.
Simulator
.
remote_connection_timeout_ms
);
//socket.setTcpNoDelay(true);
inputStream
=
socket
.
getInputStream
();
inputOStream
=
new
ObjectInputStream
(
inputStream
);
setConnected
();
simulator
.
goToHud
();
simulator
.
showMessage
(
simulator
.
getContext
().
getString
(
R
.
string
.
sim_remote_simulator_connected
));
Log
.
d
(
"Sim"
,
System
.
currentTimeMillis
()+
": "
+
"socket openend"
);
}
catch
(
UnknownHostException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
simulator
.
showMessage
(
simulator
.
getContext
().
getString
(
R
.
string
.
sim_unknown_host
));
setDisconnected
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
simulator
.
showMessage
(
simulator
.
getContext
().
getString
(
R
.
string
.
sim_io_error
)+
": "
+
e
.
getMessage
());
setDisconnected
();
...
...
@@ -72,14 +65,10 @@ public class SocketsThread extends AsyncTask<ModelSimulation, Void, Boolean>{
}
if
(
simulator
.
getSimulatorStatus
().
equals
(
SimulatorStatus
.
Connected
)){
try
{
//Log.d("Sim",System.currentTimeMillis()+": "+"enter infinite loop");
while
(
true
){
//Log.d("Sim",System.currentTimeMillis()+": "+"before readObject");
SpacecraftState
sstate
=
(
SpacecraftState
)
inputOStream
.
readObject
();
//Log.d("Sim",System.currentTimeMillis()+": "+"after readObject");
if
(
sstate
!=
null
){
simulator
.
getSimulationResults
().
updateSimulation
(
sstate
,
0
);
//Log.d("Sim",System.currentTimeMillis()+": "+"end update data");
publishProgress
();
}
...
...
@@ -87,15 +76,12 @@ public class SocketsThread extends AsyncTask<ModelSimulation, Void, Boolean>{
break
;
}
}
catch
(
UnsupportedEncodingException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
simulator
.
showMessage
(
simulator
.
getContext
().
getString
(
R
.
string
.
sim_error
)+
": "
+
e
.
getMessage
());
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
simulator
.
showMessage
(
simulator
.
getContext
().
getString
(
R
.
string
.
sim_remote_disconnected
)+
": "
+
e
.
getMessage
());
}
catch
(
ClassNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
simulator
.
showMessage
(
simulator
.
getContext
().
getString
(
R
.
string
.
sim_error
)+
": "
+
e
.
getMessage
());
}
...
...
@@ -108,18 +94,12 @@ public class SocketsThread extends AsyncTask<ModelSimulation, Void, Boolean>{
@Override
protected
void
onProgressUpdate
(
Void
...
values
)
{
if
(
time_tmp_gui
==
0
||
(
System
.
nanoTime
()-
time_tmp_gui
)>
Parameters
.
Simulator
.
min_hud_panel_refreshing_interval_ns
){
//Log.d("Sim",System.currentTimeMillis()+": "+"update gui");
time_tmp_gui
=
System
.
nanoTime
();
simulator
.
getSimulationResults
().
updateHUD
();
//Log.d("Sim",System.currentTimeMillis()+": "+"end update gui");
}
if
(
time_tmp_data
==
0
||
(
System
.
nanoTime
()-
time_tmp_data
)>
Parameters
.
Simulator
.
min_hud_model_refreshing_interval_ns
){
//Log.d("Sim",System.currentTimeMillis()+": "+"update data");
time_tmp_data
=
System
.
nanoTime
();
simulator
.
getSimulationResults
().
pushSimulationModel
();
//Log.d("Sim",System.currentTimeMillis()+": "+"end update data");
}
else
{
//Log.d("Sim",System.currentTimeMillis()+": "+"avoid update data");
}
}
...
...
@@ -135,9 +115,6 @@ public class SocketsThread extends AsyncTask<ModelSimulation, Void, Boolean>{
@Override
protected
void
onCancelled
()
{
/*Toast.makeText(MainHilos.this, "Tarea cancelada!",
Toast.LENGTH_SHORT).show();*/
//setDisconnected();
}
private
void
setConnected
(){
...
...
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