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
00038 public class PeakParams {
00039 public byte level;
00040 public byte sensor;
00041 public double rate;
00042 public double th_h;
00043 public double th_l;
00044 public boolean l_set = false;
00045 public boolean s_set = false;
00046 public boolean r_set = false;
00047 public boolean th_set = false;
00048 public boolean tl_set = false;
00049
00050 public PeakParams(byte l, byte s, double r, double th, double tl,
00051 boolean ls, boolean ss, boolean rs,
00052 boolean ths, boolean tls) {
00053 level = l;
00054 sensor = s;
00055 rate = r;
00056 th_h = th;
00057 th_l = tl;
00058 l_set = ls;
00059 s_set = ss;
00060 r_set = rs;
00061 th_set = ths;
00062 tl_set = tls;
00063 }
00064
00065 public PeakParams(PeakParams p1, PeakParams p2) {
00066 if (p1.l_set) {
00067 level = p1.level;
00068 l_set = true;
00069 }
00070 if (p1.s_set) {
00071 sensor = p1.sensor;
00072 s_set = true;
00073 }
00074 if (p1.r_set) {
00075 rate = p1.rate;
00076 r_set = true;
00077 }
00078 if (p1.th_set) {
00079 th_h = p1.th_h;
00080 th_set = true;
00081 }
00082 if (p1.tl_set) {
00083 th_l = p1.th_l;
00084 tl_set = true;
00085 }
00086 if (p2 != null) {
00087 if (p2.l_set) {
00088 level = p2.level;
00089 l_set = true;
00090 }
00091 if (p2.s_set) {
00092 sensor = p2.sensor;
00093 s_set = true;
00094 }
00095 if (p2.r_set) {
00096 rate = p2.rate;
00097 r_set = true;
00098 }
00099 if (p2.th_set) {
00100 th_h = p2.th_h;
00101 th_set = true;
00102 }
00103 if (p2.tl_set) {
00104 th_l = p2.th_l;
00105 tl_set = true;
00106 }
00107 }
00108 }
00109 }