[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model/bridge Sensor.java, 1.3, 1.4 Mote.j
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2009-05-25 12:00:55
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/bridge In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24062/src/net/sourceforge/bprocessor/model/bridge Modified Files: Sensor.java Mote.java Log Message: Index: Sensor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/bridge/Sensor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sensor.java 17 Feb 2009 10:50:22 -0000 1.3 --- Sensor.java 25 May 2009 12:00:46 -0000 1.4 *************** *** 67,71 **** */ public void update() { - System.out.println("update sensors"); for (Mote current : motes) { long id = current.id(); --- 67,70 ---- *************** *** 73,77 **** DataItem item = Project.latest((int)id); if (item != null) { - System.out.println(" addinng " + item); current.add(item); } --- 72,75 ---- Index: Mote.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/bridge/Mote.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Mote.java 17 Feb 2009 10:50:22 -0000 1.3 --- Mote.java 25 May 2009 12:00:46 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Parametric; + import net.sourceforge.bprocessor.model.Vertex; /** *************** *** 23,26 **** --- 24,28 ---- private List<DataItem> items; private long lasttime; + private Vertex position; /** *************** *** 32,35 **** --- 34,50 ---- items = new LinkedList(); lasttime = 0; + if (id == 15198069) { + position = new Vertex(20, 7.1, 4.1); + } else if (id == 15198041) { + position = new Vertex(20, 14.2, 4.1); + } else if (id == 15198042) { + position = new Vertex(20, 21.3, 4.1); + } else if (id == 15198043) { + position = new Vertex(20, 28.4, 4.1); + } else if (id == 15198044) { + position = new Vertex(20, 35.5, 4.1); + } else if (id == 15198028) { + position = new Vertex(20, 42.6, 4.1); + } } *************** *** 41,44 **** --- 56,75 ---- return id; } + + /** + * + * @param value Vertex + */ + public void setPosition(Vertex value) { + this.position = value; + } + + /** + * + * @return position + */ + public Vertex getPosition() { + return position; + } /** *************** *** 60,66 **** */ public void add(DataItem item) { - System.out.println(" " + item.timestamp() + " | " + lasttime); if (item.timestamp() > lasttime) { - System.out.println(" appending"); items.add(item); lasttime = item.timestamp(); --- 91,95 ---- *************** *** 93,96 **** --- 122,128 ---- ArrayList<Attribute> res = new ArrayList<Attribute>(); res.add(new Attribute("ID", new String(String.valueOf(id)), false)); + res.add(new Attribute("X", new Double(position.getX()))); + res.add(new Attribute("Y", new Double(position.getY()))); + res.add(new Attribute("Z", new Double(position.getZ()))); return res; } |