00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 package sensix.sensing;
00036
00037 import sensix.*;
00038
00039
00040 public class SpatialSeries extends Collection
00041 {
00042 protected double centirads;
00043 protected double dist_cm;
00044
00045
00046 public SpatialSeries(byte l, Sensory s, double angle, double dist) {
00047 super(l, s);
00048 centirads = angle;
00049 dist_cm = dist;
00050 }
00051
00052 public SpatialSeries(Sensory s, double angle, double dist) {
00053 super(s);
00054 centirads = angle;
00055 dist_cm = dist;
00056 }
00057
00058 public SpatialSeries(byte l, Sensory s) {
00059 super(l, s);
00060 centirads = -1.0;
00061 dist_cm = -1.0;
00062 }
00063
00064 public SpatialSeries(Sensory s) {
00065 super(s);
00066 centirads = -1.0;
00067 dist_cm = -1.0;
00068 }
00069
00070 public SpatialSeries(byte l, Sensory s, double angle, double dist,
00071 int seq) {
00072 super(l, s, seq);
00073 centirads = angle;
00074 dist_cm = dist;
00075 }
00076
00077
00078 public byte identifier() {
00079 return Sensix.PSI;
00080 }
00081
00082 public void distance(double d) {
00083 dist_cm = d;
00084 }
00085
00086 public double distance() {
00087 return dist_cm;
00088 }
00089
00090 public void angle(double a) {
00091 centirads = a;
00092 }
00093
00094 public double angle() {
00095 return centirads;
00096 }
00097
00098 public String asString() {
00099 String string_rep = "SpatialSeries(";
00100 if (level() != Sensix.INVALID)
00101 string_rep += "level=" + (int)level() + ",";
00102 if (centirads > 0.0)
00103 string_rep += "angle=" + centirads + ",";
00104 if (dist_cm > 0.0)
00105 string_rep += "distance=" + dist_cm + ",";
00106 string_rep += sense().asString() + ")";
00107 return string_rep;
00108 }
00109 }