Permalink
Browse files

commit du pic pour pouvoir recuperer la classe rs232

  • Loading branch information...
ceschinloris committed Apr 30, 2012
1 parent 28a707a commit 580155105f7f80672e123c739ad26f2c0e53633a
Showing with 42 additions and 2 deletions.
  1. +42 −2 projetp1/src/com/github/projetp1/Pic.java
@@ -6,7 +6,12 @@
/**
* @author alexandr.perez
*/
-public class Pic {
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import com.github.projetp1.rs232.RS232Command;
+
+public class Pic extends Thread{
/**
* @uml.property name="longitude"
@@ -42,11 +47,20 @@
SIMULATION
; }
+ private com.github.projetp1.rs232.RS232Command commande;
+
+ protected MainView mainview;
+
+ private com.github.projetp1.rs232.RS232 rs = new com.github.projetp1.rs232.RS232(mainview);
+
/**
*
*/
- public Pic() {
+ public Pic(MainView _mainview) {
// TODO Auto-generated constructor stub
+ this.mainview = _mainview;
+
+ this.start();
}
/**
@@ -120,4 +134,30 @@ public PicMode getMode() {
public void setMode(PicMode mode) {
this.mode = mode;
}
+ public void run()
+ {
+ //Reception des données
+ commande = rs.getLastCommand();
+
+ //Switch pour trier les données
+ switch(commande.getCommandNumber())
+ {
+ case EMPTY :
+ break;
+ case CHANGE_TO_POINT_MODE:
+ break;
+ case CHANGE_TO_ARROW_MODE:
+ break;
+ case LOCATION_UPDATE:
+ break;
+ case ACCELEROMETER_UPDATE:
+ break;
+ case MAGNETOMETER_UPDATE:
+ break;
+ case PIC_STATUS:
+ break;
+ default:
+ break;
+ }
+ }
}

0 comments on commit 5801551

Please sign in to comment.