|
|
/home/brennan/Software/sensix/source/C^4/corba/gov/lanl/isr/sensix/sensing/SensoryImpl.javaGo to the documentation of this file.00001 00010 /* 00011 * Copyright 2008. Los Alamos National Security, LLC. This material 00012 * was produced under U.S. Government contract DE-AC52-06NA25396 for 00013 * Los Alamos National Laboratory (LANL), which is operated by Los 00014 * Alamos National Security, LLC, for the Department of Energy. The 00015 * U.S. Government has rights to use, reproduce, and distribute this 00016 * software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, 00017 * LLC, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL 00018 * LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to 00019 * produce derivative works, such modified software should be clearly 00020 * marked, so as not to confuse it with the version available from LANL. 00021 * 00022 * Additionally, this program is free software; you can redistribute 00023 * it and/or modify it under the terms of the GNU General Public 00024 * License as published by the Free Software Foundation; version 2 of 00025 * the License. Accordingly, this program is distributed in the hope 00026 * it will be useful, but WITHOUT ANY WARRANTY; without even the 00027 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00028 * PURPOSE. See the GNU General Public License for more details. 00029 * 00030 * You should have received a copy of the GNU General Public License 00031 * along with this program; if not, write to the Free Software 00032 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00033 */ 00034 00035 package gov.lanl.isr.sensix.sensing; 00036 00037 import gov.lanl.isr.sensix.*; 00038 00039 00040 public class SensoryImpl extends SensoryPOA 00041 { 00042 protected byte sense; 00043 protected byte h_level; 00044 protected long time; 00045 protected double energy; 00046 protected double value; 00047 private FunctorImpl del; 00048 00049 00050 public SensoryImpl(byte l, byte s, Functor[] subfs) { 00051 del = new FunctorImpl(subfs); 00052 h_level = l; 00053 sense = s; 00054 } 00055 00056 public SensoryImpl(byte l, byte s) { 00057 del = new FunctorImpl(); 00058 h_level = l; 00059 sense = s; 00060 } 00061 00062 public SensoryImpl(Functor[] subfs) { 00063 del = new FunctorImpl(subfs); 00064 h_level = SenseCorba.INVALID; 00065 sense = SenseCorba.INVALID; 00066 } 00067 00068 public SensoryImpl() { 00069 del = new FunctorImpl(); 00070 h_level = SenseCorba.INVALID; 00071 sense = SenseCorba.INVALID; 00072 } 00073 00074 public SensoryImpl(byte l, byte s, Functor[] subfs, int seq) { 00075 del = new FunctorImpl(subfs, seq); 00076 h_level = l; 00077 sense = s; 00078 } 00079 00080 public SensoryImpl(byte l, byte s, int seq) { 00081 del = new FunctorImpl(seq); 00082 h_level = l; 00083 sense = s; 00084 } 00085 00086 00087 public byte level() { 00088 return h_level; 00089 } 00090 00091 public byte sensor() { 00092 return sense; 00093 } 00094 00095 public long timeused() { 00096 return time; 00097 } 00098 00099 public void timeused(long t) { 00100 time = t; 00101 } 00102 00103 public double energyused() { 00104 return energy; 00105 } 00106 00107 public void energyused(double e) { 00108 energy = e; 00109 } 00110 00111 00112 /********** delegation **********/ 00113 00114 00115 public String asString() { 00116 return del.asString(); 00117 } 00118 00119 public byte identifier() { 00120 return del.identifier(); 00121 } 00122 00123 public int sequencer() { 00124 return del.sequencer(); 00125 } 00126 00127 public Data[] results() { 00128 return del.results(); 00129 } 00130 00131 public void results(Data[] data) { 00132 del.results(data); 00133 } 00134 00135 00136 public FunctorError[] errors() { 00137 return del.errors(); 00138 } 00139 00140 public void errors(FunctorError[] e) { 00141 del.errors(e); 00142 } 00143 00144 00145 public byte priority() { 00146 return del.priority(); 00147 } 00148 00149 public void priority(byte p) { 00150 del.priority(p); 00151 } 00152 00153 00154 public Functor[] subfunctors() { 00155 return del.subfunctors(); 00156 } 00157 00158 public void subfunctors(Functor[] fs) { 00159 del.subfunctors(fs); 00160 } 00161 } |