Skip to content
This repository
Browse code

commit du pic pour pouvoir recuperer la classe rs232

  • Loading branch information...
commit 580155105f7f80672e123c739ad26f2c0e53633a 1 parent 28a707a
ceschinloris ceschinloris authored

Showing 1 changed file with 42 additions and 2 deletions. Show diff stats Hide diff stats

  1. +42 2 projetp1/src/com/github/projetp1/Pic.java
44 projetp1/src/com/github/projetp1/Pic.java
@@ -6,7 +6,12 @@
6 6 /**
7 7 * @author alexandr.perez
8 8 */
9   -public class Pic {
  9 +
  10 +import java.util.concurrent.ConcurrentLinkedQueue;
  11 +
  12 +import com.github.projetp1.rs232.RS232Command;
  13 +
  14 +public class Pic extends Thread{
10 15
11 16 /**
12 17 * @uml.property name="longitude"
@@ -42,11 +47,20 @@
42 47 SIMULATION
43 48 ; }
44 49
  50 + private com.github.projetp1.rs232.RS232Command commande;
  51 +
  52 + protected MainView mainview;
  53 +
  54 + private com.github.projetp1.rs232.RS232 rs = new com.github.projetp1.rs232.RS232(mainview);
  55 +
45 56 /**
46 57 *
47 58 */
48   - public Pic() {
  59 + public Pic(MainView _mainview) {
49 60 // TODO Auto-generated constructor stub
  61 + this.mainview = _mainview;
  62 +
  63 + this.start();
50 64 }
51 65
52 66 /**
@@ -120,4 +134,30 @@ public PicMode getMode() {
120 134 public void setMode(PicMode mode) {
121 135 this.mode = mode;
122 136 }
  137 + public void run()
  138 + {
  139 + //Reception des données
  140 + commande = rs.getLastCommand();
  141 +
  142 + //Switch pour trier les données
  143 + switch(commande.getCommandNumber())
  144 + {
  145 + case EMPTY :
  146 + break;
  147 + case CHANGE_TO_POINT_MODE:
  148 + break;
  149 + case CHANGE_TO_ARROW_MODE:
  150 + break;
  151 + case LOCATION_UPDATE:
  152 + break;
  153 + case ACCELEROMETER_UPDATE:
  154 + break;
  155 + case MAGNETOMETER_UPDATE:
  156 + break;
  157 + case PIC_STATUS:
  158 + break;
  159 + default:
  160 + break;
  161 + }
  162 + }
123 163 }

0 comments on commit 5801551

Please sign in to comment.
Something went wrong with that request. Please try again.