Thread: [Firebug-cvs] firebug/project/java/src/org/firebug SensorMsg.java,1.1,1.2
Brought to you by:
doolin
From: <che...@us...> - 2003-05-22 23:00:08
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv11372 Modified Files: SensorMsg.java Log Message: Updated SensorMsg to use floats instead of shorts. Index: SensorMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SensorMsg.java 22 Apr 2003 20:41:26 -0000 1.1 --- SensorMsg.java 22 May 2003 23:00:03 -0000 1.2 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 6; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new SensorMsg of size 6. */ public SensorMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 14; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new SensorMsg of size 14. */ public SensorMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 85,90 **** String s = "Message <SensorMsg> \n"; s += " [MoteID=0x"+Long.toHexString(get_MoteID())+"]\n"; ! s += " [HumidityData=0x"+Long.toHexString(get_HumidityData())+"]\n"; ! s += " [TempData=0x"+Long.toHexString(get_TempData())+"]\n"; return s; } --- 85,91 ---- String s = "Message <SensorMsg> \n"; s += " [MoteID=0x"+Long.toHexString(get_MoteID())+"]\n"; ! s += " [temp=0x"+Long.toHexString(get_temp())+"]\n"; ! s += " [rel_hum=0x"+Long.toHexString(get_rel_hum())+"]\n"; ! s += " [baro_pres=0x"+Long.toHexString(get_baro_pres())+"]\n"; return s; } *************** *** 94,98 **** ///////////////////////////////////////////////////////// // Accessor methods for field: MoteID ! // Field type: int, unsigned // Offset (bits): 0 // Size (bits): 16 --- 95,99 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: MoteID ! // Field type: int // Offset (bits): 0 // Size (bits): 16 *************** *** 100,107 **** /** ! * Return whether the field 'MoteID' is signed (false). */ public static boolean isSigned_MoteID() { ! return false; } --- 101,108 ---- /** ! * Return whether the field 'MoteID' is signed (true). */ public static boolean isSigned_MoteID() { ! return true; } *************** *** 156,282 **** ///////////////////////////////////////////////////////// ! // Accessor methods for field: HumidityData ! // Field type: int, unsigned // Offset (bits): 16 ! // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'HumidityData' is signed (false). */ ! public static boolean isSigned_HumidityData() { ! return false; } /** ! * Return whether the field 'HumidityData' is an array (false). */ ! public static boolean isArray_HumidityData() { return false; } /** ! * Return the offset (in bytes) of the field 'HumidityData' */ ! public static int offset_HumidityData() { return (16 / 8); } /** ! * Return the offset (in bits) of the field 'HumidityData' */ ! public static int offsetBits_HumidityData() { return 16; } /** ! * Return the value (as a int) of the field 'HumidityData' */ ! public int get_HumidityData() { ! return (int)getUIntElement(offsetBits_HumidityData(), 16); } /** ! * Set the value of the field 'HumidityData' */ ! public void set_HumidityData(int value) { ! setUIntElement(offsetBits_HumidityData(), 16, value); } /** ! * Return the size, in bytes, of the field 'HumidityData' */ ! public static int size_HumidityData() { ! return (16 / 8); } /** ! * Return the size, in bits, of the field 'HumidityData' */ ! public static int sizeBits_HumidityData() { ! return 16; } ///////////////////////////////////////////////////////// ! // Accessor methods for field: TempData ! // Field type: int, unsigned ! // Offset (bits): 32 ! // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'TempData' is signed (false). */ ! public static boolean isSigned_TempData() { ! return false; } /** ! * Return whether the field 'TempData' is an array (false). */ ! public static boolean isArray_TempData() { return false; } /** ! * Return the offset (in bytes) of the field 'TempData' */ ! public static int offset_TempData() { return (32 / 8); } /** ! * Return the offset (in bits) of the field 'TempData' */ ! public static int offsetBits_TempData() { return 32; } /** ! * Return the value (as a int) of the field 'TempData' */ ! public int get_TempData() { ! return (int)getUIntElement(offsetBits_TempData(), 16); } /** ! * Set the value of the field 'TempData' */ ! public void set_TempData(int value) { ! setUIntElement(offsetBits_TempData(), 16, value); } /** ! * Return the size, in bytes, of the field 'TempData' */ ! public static int size_TempData() { ! return (16 / 8); } /** ! * Return the size, in bits, of the field 'TempData' */ ! public static int sizeBits_TempData() { ! return 16; } --- 157,346 ---- ///////////////////////////////////////////////////////// ! // Accessor methods for field: temp ! // Field type: float // Offset (bits): 16 ! // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'temp' is signed (true). */ ! public static boolean isSigned_temp() { ! return true; } /** ! * Return whether the field 'temp' is an array (false). */ ! public static boolean isArray_temp() { return false; } /** ! * Return the offset (in bytes) of the field 'temp' */ ! public static int offset_temp() { return (16 / 8); } /** ! * Return the offset (in bits) of the field 'temp' */ ! public static int offsetBits_temp() { return 16; } /** ! * Return the value (as a float) of the field 'temp' */ ! public float get_temp() { ! return (float)getFloatElement(offsetBits_temp(), 32); } /** ! * Set the value of the field 'temp' */ ! public void set_temp(float value) { ! setFloatElement(offsetBits_temp(), 32, value); } /** ! * Return the size, in bytes, of the field 'temp' */ ! public static int size_temp() { ! return (32 / 8); } /** ! * Return the size, in bits, of the field 'temp' */ ! public static int sizeBits_temp() { ! return 32; } ///////////////////////////////////////////////////////// ! // Accessor methods for field: rel_hum ! // Field type: float ! // Offset (bits): 48 ! // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'rel_hum' is signed (true). */ ! public static boolean isSigned_rel_hum() { ! return true; } /** ! * Return whether the field 'rel_hum' is an array (false). */ ! public static boolean isArray_rel_hum() { return false; } /** ! * Return the offset (in bytes) of the field 'rel_hum' */ ! public static int offset_rel_hum() { ! return (48 / 8); ! } ! ! /** ! * Return the offset (in bits) of the field 'rel_hum' ! */ ! public static int offsetBits_rel_hum() { ! return 48; ! } ! ! /** ! * Return the value (as a float) of the field 'rel_hum' ! */ ! public float get_rel_hum() { ! return (float)getFloatElement(offsetBits_rel_hum(), 32); ! } ! ! /** ! * Set the value of the field 'rel_hum' ! */ ! public void set_rel_hum(float value) { ! setFloatElement(offsetBits_rel_hum(), 32, value); ! } ! ! /** ! * Return the size, in bytes, of the field 'rel_hum' ! */ ! public static int size_rel_hum() { return (32 / 8); } /** ! * Return the size, in bits, of the field 'rel_hum' */ ! public static int sizeBits_rel_hum() { return 32; } + ///////////////////////////////////////////////////////// + // Accessor methods for field: baro_pres + // Field type: float + // Offset (bits): 80 + // Size (bits): 32 + ///////////////////////////////////////////////////////// + /** ! * Return whether the field 'baro_pres' is signed (true). */ ! public static boolean isSigned_baro_pres() { ! return true; } /** ! * Return whether the field 'baro_pres' is an array (false). */ ! public static boolean isArray_baro_pres() { ! return false; } /** ! * Return the offset (in bytes) of the field 'baro_pres' */ ! public static int offset_baro_pres() { ! return (80 / 8); } /** ! * Return the offset (in bits) of the field 'baro_pres' */ ! public static int offsetBits_baro_pres() { ! return 80; ! } ! ! /** ! * Return the value (as a float) of the field 'baro_pres' ! */ ! public float get_baro_pres() { ! return (float)getFloatElement(offsetBits_baro_pres(), 32); ! } ! ! /** ! * Set the value of the field 'baro_pres' ! */ ! public void set_baro_pres(float value) { ! setFloatElement(offsetBits_baro_pres(), 32, value); ! } ! ! /** ! * Return the size, in bytes, of the field 'baro_pres' ! */ ! public static int size_baro_pres() { ! return (32 / 8); ! } ! ! /** ! * Return the size, in bits, of the field 'baro_pres' ! */ ! public static int sizeBits_baro_pres() { ! return 32; } |