1 package cz.cuni.amis.pogamut.usar2004.communication.messages.datatypes; 2 3 import java.io.Serializable; 4 5 /** 6 * Obsolete - Each data type has its own class now. This class is all comented 7 * out now and is used as template and for keeping old concepts. 8 * 9 * Custom types defined for USARSim. 10 */ 11 public class CustomTypes implements Serializable 12 { 13 /** 14 * List of all Robot Types. According to this type, some messages are 15 * formated. 16 */ 17 // public enum RobotType { 18 // GroundVehicle("GroundVehicle"), 19 // LeggedRobot("LeggedRobot"), 20 // NauticVehicle("NauticVehicle"), 21 // AerialVehicle("AerialVehicle"), 22 // 23 // Other("Other"); 24 // 25 // /* =================================================================== */ 26 // /** Human-readable name of the category. */ 27 // public String name; 28 // /* =================================================================== */ 29 // 30 // /** 31 // * Constructor. 32 // * 33 // * @param name 34 // * Human-readable name of the category. 35 // */ 36 // RobotType(String name) { 37 // this.name = name; 38 // } 39 // 40 // } 41 // /** 42 // * List of all Robot sensor Types. According to this type, some messages Could be formated. 43 // */ 44 // public enum SensorType { 45 // Sonar("RangeSensor"), 46 // RangeScanner("LaserSensor"), 47 // Odometry("OdometrySensor"), 48 // GPS("GPSSensor"), 49 // INS("INSSensor"), 50 // Encoder("EncoderSensor"), 51 // Touch("TouchSensor"), 52 // RFID("RFIDSensor"), //RFID+Tag ->Tag is generated 53 // VictSensor("VictimSensor"), 54 // HumanMotion("HumanMotionDetection"), 55 // Sound("SoundSensor"), 56 // 57 // Other("Other"); 58 // 59 // /* =================================================================== */ 60 // /** Human-readable name of the category. */ 61 // public String name; 62 // /* =================================================================== */ 63 // 64 // /** 65 // * Constructor. 66 // * 67 // * @param name 68 // * Human-readable name of the category. 69 // */ 70 // SensorType(String name) { 71 // this.name = name; 72 // } 73 // } 74 /* 75 * This class represents State of a Link of a robot. It could be used by 76 * MISSTA info message. * 77 * 78 */ 79 // interface LngLat { 80 // int degree=0; 81 // double minute=0; 82 // char cardinal=0; 83 // 84 // 85 // abstract void set(LngLat item); 86 // abstract void set(int degree, double minute, char cardinal); 87 //// abstract void get(LngLat item); 88 // abstract int getDegree(); 89 // abstract double getMinute(); 90 // abstract char getCardinal(); 91 // 92 // 93 // } 94 // static public class Longitude implements LngLat{ 95 // 96 // public Longitude(int d, double m, char c){ 97 // } 98 // public Longitude(){ 99 // } 100 // 101 // @Override 102 // public void set(LngLat item) { 103 // this.cardinal=item.cardinal; 104 // this.degree=item.degree; 105 // this.minute=item.minute; 106 // } 107 // 108 // @Override 109 // public void set(int degree, double minute, char cardinal) { 110 // this.cardinal=cardinal; 111 // this.degree=degree; 112 // this.minute=minute; 113 // } 114 // 115 // 116 // 117 //// @Override 118 //// public void get(LngLat item) { 119 //// item.cardinal=this.cardinal; 120 //// item.degree=this.degree; 121 //// item.minute=this.minute; 122 //// } 123 // 124 // @Override 125 // public char getCardinal() { 126 // return cardinal; 127 // } 128 // 129 // @Override 130 // public int getDegree() { 131 // return degree; 132 // } 133 // 134 // @Override 135 // public double getMinute() { 136 // return minute; 137 // } 138 // } 139 // static public class RFIDSet 140 // { 141 // private List<Integer> IDs = new ArrayList<Integer>(); 142 // private List<Location> locations = new ArrayList<Location>(); 143 // 144 // public RFIDSet() 145 // { 146 // } 147 // 148 // public void add(int id, double a, double b, double c) 149 // { 150 // IDs.add(id); 151 // locations.add(new Location(a, b, c)); 152 // } 153 // public void add(int id, Location loc) 154 // { 155 // IDs.add(id); 156 // locations.add(loc); 157 // } 158 // 159 // public void addID(int id){ 160 // IDs.add(id); 161 // } 162 // public void addLocation(Location loc){ 163 // locations.add(loc); 164 // } 165 // public void addLocation(double a, double b, double c){ 166 // locations.add(new Location(a,b,c)); 167 // } 168 // 169 // public List<Integer> getIDs() { 170 // return IDs; 171 // } 172 // 173 // public List<Location> getLocations() { 174 // return locations; 175 // } 176 // } 177 // 178 // static public class VictimPartsSet 179 // { 180 // private List<Location> locations = new ArrayList<Location>(); 181 // private List<String> partNames = new ArrayList<String>(); 182 // 183 // public VictimPartsSet() 184 // { 185 // } 186 // 187 // public void add(String pn, double a, double b, double c) 188 // { 189 // partNames.add(pn); 190 // locations.add(new Location(a, b, c)); 191 // } 192 // public void add(String pn, Location loc) 193 // { 194 // partNames.add(pn); 195 // locations.add(loc); 196 // } 197 // 198 // public void addPartName(String pn){ 199 // partNames.add(pn); 200 // } 201 // public void addLocation(Location loc){ 202 // locations.add(loc); 203 // } 204 // public void addLocation(double a, double b, double c){ 205 // locations.add(new Location(a,b,c)); 206 // } 207 // 208 // public List<String> getPartNames() { 209 // return partNames; 210 // } 211 // 212 // public List<Location> getLocations() { 213 // return locations; 214 // } 215 // } 216 // static public class Point4f { 217 // 218 // double first=0, second=0, third=0, fourth=0; 219 // 220 // public Point4f(double f1, double f2, double f3, double f4) 221 // { 222 // this.first=f1; 223 // this.second=f2; 224 // this.third=f3; 225 // this.fourth=f4; 226 // } 227 // 228 // public Point4f(double[] f) { 229 // if(f.length>=4) 230 // { 231 // this.first=f[0]; 232 // this.second=f[1]; 233 // this.third=f[2]; 234 // this.fourth=f[3]; 235 // } 236 // else throw new RuntimeException("Too little array!"); 237 // } 238 // 239 // public Point4f(Point4f f) { 240 // this.first=f.first; 241 // this.second=f.second; 242 // this.third=f.third; 243 // this.fourth=f.fourth; 244 // } 245 // 246 // public double getFirst() { 247 // return first; 248 // } 249 // 250 // public double getSecond() { 251 // return second; 252 // } 253 // 254 // public double getThird() { 255 // return third; 256 // } 257 // 258 // public double getFourth() { 259 // return fourth; 260 // } 261 // 262 // public final void set(double f1, double f2, double f3, double f4) 263 // { 264 // this.first=f1; 265 // this.second=f2; 266 // this.third=f3; 267 // this.fourth=f4; 268 // } 269 // public final void set(double[] f) { 270 // if(f.length>=4) 271 // { 272 // this.first=f[0]; 273 // this.second=f[1]; 274 // this.third=f[2]; 275 // this.fourth=f[3]; 276 // } 277 // else throw new RuntimeException("Too little array!"); 278 // } 279 // public final double [] toArray() { 280 // return new double []{first,second,third,fourth}; 281 // } 282 // 283 // } 284 }