[Firebug-cvs] firebug/project/java/src/org/firebug DBLogger.java,1.25,1.26 FireMsg.java,1.1,1.2 GGAM
Brought to you by:
doolin
From: <do...@us...> - 2004-03-12 00:11:11
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30243 Modified Files: DBLogger.java FireMsg.java GGAMsg.java ListenFB.java Log Message: Conflict between GGAMsg and ListenFB with archive, probably won't work directly. Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DBLogger.java 18 Feb 2004 01:17:07 -0000 1.25 --- DBLogger.java 11 Mar 2004 23:52:00 -0000 1.26 *************** *** 63,71 **** //SensorMsg msg = new SensorMsg(packet,5,19); ! SensorMsg msg = new SensorMsg(); //SensorMsg msg = new SensorMsg(packet,5,12); ! FireMsg fmsg = new FireMsg(); Connection conn = dbh.getConnection(); --- 63,72 ---- //SensorMsg msg = new SensorMsg(packet,5,19); ! //SensorMsg msg = new SensorMsg(); //SensorMsg msg = new SensorMsg(packet,5,12); ! //FireMsg fmsg = new FireMsg(); + GGAMsg msg = new GGAMsg(packet,5); Connection conn = dbh.getConnection(); *************** *** 76,102 **** // database, then converted whenever it needs to // be displayed. - int time = (int)System.currentTimeMillis(); ! ! int mote_id = getMoteID(packet); ! int mote_id_test = msg.get_addr(); ! ! if (mote_id != mote_id_test){ ! System.out.println(mote_id+ " "+ mote_id_test + "\n"); ! } ! ! int cnt=msg.get_cnt(); ! int hours=msg.get_hours(); ! int minutes=msg.get_minutes(); ! int dec_sec=msg.get_dec_sec(); ! int Lat_deg=msg.get_Lat_deg(); ! int Lat_dec_min=msg.get_Lat_dec_min(); ! int Long_deg=msg.get_Long_deg(); ! int Long_dec_min=msg.get_Long_dec_min(); int NSEWind = msg.get_NSEWind(); ! float temp = msg.get_temp(); ! //float rel_hum = msg.get_rel_hum(); ! //float baro_pres = msg.get_baro_pres(); if (get_packet_type(packet) != 1){ dbh.return_connection(conn); --- 77,94 ---- // database, then converted whenever it needs to // be displayed. ! int mote_id = msg.get_mote_id(); ! int hours = msg.get_hours(); ! int minutes = msg.get_minutes(); ! float dec_sec = msg.get_dec_sec(); ! int Lat_deg = msg.get_Lat_deg(); ! float Lat_dec_min = msg.get_Lat_dec_min(); ! int Long_deg = msg.get_Long_deg(); ! float Long_dec_min = msg.get_Long_dec_min(); int NSEWind = msg.get_NSEWind(); ! int num_sats = msg.get_num_sats(); ! + /* if (get_packet_type(packet) != 1){ dbh.return_connection(conn); *************** *** 110,122 **** return; } print_packet_raw(packet); //base station ID is 1; if (mote_id == 1) { dbh.return_connection(conn); return; } ! --- 102,116 ---- return; } + */ print_packet_raw(packet); //base station ID is 1; + /* if (mote_id == 1) { dbh.return_connection(conn); return; } ! */ *************** *** 129,163 **** ! String updatequery = "UPDATE current " ! + "SET " ! //+ "time=" + time + ", " ! + "cnt=" + cnt + "," ! + "hours=" + hours + "," ! + "minutes=" + minutes + "," ! + "dec_sec=" + dec_sec + "," ! + "Lat_deg=" + Lat_deg + "," ! + "Lat_dec_min=" + Lat_dec_min + "," ! + "Long_deg=" + Long_deg + "," ! + "Long_dec_min=" + Long_dec_min + "," ! + "NSEWind=" + NSEWind + "," ! //+ "rel_hum=" + rel_hum + ", " ! // + "baro_pres=" + baro_pres + ", " ! + "temp=" + temp + " WHERE mote_id=" + mote_id; ! ! String insertquery = "INSERT INTO cumulative VALUES (" ! + mote_id + ", " ! + "NULL," //time + ", " ! + temp + ", " ! //+ rel_hum + ", " ! // + baro_pres + ", " ! + cnt + ", " ! + hours + ", " ! + minutes + ", " ! + dec_sec + ", " ! + Lat_deg + ", " ! + Lat_dec_min + ", " + Long_deg + ", " ! + Long_dec_min + ", " ! + NSEWind + ")"; --- 123,137 ---- ! String insertquery = "INSERT INTO location VALUES (" ! + mote_id + ", " ! + hours + ", " ! + minutes + ", " ! + dec_sec + ", " ! + Lat_deg + ", " ! + Lat_dec_min + ", " + Long_deg + ", " ! + Long_dec_min + ", " ! + NSEWind + "," ! + num_sats + ")"; *************** *** 168,178 **** sqle.printStackTrace(); } - - try { - rs = stmt.executeQuery(updatequery); - } catch (SQLException sqle) { - System.out.println("Problem with update statement: " + updatequery); - sqle.printStackTrace(); - } stmt.close(); } catch (SQLException sqle) { --- 142,145 ---- *************** *** 181,189 **** } - - - - - dbh.return_connection(conn); --- 148,151 ---- Index: FireMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/FireMsg.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FireMsg.java 18 Feb 2004 01:18:31 -0000 1.1 --- FireMsg.java 11 Mar 2004 23:52:00 -0000 1.2 *************** *** 88,92 **** String s = "Message <FireMsg> \n"; try { ! s += " [addr=0x"+Long.toHexString(get_addr())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { --- 88,92 ---- String s = "Message <FireMsg> \n"; try { ! s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { *************** *** 111,115 **** ///////////////////////////////////////////////////////// ! // Accessor methods for field: addr // Field type: int // Offset (bits): 0 --- 111,115 ---- ///////////////////////////////////////////////////////// ! // Accessor methods for field: mote_id // Field type: int // Offset (bits): 0 *************** *** 118,173 **** /** ! * Return whether the field 'addr' is signed (true). */ ! public static boolean isSigned_addr() { return true; } /** ! * Return whether the field 'addr' is an array (false). */ ! public static boolean isArray_addr() { return false; } /** ! * Return the offset (in bytes) of the field 'addr' */ ! public static int offset_addr() { return (0 / 8); } /** ! * Return the offset (in bits) of the field 'addr' */ ! public static int offsetBits_addr() { return 0; } /** ! * Return the value (as a int) of the field 'addr' */ ! public int get_addr() { ! return (int)getUIntElement(offsetBits_addr(), 16); } /** ! * Set the value of the field 'addr' */ ! public void set_addr(int value) { ! setUIntElement(offsetBits_addr(), 16, value); } /** ! * Return the size, in bytes, of the field 'addr' */ ! public static int size_addr() { return (16 / 8); } /** ! * Return the size, in bits, of the field 'addr' */ ! public static int sizeBits_addr() { return 16; } --- 118,173 ---- /** ! * Return whether the field 'mote_id' is signed (true). */ ! public static boolean isSigned_mote_id() { return true; } /** ! * Return whether the field 'mote_id' is an array (false). */ ! public static boolean isArray_mote_id() { return false; } /** ! * Return the offset (in bytes) of the field 'mote_id' */ ! public static int offset_mote_id() { return (0 / 8); } /** ! * Return the offset (in bits) of the field 'mote_id' */ ! public static int offsetBits_mote_id() { return 0; } /** ! * Return the value (as a int) of the field 'mote_id' */ ! public int get_mote_id() { ! return (int)getUIntElement(offsetBits_mote_id(), 16); } /** ! * Set the value of the field 'mote_id' */ ! public void set_mote_id(int value) { ! setUIntElement(offsetBits_mote_id(), 16, value); } /** ! * Return the size, in bytes, of the field 'mote_id' */ ! public static int size_mote_id() { return (16 / 8); } /** ! * Return the size, in bits, of the field 'mote_id' */ ! public static int sizeBits_mote_id() { return 16; } Index: GGAMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/GGAMsg.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GGAMsg.java 19 Feb 2004 17:41:53 -0000 1.2 --- GGAMsg.java 11 Mar 2004 23:52:00 -0000 1.3 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 19; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new GGAMsg of size 19. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 20; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new GGAMsg of size 20. */ public GGAMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 88,92 **** String s = "Message <GGAMsg> \n"; try { - s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } --- 88,91 ---- *************** *** 125,131 **** ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id ! // Field type: short, unsigned // Offset (bits): 0 ! // Size (bits): 8 ///////////////////////////////////////////////////////// --- 124,130 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: mote_id ! // Field type: int, unsigned // Offset (bits): 0 ! // Size (bits): 16 ///////////////////////////////////////////////////////// *************** *** 159,166 **** /** ! * Return the value (as a short) of the field 'mote_id' */ ! public short get_mote_id() { ! return (short)getUIntElement(offsetBits_mote_id(), 8); } --- 158,165 ---- /** ! * Return the value (as a int) of the field 'mote_id' */ ! public int get_mote_id() { ! return (int)getUIntElement(offsetBits_mote_id(), 16); } *************** *** 168,173 **** * Set the value of the field 'mote_id' */ ! public void set_mote_id(short value) { ! setUIntElement(offsetBits_mote_id(), 8, value); } --- 167,172 ---- * Set the value of the field 'mote_id' */ ! public void set_mote_id(int value) { ! setUIntElement(offsetBits_mote_id(), 16, value); } *************** *** 176,180 **** */ public static int size_mote_id() { ! return (8 / 8); } --- 175,179 ---- */ public static int size_mote_id() { ! return (16 / 8); } *************** *** 183,187 **** */ public static int sizeBits_mote_id() { ! return 8; } --- 182,186 ---- */ public static int sizeBits_mote_id() { ! return 16; } *************** *** 189,193 **** // Accessor methods for field: hours // Field type: short, unsigned ! // Offset (bits): 8 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 188,192 ---- // Accessor methods for field: hours // Field type: short, unsigned ! // Offset (bits): 16 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 211,215 **** */ public static int offset_hours() { ! return (8 / 8); } --- 210,214 ---- */ public static int offset_hours() { ! return (16 / 8); } *************** *** 218,222 **** */ public static int offsetBits_hours() { ! return 8; } --- 217,221 ---- */ public static int offsetBits_hours() { ! return 16; } *************** *** 252,256 **** // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 16 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 251,255 ---- // Accessor methods for field: minutes // Field type: short, unsigned ! // Offset (bits): 24 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 274,278 **** */ public static int offset_minutes() { ! return (16 / 8); } --- 273,277 ---- */ public static int offset_minutes() { ! return (24 / 8); } *************** *** 281,285 **** */ public static int offsetBits_minutes() { ! return 16; } --- 280,284 ---- */ public static int offsetBits_minutes() { ! return 24; } *************** *** 315,319 **** // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 24 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 314,318 ---- // Accessor methods for field: dec_sec // Field type: float, unsigned ! // Offset (bits): 32 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 337,341 **** */ public static int offset_dec_sec() { ! return (24 / 8); } --- 336,340 ---- */ public static int offset_dec_sec() { ! return (32 / 8); } *************** *** 344,348 **** */ public static int offsetBits_dec_sec() { ! return 24; } --- 343,347 ---- */ public static int offsetBits_dec_sec() { ! return 32; } *************** *** 378,382 **** // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 56 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 377,381 ---- // Accessor methods for field: Lat_deg // Field type: short, unsigned ! // Offset (bits): 64 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 400,404 **** */ public static int offset_Lat_deg() { ! return (56 / 8); } --- 399,403 ---- */ public static int offset_Lat_deg() { ! return (64 / 8); } *************** *** 407,411 **** */ public static int offsetBits_Lat_deg() { ! return 56; } --- 406,410 ---- */ public static int offsetBits_Lat_deg() { ! return 64; } *************** *** 441,445 **** // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 64 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 440,444 ---- // Accessor methods for field: Lat_dec_min // Field type: float, unsigned ! // Offset (bits): 72 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 463,467 **** */ public static int offset_Lat_dec_min() { ! return (64 / 8); } --- 462,466 ---- */ public static int offset_Lat_dec_min() { ! return (72 / 8); } *************** *** 470,474 **** */ public static int offsetBits_Lat_dec_min() { ! return 64; } --- 469,473 ---- */ public static int offsetBits_Lat_dec_min() { ! return 72; } *************** *** 504,508 **** // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 96 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 503,507 ---- // Accessor methods for field: Long_deg // Field type: short, unsigned ! // Offset (bits): 104 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 526,530 **** */ public static int offset_Long_deg() { ! return (96 / 8); } --- 525,529 ---- */ public static int offset_Long_deg() { ! return (104 / 8); } *************** *** 533,537 **** */ public static int offsetBits_Long_deg() { ! return 96; } --- 532,536 ---- */ public static int offsetBits_Long_deg() { ! return 104; } *************** *** 567,571 **** // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 104 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 566,570 ---- // Accessor methods for field: Long_dec_min // Field type: float, unsigned ! // Offset (bits): 112 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 589,593 **** */ public static int offset_Long_dec_min() { ! return (104 / 8); } --- 588,592 ---- */ public static int offset_Long_dec_min() { ! return (112 / 8); } *************** *** 596,600 **** */ public static int offsetBits_Long_dec_min() { ! return 104; } --- 595,599 ---- */ public static int offsetBits_Long_dec_min() { ! return 112; } *************** *** 630,634 **** // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 136 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 629,633 ---- // Accessor methods for field: NSEWind // Field type: short, unsigned ! // Offset (bits): 144 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 652,656 **** */ public static int offset_NSEWind() { ! return (136 / 8); } --- 651,655 ---- */ public static int offset_NSEWind() { ! return (144 / 8); } *************** *** 659,663 **** */ public static int offsetBits_NSEWind() { ! return 136; } --- 658,662 ---- */ public static int offsetBits_NSEWind() { ! return 144; } *************** *** 693,697 **** // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 144 // Size (bits): 8 ///////////////////////////////////////////////////////// --- 692,696 ---- // Accessor methods for field: num_sats // Field type: short, unsigned ! // Offset (bits): 152 // Size (bits): 8 ///////////////////////////////////////////////////////// *************** *** 715,719 **** */ public static int offset_num_sats() { ! return (144 / 8); } --- 714,718 ---- */ public static int offset_num_sats() { ! return (152 / 8); } *************** *** 722,726 **** */ public static int offsetBits_num_sats() { ! return 144; } --- 721,725 ---- */ public static int offsetBits_num_sats() { ! return 152; } Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ListenFB.java 19 Feb 2004 17:41:53 -0000 1.17 --- ListenFB.java 11 Mar 2004 23:52:00 -0000 1.18 *************** *** 267,278 **** //SensorPacket print = new SensorPacket(); //DBLogger dblogger = new DBLogger(dbname); ! RawPacket rawpacket = new RawPacket(); //FireLogger firelogger = new FireLogger(dbname); ! GPSLogger gpslogger = new GPSLogger(dbname); //printers.add(print); //printers.add(dblogger); //printers.add(firelogger); ! printers.add(gpslogger); try { --- 267,290 ---- //SensorPacket print = new SensorPacket(); //DBLogger dblogger = new DBLogger(dbname); ! ! //RawPacket rawpacket = new RawPacket(); //FireLogger firelogger = new FireLogger(dbname); ! RangeLogger rangelogger = new RangeLogger(dbname); ! ! //RawPacket rawpacket = new RawPacket(); ! //FireLogger firelogger = new FireLogger(dbname); ! //GPSLogger gpslogger = new GPSLogger(dbname); ! //printers.add(print); //printers.add(dblogger); + //printers.add(firelogger); ! printers.add(rangelogger); ! ! ! //printers.add(firelogger); ! //printers.add(gpslogger); ! try { |