You can subscribe to this list here.
2005 |
Jan
|
Feb
(14) |
Mar
|
Apr
(4) |
May
(57) |
Jun
(14) |
Jul
(15) |
Aug
(5) |
Sep
(29) |
Oct
(13) |
Nov
(44) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(14) |
Feb
(78) |
Mar
(55) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(12) |
Dec
(9) |
2007 |
Jan
(21) |
Feb
(67) |
Mar
(39) |
Apr
(28) |
May
(7) |
Jun
|
Jul
(6) |
Aug
(2) |
Sep
(1) |
Oct
(18) |
Nov
(8) |
Dec
(11) |
2008 |
Jan
(16) |
Feb
(12) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Johannes Z. <jza...@us...> - 2006-03-09 08:58:37
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9698/src/net/sf/magicmap/client/controller Modified Files: Controller.java Log Message: rfid bugfix Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Controller.java 8 Mar 2006 20:07:14 -0000 1.16 --- Controller.java 9 Mar 2006 08:58:34 -0000 1.17 *************** *** 612,621 **** if (antenna01 != null) { newTag.setX(antenna01.getX()); ! newTag.setY(antenna01.getY()); } } else if (antenna.equals("02")) { if (antenna01 != null) { newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()); } } else if (antenna.equals("03")) { --- 612,621 ---- if (antenna01 != null) { newTag.setX(antenna01.getX()); ! newTag.setY(antenna01.getY()-5); } } else if (antenna.equals("02")) { if (antenna01 != null) { newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()+5); } } else if (antenna.equals("03")) { *************** *** 633,637 **** if (antenna03 != null) { newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()); } } else if (antenna.equals("05")) { --- 633,637 ---- if (antenna03 != null) { newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()-5); } } else if (antenna.equals("05")) { *************** *** 683,687 **** if (antenna04 != null) { newTag.setX(antenna04.getX()); ! newTag.setY(antenna04.getY()); } } else if (antenna.equals("09")) { --- 683,687 ---- if (antenna04 != null) { newTag.setX(antenna04.getX()); ! newTag.setY(antenna04.getY()+5); } } else if (antenna.equals("09")) { *************** *** 819,824 **** public void setRfidPollingActive(boolean rfidPollingActive) { this.rfidPollingActive = rfidPollingActive; ! File file = new File("c:\\windows\\system32\\OBIDISC4J.dll"); ! if (file.exists()) { if (rfidController == null) { try { --- 819,830 ---- public void setRfidPollingActive(boolean rfidPollingActive) { this.rfidPollingActive = rfidPollingActive; ! File file1 = new File("c:\\windows\\system32\\OBIDISC4J.dll"); ! File file2 = new File("c:\\windows\\system32\\FeCom.dll"); ! File file3 = new File("c:\\windows\\system32\\fefu.dll"); ! File file4 = new File("c:\\windows\\system32\\FeUsb.dll"); ! File file5 = new File("c:\\windows\\system32\\fetcp.dll"); ! File file6 = new File("c:\\windows\\system32\\FeIsc.dll"); ! if (file1.exists() && file2.exists() && file3.exists() && ! file4.exists() && file5.exists() && file6.exists()) { if (rfidController == null) { try { |
From: Johannes Z. <jza...@us...> - 2006-03-08 20:07:29
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9267/src/net/sf/magicmap/client/controller Modified Files: Controller.java Log Message: late rfid bugfixes Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Controller.java 7 Mar 2006 20:50:02 -0000 1.15 --- Controller.java 8 Mar 2006 20:07:14 -0000 1.16 *************** *** 599,610 **** while (antennaIterator.hasNext()) { RFIDAntenna rfidAntenna = (RFIDAntenna) antennaIterator.next(); - // if (rfidAntenna.getAntennaId() != null && (antenna.equals(rfidAntenna.getAntennaId()) || - // antenna.equals("05") && rfidAntenna.getAntennaId().equals("03") || - // antenna.equals("08") && rfidAntenna.getAntennaId().equals("04") || - // antenna.equals("09") && rfidAntenna.getAntennaId().equals("04"))) { - // newTag.setX(rfidAntenna.getX()+10); - // newTag.setY(rfidAntenna.getY()+10); - // break; - // } if (rfidAntenna.getAntennaId().equals("01")) { antenna01 = rfidAntenna; --- 599,602 ---- *************** *** 628,674 **** } } else if (antenna.equals("03")) { ! if (antenna01 != null) { newTag.setX(antenna01.getX()); newTag.setY(antenna01.getY()); ! } ! } else if (antenna.equals("04")) { ! if (antenna01 != null) { newTag.setX(antenna03.getX()); newTag.setY(antenna03.getY()); } } else if (antenna.equals("05")) { ! } else if (antenna.equals("06")) { ! } else if (antenna.equals("07")) { ! if (antenna01 != null) { newTag.setX(antenna01.getX()); newTag.setY(antenna01.getY()); ! } ! } else if (antenna.equals("08")) { ! if (antenna01 != null) { newTag.setX(antenna04.getX()); newTag.setY(antenna04.getY()); } } else if (antenna.equals("09")) { ! if (antenna01 != null) { newTag.setX(antenna01.getX()); newTag.setY(antenna01.getY()); } ! ! } else if (antenna.equals("10")) { ! ! } else if (antenna.equals("11")) { ! ! } else if (antenna.equals("12")) { ! ! } else if (antenna.equals("13")) { ! ! } else if (antenna.equals("14")) { ! ! } else if (antenna.equals("15")) { ! } --- 620,792 ---- } } else if (antenna.equals("03")) { ! if (antenna01 != null && antenna02 != null) { ! newTag.setX((antenna01.getX() + antenna02.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna02.getY()) / 2); ! } else if (antenna01 != null) { newTag.setX(antenna01.getX()); newTag.setY(antenna01.getY()); ! } else if (antenna02 != null) { ! newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()); ! } } else if (antenna.equals("04")) { ! if (antenna03 != null) { newTag.setX(antenna03.getX()); newTag.setY(antenna03.getY()); } } else if (antenna.equals("05")) { ! if (antenna01 != null && antenna03 != null) { ! newTag.setX((antenna01.getX() + antenna03.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna03.getY()) / 2); ! } else if (antenna01 != null) { ! newTag.setX(antenna01.getX()); ! newTag.setY(antenna01.getY()); ! } else if (antenna03 != null) { ! newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()); ! } } else if (antenna.equals("06")) { ! if (antenna02 != null && antenna03 != null) { ! newTag.setX((antenna02.getX() + antenna03.getX()) / 2); ! newTag.setY((antenna02.getY() + antenna03.getY()) / 2); ! } else if (antenna02 != null) { ! newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()); ! } else if (antenna03 != null) { ! newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()); ! } } else if (antenna.equals("07")) { ! if (antenna01 != null && antenna02 != null && antenna03 != null) { ! newTag.setX((antenna01.getX() + antenna02.getX() + antenna03.getX()) / 3); ! newTag.setY((antenna01.getY() + antenna02.getY() + antenna03.getY()) / 3); ! } else if (antenna01 != null && antenna02 != null) { ! newTag.setX((antenna01.getX() + antenna02.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna02.getY()) / 2); ! } else if (antenna01 != null && antenna03 != null) { ! newTag.setX((antenna01.getX() + antenna03.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna03.getY()) / 2); ! } else if (antenna02 != null && antenna03 != null) { ! newTag.setX((antenna02.getX() + antenna03.getX()) / 2); ! newTag.setY((antenna02.getY() + antenna03.getY()) / 2); ! } else if (antenna01 != null) { newTag.setX(antenna01.getX()); newTag.setY(antenna01.getY()); ! } else if (antenna02 != null) { ! newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()); ! } else if (antenna03 != null) { ! newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()); ! } } else if (antenna.equals("08")) { ! if (antenna04 != null) { newTag.setX(antenna04.getX()); newTag.setY(antenna04.getY()); } } else if (antenna.equals("09")) { ! if (antenna01 != null && antenna04 != null) { ! newTag.setX((antenna01.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna04.getY()) / 2); ! } else if (antenna01 != null) { newTag.setX(antenna01.getX()); newTag.setY(antenna01.getY()); + } else if (antenna04 != null) { + newTag.setX(antenna04.getX()); + newTag.setY(antenna04.getY()); } ! } else if (antenna.equals("0A")) { ! if (antenna02 != null && antenna04 != null) { ! newTag.setX((antenna02.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna02.getY() + antenna04.getY()) / 2); ! } else if (antenna02 != null) { ! newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()); ! } else if (antenna04 != null) { ! newTag.setX(antenna04.getX()); ! newTag.setY(antenna04.getY()); ! } ! } else if (antenna.equals("0B")) { ! if (antenna01 != null && antenna02 != null && antenna04 != null) { ! newTag.setX((antenna01.getX() + antenna02.getX() + antenna04.getX()) / 3); ! newTag.setY((antenna01.getY() + antenna02.getY() + antenna04.getY()) / 3); ! } else if (antenna01 != null && antenna02 != null) { ! newTag.setX((antenna01.getX() + antenna02.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna02.getY()) / 2); ! } else if (antenna01 != null && antenna04 != null) { ! newTag.setX((antenna01.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna04.getY()) / 2); ! } else if (antenna02 != null && antenna04 != null) { ! newTag.setX((antenna02.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna02.getY() + antenna04.getY()) / 2); ! } else if (antenna01 != null) { ! newTag.setX(antenna01.getX()); ! newTag.setY(antenna01.getY()); ! } else if (antenna02 != null) { ! newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()); ! } else if (antenna04 != null) { ! newTag.setX(antenna04.getX()); ! newTag.setY(antenna04.getY()); ! } ! } else if (antenna.equals("0C")) { ! if (antenna03 != null && antenna04 != null) { ! newTag.setX((antenna03.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna03.getY() + antenna04.getY()) / 2); ! } else if (antenna03 != null) { ! newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()); ! } else if (antenna04 != null) { ! newTag.setX(antenna04.getX()); ! newTag.setY(antenna04.getY()); ! } ! } else if (antenna.equals("0D")) { ! if (antenna01 != null && antenna03 != null && antenna04 != null) { ! newTag.setX((antenna01.getX() + antenna03.getX() + antenna04.getX()) / 3); ! newTag.setY((antenna01.getY() + antenna03.getY() + antenna04.getY()) / 3); ! } else if (antenna01 != null && antenna03 != null) { ! newTag.setX((antenna01.getX() + antenna03.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna03.getY()) / 2); ! } else if (antenna01 != null && antenna04 != null) { ! newTag.setX((antenna01.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna01.getY() + antenna04.getY()) / 2); ! } else if (antenna03 != null && antenna04 != null) { ! newTag.setX((antenna03.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna03.getY() + antenna04.getY()) / 2); ! } else if (antenna01 != null) { ! newTag.setX(antenna01.getX()); ! newTag.setY(antenna01.getY()); ! } else if (antenna03 != null) { ! newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()); ! } else if (antenna04 != null) { ! newTag.setX(antenna04.getX()); ! newTag.setY(antenna04.getY()); ! } ! } else if (antenna.equals("0E")) { ! if (antenna02 != null && antenna03 != null && antenna04 != null) { ! newTag.setX((antenna02.getX() + antenna03.getX() + antenna04.getX()) / 3); ! newTag.setY((antenna02.getY() + antenna03.getY() + antenna04.getY()) / 3); ! } else if (antenna02 != null && antenna03 != null) { ! newTag.setX((antenna02.getX() + antenna03.getX()) / 2); ! newTag.setY((antenna02.getY() + antenna03.getY()) / 2); ! } else if (antenna02 != null && antenna04 != null) { ! newTag.setX((antenna02.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna02.getY() + antenna04.getY()) / 2); ! } else if (antenna03 != null && antenna04 != null) { ! newTag.setX((antenna03.getX() + antenna04.getX()) / 2); ! newTag.setY((antenna03.getY() + antenna04.getY()) / 2); ! } else if (antenna02 != null) { ! newTag.setX(antenna02.getX()); ! newTag.setY(antenna02.getY()); ! } else if (antenna03 != null) { ! newTag.setX(antenna03.getX()); ! newTag.setY(antenna03.getY()); ! } else if (antenna04 != null) { ! newTag.setX(antenna04.getX()); ! newTag.setY(antenna04.getY()); ! } ! } else if (antenna.equals("0F")) { ! //not implemented } |
From: Johannes Z. <jza...@us...> - 2006-03-08 20:07:22
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9267/src/net/sf/magicmap/client/gui/dialogs Modified Files: RFIDAntennaDialog.java Log Message: late rfid bugfixes Index: RFIDAntennaDialog.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/RFIDAntennaDialog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RFIDAntennaDialog.java 7 Mar 2006 16:11:16 -0000 1.3 --- RFIDAntennaDialog.java 8 Mar 2006 20:07:14 -0000 1.4 *************** *** 86,91 **** builder.setLeft("urllabel", 20); builder.setRightRightDistance("url", null, -20); ! builder.setTopBottomDistance("urllabel", "header", 20); ! builder.setTopBottomDistance("url", "header", 20); //id --- 86,91 ---- builder.setLeft("urllabel", 20); builder.setRightRightDistance("url", null, -20); ! builder.setTopBottomDistance("urllabel", "header", 30); ! builder.setTopBottomDistance("url", "header", 30); //id *************** *** 94,99 **** builder.setLeft("idlabel", 20); builder.setRightRightDistance("id", null, -20); ! builder.setTopBottomDistance("idlabel", "header", 5); ! builder.setTopBottomDistance("id", "header", 5); } --- 94,99 ---- builder.setLeft("idlabel", 20); builder.setRightRightDistance("id", null, -20); ! builder.setTopBottomDistance("idlabel", "header", 10); ! builder.setTopBottomDistance("id", "header", 10); } |
From: Johannes Z. <jza...@us...> - 2006-03-08 20:07:19
|
Update of /cvsroot/magicmap/magicmapclient/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9267/res Modified Files: screentext_de_DE.properties Log Message: late rfid bugfixes Index: screentext_de_DE.properties =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/res/screentext_de_DE.properties,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** screentext_de_DE.properties 6 Mar 2006 22:18:58 -0000 1.11 --- screentext_de_DE.properties 8 Mar 2006 20:07:14 -0000 1.12 *************** *** 112,116 **** rfidantenna=RFID-Antenne setzen setrfidantenna=Eine RFID-Antenne positionieren ! setrfidantennahint=Geben Sie bitte einen Identifikator an nonserverconnect=Kein Server (Standalone) showedgesforselectednode=Zeige nur die Kanten für den selektierten Knoten --- 112,116 ---- rfidantenna=RFID-Antenne setzen setrfidantenna=Eine RFID-Antenne positionieren ! setrfidantennahint=Geben Sie bitte eine Bezeichnung an nonserverconnect=Kein Server (Standalone) showedgesforselectednode=Zeige nur die Kanten für den selektierten Knoten |
From: Johannes Z. <jza...@us...> - 2006-03-07 20:50:10
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/views In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23649/src/net/sf/magicmap/client/views Modified Files: MapView.java Log Message: Major RFID enhancements Index: MapView.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/views/MapView.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MapView.java 28 Feb 2006 11:23:16 -0000 1.17 --- MapView.java 7 Mar 2006 20:50:03 -0000 1.18 *************** *** 41,44 **** --- 41,45 ---- import net.sf.magicmap.client.model.node.Node; import net.sf.magicmap.client.model.node.NodeModel; + import net.sf.magicmap.client.model.node.RFIDTag; import com.brunchboy.util.swing.relativelayout.AttributeConstraint; *************** *** 813,816 **** --- 814,821 ---- */ public void nodeUpdatedEvent(Node node, int type, Object data){ + if (type == NodeModel.NODETYPE_RFID_TAG) { + RFIDTag tag = (RFIDTag) data; + node.setPosition(tag.getX(), tag.getY()); + } if (type == NodeModel.UPDATE_SEESACCESSPOINT){ // Wird aufgerufen, wenn neuer AccessPoint gesehen wird oder alter mit |
From: Johannes Z. <jza...@us...> - 2006-03-07 20:50:09
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23649/src/net/sf/magicmap/client/controller Modified Files: PollHandler.java Controller.java Log Message: Major RFID enhancements Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Controller.java 7 Mar 2006 16:11:15 -0000 1.14 --- Controller.java 7 Mar 2006 20:50:02 -0000 1.15 *************** *** 593,615 **** newTag.setAntenna(antenna); Iterator antennaIterator = rfidAntennas.iterator(); while (antennaIterator.hasNext()) { RFIDAntenna rfidAntenna = (RFIDAntenna) antennaIterator.next(); ! if (rfidAntenna.getAntennaId() != null && (antenna.equals(rfidAntenna.getAntennaId()) || ! antenna.equals("05") && rfidAntenna.getAntennaId().equals("03") || ! antenna.equals("08") && rfidAntenna.getAntennaId().equals("04") || ! antenna.equals("09") && rfidAntenna.getAntennaId().equals("04"))) { ! newTag.setX(rfidAntenna.getX()+10); ! newTag.setY(rfidAntenna.getY()+10); ! break; ! } } if (rfidTags.contains(newTag)) { int index = rfidTags.indexOf(newTag); ((RFIDTag) rfidTags.get(index)).setTimestamp(timestamp); ! getNodeModel().updateNode(getNodeModel().findNode(newTag.getUrl()), NodeModel.NODETYPE_RFID_TAG, null); } else { ! RFIDTag tag = new RFIDTag(id, timestamp); ! tag.setMap(getInstance().getCurrentMap().name); ! rfidTags.add(tag); } --- 593,683 ---- newTag.setAntenna(antenna); Iterator antennaIterator = rfidAntennas.iterator(); + RFIDAntenna antenna01 = null; + RFIDAntenna antenna02 = null; + RFIDAntenna antenna03 = null; + RFIDAntenna antenna04 = null; while (antennaIterator.hasNext()) { RFIDAntenna rfidAntenna = (RFIDAntenna) antennaIterator.next(); ! // if (rfidAntenna.getAntennaId() != null && (antenna.equals(rfidAntenna.getAntennaId()) || ! // antenna.equals("05") && rfidAntenna.getAntennaId().equals("03") || ! // antenna.equals("08") && rfidAntenna.getAntennaId().equals("04") || ! // antenna.equals("09") && rfidAntenna.getAntennaId().equals("04"))) { ! // newTag.setX(rfidAntenna.getX()+10); ! // newTag.setY(rfidAntenna.getY()+10); ! // break; ! // } ! if (rfidAntenna.getAntennaId().equals("01")) { ! antenna01 = rfidAntenna; ! } else if (rfidAntenna.getAntennaId().equals("02")) { ! antenna02 = rfidAntenna; ! } else if (rfidAntenna.getAntennaId().equals("03")) { ! antenna03 = rfidAntenna; ! } else if (rfidAntenna.getAntennaId().equals("04")) { ! antenna04 = rfidAntenna; ! } } + if (antenna.equals("01")) { + if (antenna01 != null) { + newTag.setX(antenna01.getX()); + newTag.setY(antenna01.getY()); + } + } else if (antenna.equals("02")) { + if (antenna01 != null) { + newTag.setX(antenna02.getX()); + newTag.setY(antenna02.getY()); + } + } else if (antenna.equals("03")) { + if (antenna01 != null) { + newTag.setX(antenna01.getX()); + newTag.setY(antenna01.getY()); + } + + } else if (antenna.equals("04")) { + if (antenna01 != null) { + newTag.setX(antenna03.getX()); + newTag.setY(antenna03.getY()); + } + } else if (antenna.equals("05")) { + + } else if (antenna.equals("06")) { + + } else if (antenna.equals("07")) { + if (antenna01 != null) { + newTag.setX(antenna01.getX()); + newTag.setY(antenna01.getY()); + } + + } else if (antenna.equals("08")) { + if (antenna01 != null) { + newTag.setX(antenna04.getX()); + newTag.setY(antenna04.getY()); + } + } else if (antenna.equals("09")) { + if (antenna01 != null) { + newTag.setX(antenna01.getX()); + newTag.setY(antenna01.getY()); + } + + } else if (antenna.equals("10")) { + + } else if (antenna.equals("11")) { + + } else if (antenna.equals("12")) { + + } else if (antenna.equals("13")) { + + } else if (antenna.equals("14")) { + + } else if (antenna.equals("15")) { + + } + if (rfidTags.contains(newTag)) { int index = rfidTags.indexOf(newTag); ((RFIDTag) rfidTags.get(index)).setTimestamp(timestamp); ! getNodeModel().updateNode(getNodeModel().findNode(newTag.getUrl()), NodeModel.NODETYPE_RFID_TAG, newTag); } else { ! newTag.setMap(getInstance().getCurrentMap().name); ! rfidTags.add(newTag); } Index: PollHandler.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PollHandler.java 6 Mar 2006 22:21:42 -0000 1.9 --- PollHandler.java 7 Mar 2006 20:50:02 -0000 1.10 *************** *** 506,510 **** if (tag.getMap().equals(Controller.getInstance().getCurrentMap().name)) { nodeModel.addNode(rfidTagNode); ! rfidTagNode.setFix(true); rfidTagNode.setPosition(tag.getX(), tag.getY()); } --- 506,510 ---- if (tag.getMap().equals(Controller.getInstance().getCurrentMap().name)) { nodeModel.addNode(rfidTagNode); ! // rfidTagNode.setFix(true); rfidTagNode.setPosition(tag.getX(), tag.getY()); } |
From: Johannes Z. <jza...@us...> - 2006-03-07 20:50:06
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23649/src/net/sf/magicmap/client/gui Modified Files: MapPanel.java Log Message: Major RFID enhancements Index: MapPanel.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MapPanel.java 6 Mar 2006 22:21:43 -0000 1.16 --- MapPanel.java 7 Mar 2006 20:50:02 -0000 1.17 *************** *** 39,42 **** --- 39,43 ---- import net.sf.magicmap.client.model.node.RFIDAntenna; import net.sf.magicmap.client.model.node.RFIDAntennaNode; + import net.sf.magicmap.client.model.node.RFIDTag; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.views.MapView; *************** *** 393,409 **** */ void createRFIDTag() { ! String r = JOptionPane.showInputDialog(this, GUIUtils.i18n("locationname")); ! if (r != null){ ! Date date = new Date(); ! String timeAsString = new SimpleDateFormat(Settings.TIME_DATE_FORMAT).format(date); ! ! /*TODO: WORKAROUND, die Position hat alle nötigen Informationen (Client, der sie angelegt/verändert hat), Zeitpunkt der letzten Änderung, ! * daher sollte die Information über den Client und der Zeitpunkt des Anlegens einer Position !!!NICHT!!! in ihrem Namen gespeichert werden!!!! ! * ! * todo: Hier den Client und den Zeitpunkt aus dem Namen entfernen, Information nur beim Darstellen auf der Karte aus dem PositionDTO nehmen! ! */ ! Controller.getInstance().createLocation(getLastX(), getLastY(), ! (r + " (" + Controller.getInstance().getClient().getName() + ") <" + timeAsString + ">"), true, this); ! } } --- 394,398 ---- */ void createRFIDTag() { ! //currently doing nothing } |
From: Johannes Z. <jza...@us...> - 2006-03-07 20:50:05
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23649/src/net/sf/magicmap/client/utils Modified Files: Settings.java Log Message: Major RFID enhancements Index: Settings.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/utils/Settings.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Settings.java 7 Feb 2006 16:05:00 -0000 1.8 --- Settings.java 7 Mar 2006 20:50:02 -0000 1.9 *************** *** 40,45 **** public static String NIGHTLY = ""; ! public static String hostname = "phl.informatik.hu-berlin.de"; ! public static int port = 80; --- 40,46 ---- public static String NIGHTLY = ""; ! // public static String hostname = "phl.informatik.hu-berlin.de";public static String ! public static String hostname = "192.168.200.218"; ! public static int port = 8080; |
From: Andreas W. <an...@us...> - 2006-03-07 17:24:57
|
Update of /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31404/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java Log Message: Logger for CEBIT Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PositionFacade2.java 7 Mar 2006 15:02:02 -0000 1.14 --- PositionFacade2.java 7 Mar 2006 17:24:28 -0000 1.15 *************** *** 2,5 **** --- 2,8 ---- package net.sf.magicmap.server.facade; + import java.io.FileNotFoundException; + import java.io.FileOutputStream; + import java.io.FileWriter; import java.rmi.RemoteException; import java.util.Collection; *************** *** 24,27 **** --- 27,31 ---- import org.apache.log4j.Category; + import org.apache.log4j.FileAppender; public class PositionFacade2 implements PositionFacadeInterface { *************** *** 92,95 **** --- 96,126 ---- pos.setPosY(positionY); PositionCache.getPositionCache().createOrUpdatePosition(map, pos, client.getMac()); + + FileWriter fw; + String string; + int i = 0; + try{ + fw = new FileWriter("referenzpunkt.txt", true); + while (i < character.getSimpleScanResults().length){ + string = "TimeStamp: " + System.currentTimeMillis() + + " SessionID: " + sessionId + + " PositionName: " + positionName + + " MapName: " + mapName + + " Postition.X " + positionX + + " Postition.Y " + positionY + + " Fixed: " + fixed + + " Character.getMacAP " + character.getSimpleScanResults()[i].getMacAP() + + " Character.LastSeen: " + character.getSimpleScanResults()[i].getLastSeen() + + " Character.noise " + character.getSimpleScanResults()[i].getNoise() + + " Character.SignalLevel: " + character.getSimpleScanResults()[i].getSignalLevel() + + " \n"; + fw.write(string, 0, string.length()); + ++i; + } + fw.flush(); + fw.close(); + } catch (Exception e){ + e.printStackTrace(); + } } *************** *** 219,222 **** --- 250,254 ---- SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, MapException{ this.logger.info("createOrUpdateClientPosition()"); + PersistenceManager pm = null; try{ *************** *** 273,276 **** --- 305,335 ---- pos.setPosY(positionY); PositionCache.getPositionCache().createOrUpdatePosition(map, pos); + + FileWriter fw; + String string; + int i = 0; + try{ + fw = new FileWriter("client.txt", true); + while (i < character.getSimpleScanResults().length){ + string = "TimeStamp: " + System.currentTimeMillis() + + " SessionID: " + sessionId + + " ClientMAC: " + clientMac + + " MapName: " + mapName + + " Postition.X " + positionX + + " Postition.Y " + positionY + + " Fixed: " + fixed + + " Character.MacAP " + character.getSimpleScanResults()[i].getMacAP() + + " Character.LastSeen: " + character.getSimpleScanResults()[i].getLastSeen() + + " Character.noise " + character.getSimpleScanResults()[i].getNoise() + + " Character.SignalLevel: " + character.getSimpleScanResults()[i].getSignalLevel() + + " \n"; + fw.write(string, 0, string.length()); + ++i; + } + fw.flush(); + fw.close(); + } catch (Exception e){ + e.printStackTrace(); + } } *************** *** 462,469 **** Map map = checkMap(mapName, pm); ! PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map,accessPointMac); if (pos != null && pos.getAccessPoint() != null){ ! pos.getAccessPoint().setHidden(hidden); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos); }else { pos = new PositionDTO(); --- 521,528 ---- Map map = checkMap(mapName, pm); ! PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map, accessPointMac); if (pos != null && pos.getAccessPoint() != null){ ! pos.getAccessPoint().setHidden(hidden); ! PositionCache.getPositionCache().createOrUpdatePosition(map, pos); }else { pos = new PositionDTO(); |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:12:07
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/src/net/sf/magicmap/client/gui/dialogs Modified Files: RFIDAntennaDialog.java Log Message: added RFID library check added RFID functionality Index: RFIDAntennaDialog.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/dialogs/RFIDAntennaDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RFIDAntennaDialog.java 28 Feb 2006 12:40:29 -0000 1.2 --- RFIDAntennaDialog.java 7 Mar 2006 16:11:16 -0000 1.3 *************** *** 10,13 **** --- 10,14 ---- import javax.swing.JButton; + import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JFrame; *************** *** 34,38 **** private RFIDAntenna antenna; ! private JTextField id; public static RFIDAntenna showDialog(JFrame owner) { --- 35,40 ---- private RFIDAntenna antenna; ! private JComboBox id; ! private JTextField url; public static RFIDAntenna showDialog(JFrame owner) { *************** *** 79,90 **** getRootPane().setDefaultButton(okButton); //id ! id = builder.addTextField("id"); builder.addLabel("ID", "idlabel", id); builder.setLeft("idlabel", 20); builder.setRightRightDistance("id", null, -20); ! builder.setTopBottomDistance("idlabel", "header", 20); ! builder.setTopBottomDistance("id", "header", 20); } --- 81,99 ---- getRootPane().setDefaultButton(okButton); + // url + url = builder.addTextField("url"); + builder.addLabel("URL", "urllabel", url); + builder.setLeft("urllabel", 20); + builder.setRightRightDistance("url", null, -20); + builder.setTopBottomDistance("urllabel", "header", 20); + builder.setTopBottomDistance("url", "header", 20); //id ! id = builder.addComboBox(new String[] {"01", "02", "03", "04"}, "id"); builder.addLabel("ID", "idlabel", id); builder.setLeft("idlabel", 20); builder.setRightRightDistance("id", null, -20); ! builder.setTopBottomDistance("idlabel", "header", 5); ! builder.setTopBottomDistance("id", "header", 5); } *************** *** 94,98 **** public void actionPerformed(ActionEvent e) { if ("OK".equals(e.getActionCommand())) { ! this.antenna = new RFIDAntenna(id.getText(), -1, -1, ""); this.setVisible(false); } else if ("CANCEL".equals(e.getActionCommand())){ --- 103,108 ---- public void actionPerformed(ActionEvent e) { if ("OK".equals(e.getActionCommand())) { ! this.antenna = new RFIDAntenna((String) id.getSelectedItem(), url.getText(), -1, -1, ""); ! antenna.setAntennaId((String) id.getSelectedItem()); this.setVisible(false); } else if ("CANCEL".equals(e.getActionCommand())){ |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:11:59
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/src/net/sf/magicmap/client/controller Modified Files: Controller.java VirtualServerManager.java ServerManager.java SOAPServerManager.java Removed Files: RFIDTagRead.java RFIDTagReader.java RFIDController.java Log Message: added RFID library check added RFID functionality --- RFIDController.java DELETED --- Index: VirtualServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** VirtualServerManager.java 6 Mar 2006 22:21:42 -0000 1.9 --- VirtualServerManager.java 7 Mar 2006 16:11:15 -0000 1.10 *************** *** 27,30 **** --- 27,31 ---- import net.sf.magicmap.client.model.node.InfoObject; import net.sf.magicmap.client.model.node.RFIDAntenna; + import net.sf.magicmap.client.model.node.RFIDTag; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.utils.Version; *************** *** 579,581 **** --- 580,591 ---- } + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#createRFIDTag(int, int, boolean, net.sf.magicmap.client.model.node.RFIDTag, java.lang.String, net.sf.magicmap.client.interfaces.CreatePositionCallback) + */ + @Override + public void createRFIDTag(int x, int y, boolean fixed, RFIDTag tag, String mapName, CreatePositionCallback callback) { + // TODO Auto-generated method stub + + } + } \ No newline at end of file Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Controller.java 6 Mar 2006 22:21:42 -0000 1.13 --- Controller.java 7 Mar 2006 16:11:15 -0000 1.14 *************** *** 5,8 **** --- 5,9 ---- package net.sf.magicmap.client.controller; + import java.io.File; import java.io.IOException; import java.net.InetAddress; *************** *** 11,21 **** import java.util.ArrayList; import java.util.Collection; ! import java.util.HashMap; ! ! import de.feig.FedmException; ! import de.feig.FedmIscReader; import net.sf.magicmap.client.gui.MainGUI; - import net.sf.magicmap.client.gui.MapPanel; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; --- 12,19 ---- import java.util.ArrayList; import java.util.Collection; ! import java.util.Iterator; + import net.sf.magicmap.client.controller.rfid.RFIDController; import net.sf.magicmap.client.gui.MainGUI; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; *************** *** 51,54 **** --- 49,54 ---- import net.sf.magicmap.client.views.MeasurementView; import net.sf.magicmap.client.views.OutlineView; + import de.feig.FedmException; + import de.feig.FedmIscReader; /** *************** *** 87,91 **** private Collection rfidAntennas; private ArrayList rfidTags; - private HashMap rfidDataChunks; private RFIDController rfidController; --- 87,90 ---- *************** *** 129,141 **** rfidAntennas = new ArrayList(); rfidTags = new ArrayList(); - try { - rfidController = new RFIDController(new FedmIscReader()); - } catch (FedmException e) { - System.err.println("error creating RFID controller"); - } catch (Exception e) { - System.err.println("error creating RFID controller"); - } setRfidPollingActive(false); - initializeScanner(); } --- 128,132 ---- *************** *** 597,607 **** } ! public void addRfidTag(String id){ long timestamp = System.currentTimeMillis(); ! if (rfidTags.contains(id)){ ! int index = rfidTags.indexOf(id); ((RFIDTag) rfidTags.get(index)).setTimestamp(timestamp); } else { ! rfidTags.add(new RFIDTag(id, timestamp)); } } --- 588,623 ---- } ! public void addRfidTag(String id, String antenna) { long timestamp = System.currentTimeMillis(); ! RFIDTag newTag = new RFIDTag(id, timestamp); ! newTag.setAntenna(antenna); ! Iterator antennaIterator = rfidAntennas.iterator(); ! while (antennaIterator.hasNext()) { ! RFIDAntenna rfidAntenna = (RFIDAntenna) antennaIterator.next(); ! if (rfidAntenna.getAntennaId() != null && (antenna.equals(rfidAntenna.getAntennaId()) || ! antenna.equals("05") && rfidAntenna.getAntennaId().equals("03") || ! antenna.equals("08") && rfidAntenna.getAntennaId().equals("04") || ! antenna.equals("09") && rfidAntenna.getAntennaId().equals("04"))) { ! newTag.setX(rfidAntenna.getX()+10); ! newTag.setY(rfidAntenna.getY()+10); ! break; ! } ! } ! if (rfidTags.contains(newTag)) { ! int index = rfidTags.indexOf(newTag); ((RFIDTag) rfidTags.get(index)).setTimestamp(timestamp); + getNodeModel().updateNode(getNodeModel().findNode(newTag.getUrl()), NodeModel.NODETYPE_RFID_TAG, null); } else { ! RFIDTag tag = new RFIDTag(id, timestamp); ! tag.setMap(getInstance().getCurrentMap().name); ! rfidTags.add(tag); ! ! } ! for (int i=0; i<rfidTags.size(); i++) { ! RFIDTag tag = (RFIDTag) rfidTags.get(i); ! if (timestamp - tag.getTimestamp() > 10000) { ! getNodeModel().removeNode(getNodeModel().findNode(tag.getUrl())); ! rfidTags.remove(i); ! } } } *************** *** 617,620 **** --- 633,656 ---- public void setRfidPollingActive(boolean rfidPollingActive) { this.rfidPollingActive = rfidPollingActive; + File file = new File("c:\\windows\\system32\\OBIDISC4J.dll"); + if (file.exists()) { + if (rfidController == null) { + try { + rfidController = new RFIDController(new FedmIscReader()); + } catch (FedmException e) { + System.err.println("error creating RFID controller"); + } catch (Exception e) { + System.err.println("error creating RFID controller"); + } + } + if (rfidPollingActive) { + rfidController.connect(); + rfidController.activatePolling(); + } else { + rfidController.deactivatePolling(); + rfidController.disconnect(); + rfidTags.clear(); + } + } } --- RFIDTagReader.java DELETED --- Index: SOAPServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SOAPServerManager.java 6 Mar 2006 22:21:42 -0000 1.10 --- SOAPServerManager.java 7 Mar 2006 16:11:15 -0000 1.11 *************** *** 34,37 **** --- 34,38 ---- import net.sf.magicmap.client.model.node.InfoObject; import net.sf.magicmap.client.model.node.RFIDAntenna; + import net.sf.magicmap.client.model.node.RFIDTag; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.utils.Version; *************** *** 330,334 **** synchronized (mutex){ try{ ! SOAPServerManager.this.mapDelegate.createRFIDAntenna(sessionId, mapName, x, y, antenna.getURL()); } catch (Exception e){ callback.positionCreationError(e); --- 331,335 ---- synchronized (mutex){ try{ ! SOAPServerManager.this.mapDelegate.createRFIDAntenna(antenna.getAntennaId(), sessionId, mapName, x, y, antenna.getURL()); } catch (Exception e){ callback.positionCreationError(e); *************** *** 340,343 **** --- 341,370 ---- } } + + + + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#createRFIDTag(int, int, boolean, net.sf.magicmap.client.model.node.RFIDTag, java.lang.String, net.sf.magicmap.client.interfaces.CreatePositionCallback) + */ + @Override + public void createRFIDTag(final int x, final int y, final boolean fixed, + final RFIDTag tag, final String mapName, final CreatePositionCallback callback) { + + if (isConnected()){ + Thread createRFIDTagThread = new Thread() { + + public void run(){ + synchronized (mutex){ + try{ + SOAPServerManager.this.mapDelegate.createRFIDTag(sessionId, mapName, x, y, tag.getUrl()); + } catch (Exception e){ + callback.positionCreationError(e); + } + } + } + }; + createRFIDTagThread.start(); + } + } /** --- RFIDTagRead.java DELETED --- Index: ServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ServerManager.java 6 Mar 2006 22:21:42 -0000 1.14 --- ServerManager.java 7 Mar 2006 16:11:15 -0000 1.15 *************** *** 34,37 **** --- 34,38 ---- import net.sf.magicmap.client.model.node.InfoObject; import net.sf.magicmap.client.model.node.RFIDAntenna; + import net.sf.magicmap.client.model.node.RFIDTag; import net.sf.magicmap.server.dto.PositionDTO; import net.sf.magicmap.server.dto.SignalCharacterDTO; *************** *** 179,182 **** --- 180,186 ---- public abstract void createRFIDAntenna(final int x, final int y, final boolean fixed, final RFIDAntenna antenna, final String mapName, final CreatePositionCallback callback); + + public abstract void createRFIDTag(final int x, final int y, final boolean fixed, final RFIDTag tag, + final String mapName, final CreatePositionCallback callback); /** |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:11:55
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/src/net/sf/magicmap/client/model/node Modified Files: RFIDTag.java RFIDAntenna.java Log Message: added RFID library check added RFID functionality Index: RFIDTag.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node/RFIDTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RFIDTag.java 28 Feb 2006 11:23:16 -0000 1.1 --- RFIDTag.java 7 Mar 2006 16:11:16 -0000 1.2 *************** *** 4,7 **** --- 4,9 ---- package net.sf.magicmap.client.model.node; + import net.sf.magicmap.client.meta.MapInfo; + /** * @author Johannes Zapotoczky (joh...@za...) *************** *** 11,15 **** private String url; ! private int x; private int y; --- 13,18 ---- private String url; ! private String antenna; ! private int x; private int y; *************** *** 42,48 **** } ! public boolean equals(RFIDTag tag2) { ! return url.equals(tag2.getUrl()); } public long getTimestamp() { --- 45,54 ---- } ! public boolean equals(Object tag2) { ! String url2 = ((RFIDTag)tag2).getUrl(); ! return url.equals(url2); } + + public long getTimestamp() { *************** *** 54,56 **** --- 60,82 ---- } + public void setMap(String map) { + this.map = map; + } + + public void setX(int x) { + this.x = x; + } + + public void setY(int y) { + this.y = y; + } + + public String getAntenna() { + return antenna; + } + + public void setAntenna(String antenna) { + this.antenna = antenna; + } + } Index: RFIDAntenna.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node/RFIDAntenna.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RFIDAntenna.java 28 Feb 2006 11:23:16 -0000 1.1 --- RFIDAntenna.java 7 Mar 2006 16:11:16 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- private String url; + private String antennaId; private int x; *************** *** 19,23 **** * */ ! public RFIDAntenna(String url, int x, int y, String mapName) { this.url = url; this.x = x; --- 20,25 ---- * */ ! public RFIDAntenna(String id, String url, int x, int y, String mapName) { ! this.antennaId = id; this.url = url; this.x = x; *************** *** 46,48 **** --- 48,58 ---- } + public String getAntennaId() { + return antennaId; + } + + public void setAntennaId(String antennaId) { + this.antennaId = antennaId; + } + } |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:11:52
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/src/net/sf/magicmap/client/delegate Modified Files: MapDelegate.java Log Message: added RFID library check added RFID functionality Index: MapDelegate.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/MapDelegate.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MapDelegate.java 6 Mar 2006 22:21:43 -0000 1.8 --- MapDelegate.java 7 Mar 2006 16:11:15 -0000 1.9 *************** *** 16,21 **** --- 16,23 ---- import net.sf.magicmap.client.delegate.exception.ExceptionHandler; import net.sf.magicmap.client.delegate.interfaces.MapFacadeInterface; + import net.sf.magicmap.client.meta.MapInfo; import net.sf.magicmap.client.model.node.InfoObject; import net.sf.magicmap.client.model.node.RFIDAntenna; + import net.sf.magicmap.client.model.node.RFIDTag; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.server.dto.GeoPointDTO; *************** *** 131,136 **** * @see net.sf.magicmap.client.delegate.interfaces.MapFacadeInterface#createRFIDAntenna(long, java.lang.String, int, int, java.lang.String) */ ! public void createRFIDAntenna(long sessionId, String mapName, int x, int y, String url) { ! Controller.getInstance().getRfidAntennas().add(new RFIDAntenna(url, x, y, mapName)); } --- 133,149 ---- * @see net.sf.magicmap.client.delegate.interfaces.MapFacadeInterface#createRFIDAntenna(long, java.lang.String, int, int, java.lang.String) */ ! public void createRFIDAntenna(String antennaId, long sessionId, String mapName, int x, int y, String url) { ! Controller.getInstance().getRfidAntennas().add(new RFIDAntenna(antennaId, url, x, y, mapName)); ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.delegate.interfaces.MapFacadeInterface#createRFIDTag(long, java.lang.String, int, int, java.lang.String) ! */ ! public void createRFIDTag(long sessionId, String mapName, int x, int y, String url) { ! RFIDTag tag = new RFIDTag(url, sessionId); ! tag.setX(x); ! tag.setY(y); ! tag.setMap(mapName); ! Controller.getInstance().getRfidTags().add(tag); } |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:11:34
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/src/net/sf/magicmap/client/delegate/interfaces Modified Files: MapFacadeInterface.java Log Message: added RFID library check added RFID functionality Index: MapFacadeInterface.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/interfaces/MapFacadeInterface.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MapFacadeInterface.java 28 Feb 2006 11:23:16 -0000 1.4 --- MapFacadeInterface.java 7 Mar 2006 16:11:18 -0000 1.5 *************** *** 113,117 **** * @param url */ ! public abstract void createRFIDAntenna(long sessionId, String mapName, int x, int y, String url); } \ No newline at end of file --- 113,119 ---- * @param url */ ! public abstract void createRFIDAntenna(String antennaId, long sessionId, String mapName, int x, int y, String url); ! ! public abstract void createRFIDTag(long sessionId, String mapName, int x, int y, String url); } \ No newline at end of file |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:11:24
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/src/net/sf/magicmap/client/gui Modified Files: MainGUI.java Log Message: added RFID library check added RFID functionality Index: MainGUI.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MainGUI.java 6 Mar 2006 22:21:43 -0000 1.18 --- MainGUI.java 7 Mar 2006 16:11:18 -0000 1.19 *************** *** 842,846 **** protected void toogleRfidPolling() { Controller.getInstance().setRfidPollingActive(!Controller.getInstance().isRfidPollingActive()); - // Controller.getInstance(). } --- 842,845 ---- |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:11:23
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/rfid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20109/src/net/sf/magicmap/client/controller/rfid Added Files: RFIDReadThread.java RFIDController.java RFIDReaderListener.java Log Message: added RFID library check added RFID functionality --- NEW FILE: RFIDController.java --- /** * */ package net.sf.magicmap.client.controller.rfid; import net.sf.magicmap.client.controller.Controller; import de.feig.FeIscListener; import de.feig.FePortDriverException; import de.feig.FeReaderDriverException; import de.feig.Fedm; import de.feig.FedmException; import de.feig.FedmIscReader; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class RFIDController implements FeIscListener, RFIDReaderListener { FedmIscReader rfidReader; RFIDReadThread rfidReadThread; Thread rfidPollingThread; /** * */ public RFIDController(FedmIscReader reader) { this.rfidReader = reader; } public boolean connect() { try { if (rfidReader.isConnected()) { try { rfidReader.removeEventListener(this, FeIscListener.RECEIVE_STRING_EVENT); rfidReader.removeEventListener(this, FeIscListener.SEND_STRING_EVENT); rfidReader.removeEventListener(this, FeIscListener.SCANNER_PRT_EVENT); } catch (Exception ex) {} try { rfidReader.disConnect(); } catch (Exception ex) {} } rfidReader.setTableSize(FedmIscReader.BRM_TABLE, 128); rfidReader.connectTCP("192.168.200.208", 10002); rfidReader.setProtocolFrameSupport(Fedm.PRT_FRAME_ADVANCED); rfidReader.sendProtocol((byte)0x33); } catch (FedmException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FePortDriverException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FeReaderDriverException e) { // TODO Auto-generated catch block e.printStackTrace(); } return rfidReader.isConnected(); } public void disconnect() { if (rfidReader.isConnected()) { try { rfidReader.disConnect(); } catch (FedmException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FePortDriverException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FeReaderDriverException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public void activatePolling() { rfidReadThread = new RFIDReadThread(); rfidReadThread.setFedmIscReader(rfidReader); rfidReadThread.setSets(0xFF); rfidReadThread.setReaderListener(this); rfidPollingThread = new Thread(rfidReadThread); rfidReadThread.setRunning(true); rfidPollingThread.start(); } public void deactivatePolling() { if (rfidPollingThread != null) { rfidPollingThread = null; } if (rfidReadThread != null) { rfidReadThread.setRunning(false); } } /* (non-Javadoc) * @see de.feig.FeIscListener#onSendProtocol(de.feig.FedmIscReader, java.lang.String) */ public void onSendProtocol(FedmIscReader arg0, String arg1) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see de.feig.FeIscListener#onReceiveProtocol(de.feig.FedmIscReader, java.lang.String) */ public void onReceiveProtocol(FedmIscReader arg0, String arg1) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see de.feig.FeIscListener#onSendProtocol(de.feig.FedmIscReader, byte[]) */ public void onSendProtocol(FedmIscReader arg0, byte[] arg1) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see de.feig.FeIscListener#onReceiveProtocol(de.feig.FedmIscReader, byte[]) */ public void onReceiveProtocol(FedmIscReader arg0, byte[] arg1) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see net.sf.magicmap.client.controller.rfid.RFIDReaderListener#onGetRecsets(int, int[], java.lang.String[], byte[][], java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String[]) */ public void onGetRecsets(int recSets, int[] type, String[] serialNumber, byte[][] dataBlock, String[] timer, String[] antNr, String[] input, String[] state) { System.err.println("got recsets:"); for (int i=0; i<type.length; i++) { Controller.getInstance().addRfidTag(serialNumber[i], antNr[i]); System.out.println("#Sets: "+ recSets + ", type:" + type[i] + ", serial: " + serialNumber[i] + ", antenna: " + antNr[i]); } } } --- NEW FILE: RFIDReaderListener.java --- /* * BRMReaderListener.java * * Created on 2. Juli 2003, 15:06 */ package net.sf.magicmap.client.controller.rfid; import de.feig.*; /** * * @author gast3 */ public interface RFIDReaderListener { public void onGetRecsets(int recSets, int[] type, String[] serialNumber, byte[][] dataBlock, String[] timer, String[] antNr, String[] input, String[] state); } --- NEW FILE: RFIDReadThread.java --- /* * BRMReadThread.java * * Created on 1. Juli 2003, 11:45 */ package net.sf.magicmap.client.controller.rfid; import de.feig.*; /** * * @author gast3 */ public class RFIDReadThread implements Runnable { public synchronized void run() { try { while (isRunning()) { // read buffer readBuffer(this.fedm, this.sets); if ((fedm.getLastError() >= 0) && clear) { clearBuffer(this.fedm); } Thread.sleep(500); } } catch (InterruptedException e) {} } private void readBuffer(FedmIscReader fedm, int sets) { if (fedm == null) { return; } int blockCnt = 0; int blockSize = 0; // read data from reader // read max. possible no. of data sets: request 255 data sets try { fedm.setData(FedmIscReaderID.FEDM_ISC_TMP_ADV_BRM_SETS, sets); int back = fedm.sendProtocol((byte)0x22); FedmBrmTableItem[] brmItems = null; if (fedm.getTableLength(FedmIscReaderConst.BRM_TABLE) > 0) brmItems = (FedmBrmTableItem[])fedm.getTable(FedmIscReaderConst.BRM_TABLE); if (brmItems != null) { String[] serialNumber = new String[brmItems.length]; byte[][] data = new byte[brmItems.length][]; String[] timer = new String[brmItems.length]; String[] antNr = new String[brmItems.length]; String[] input = new String[brmItems.length]; String[] state = new String[brmItems.length]; int[] type = new int[brmItems.length]; for (int i = 0; i < brmItems.length; i++) { if (brmItems[i].isDataValid(FedmIscReaderConst.DATA_SNR)) { serialNumber[i] = brmItems[i].getStringData(fedm.DATA_SNR); } if (brmItems[i].isDataValid(FedmIscReaderConst.DATA_RxDB)) { blockCnt = brmItems[i].getIntegerData(fedm.DATA_DBN); blockSize = brmItems[i].getIntegerData(fedm.DATA_BLOCK_SIZE); byte[] dataBlock; byte[] dataBlocks = new byte[blockCnt*blockSize]; for(int j=0; j<blockCnt; j++) { // data block dataBlock = brmItems[i].getByteArrayData(fedm.DATA_RxDB, j); for(int k=0; k<dataBlock.length; k++) dataBlocks[j*dataBlock.length+k] = dataBlock[k]; } data[i] = dataBlocks; } if (brmItems[i].isDataValid(FedmIscReaderConst.DATA_TRTYPE)) { // tranponder type type[i] = brmItems[i].getByteData(fedm.DATA_TRTYPE); } if (brmItems[i].isDataValid(FedmIscReaderConst.DATA_TIMER)) { // Timer String hour = Integer.toString(brmItems[i].getReaderTime().getHour()); if (hour.length() == 1) { hour = "0" + hour; } String minute = Integer.toString(brmItems[i].getReaderTime().getMinute()); if (minute.length() == 1) { minute = "0" + minute; } String second = Integer.toString(brmItems[i].getReaderTime().getMilliSecond() / 1000); if (second.length() == 1) { second = "0" + second; } String millisecond = Integer.toString(brmItems[i].getReaderTime().getMilliSecond() % 1000); if (millisecond.length() == 1) { millisecond = "0" + millisecond; } if (millisecond.length() == 2) { millisecond = "0" + millisecond; } timer[i] = hour + ":" + minute + ":" + second + "." + millisecond; } if (brmItems[i].isDataValid(FedmIscReaderConst.DATA_ANT_NR)) { // antenna number antNr[i] = brmItems[i].getStringData(FedmIscReaderConst.DATA_ANT_NR); } if (brmItems[i].isDataValid(FedmIscReaderConst.DATA_INPUT)) { // input, state input[i] = brmItems[i].getStringData(FedmIscReaderConst.DATA_INPUT); state[i] = brmItems[i].getStringData(FedmIscReaderConst.DATA_STATE); } } // clear buffer clear = true; readerListener.onGetRecsets(brmItems.length, type, serialNumber, data, timer, antNr, input, state); } } catch (Exception e) { e.printStackTrace(); } } private void clearBuffer(FedmIscReader fedm) { if (fedm == null) { return; } // clear all read data in reader try { fedm.sendProtocol((byte)0x32); } catch (FedmException e) { } catch (FeReaderDriverException e) { } catch (FePortDriverException e) { } clear = false; // show protocol //ShowLastProt iState, sTime } public void setFedmIscReader(FedmIscReader fedm) { this.fedm = fedm; } /** Getter for property sets. * @return Value of property sets. * */ public int getSets() { return sets; } /** Setter for property sets. * @param sets New value of property sets. * */ public void setSets(int sets) { this.sets = sets; } /** Getter for property running. * @return Value of property running. * */ public boolean isRunning() { return running; } /** Setter for property running. * @param running New value of property running. * */ public void setRunning(boolean running) { this.running = running; } /** Getter for property readerListener. * @return Value of property readerListener. * */ public RFIDReaderListener getReaderListener() { return readerListener; } /** Setter for property readerListener. * @param readerListener New value of property readerListener. * */ public void setReaderListener(RFIDReaderListener readerListener) { this.readerListener = readerListener; } private int portAddress; private boolean clear; private FedmIscReader fedm; private int sets; private boolean running; private RFIDReaderListener readerListener; } |
From: Johannes Z. <jza...@us...> - 2006-03-07 16:11:08
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/rfid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20018/src/net/sf/magicmap/client/controller/rfid Log Message: Directory /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/rfid added to the repository |
From: Florian L. <fle...@us...> - 2006-03-07 15:06:03
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/measurement In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19284/src/net/sf/magicmap/client/measurement Modified Files: Handler.java Log Message: Index: Handler.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/measurement/Handler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Handler.java 16 Jan 2005 16:01:31 -0000 1.1 --- Handler.java 7 Mar 2006 15:05:56 -0000 1.2 *************** *** 93,97 **** // Eigenen Client finden im NodeModel und die Kante zum // AccessPoint aktualisieren (offenbar sehen wir in ja ;-) ! client.setSignalLevelForAcessPoint(node, ap.getAverageSignalLevel()); } } else{ --- 93,99 ---- // Eigenen Client finden im NodeModel und die Kante zum // AccessPoint aktualisieren (offenbar sehen wir in ja ;-) ! if (!node.isHidden()) ! //AccessPoint ist aus der Berechnung ausgeschlossen ! client.setSignalLevelForAcessPoint(node, ap.getAverageSignalLevel()); } } else{ *************** *** 154,158 **** AccessPointNode node = nodeModel.findAccessPoint(ap.getMac()); if (node != null){ ! // TODO: Ggf. Kante zum Access Point vom eigenen Client entfernen client.notSeesAccessPoint(node); } else{ --- 156,160 ---- AccessPointNode node = nodeModel.findAccessPoint(ap.getMac()); if (node != null){ ! // Kante zum Access Point vom eigenen Client entfernen client.notSeesAccessPoint(node); } else{ |
From: Florian L. <fle...@us...> - 2006-03-07 15:02:40
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17147/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java Log Message: Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PositionFacade2.java 6 Mar 2006 10:59:03 -0000 1.13 --- PositionFacade2.java 7 Mar 2006 15:02:02 -0000 1.14 *************** *** 1,2 **** --- 1,3 ---- + package net.sf.magicmap.server.facade; *************** *** 26,485 **** public class PositionFacade2 implements PositionFacadeInterface { ! protected transient Category logger = Category.getInstance(this.getClass()); ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) ! */ ! public void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, MapException{ ! this.logger.info("createOrUpdatePosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! createOrUpdatePositionInternal(sessionId, mapName, positionX, positionY, character, positionName, fixed, pm); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("createOrUpdatePosition() - done"); ! ! } ! ! /** ! * @param sessionId ! * @param mapName ! * @param positionX ! * @param positionY ! * @param character ! * @param positionName ! * @param pm ! * @throws SessionException ! * @throws MapException ! */ ! private void createOrUpdatePositionInternal(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String positionName, boolean fixed, PersistenceManager pm) ! throws SessionException, MapException{ ! Session session = checkSession(sessionId, pm); ! Client client = session.getClient(); ! if (client == null){ ! throw new SessionException("Ungültige Session"); ! } ! if (character == null || character.getSimpleScanResults() == null || character.getSimpleScanResults().length == 0){ ! throw new MapException("Signalcharacter enthält keine Daten"); ! } ! if (positionName == null || "".equals(positionName)){ ! throw new MapException("Name der Position darf nicht leer sein"); ! } ! Map map = checkMap(mapName, positionX, positionY, pm); ! PositionDTO pos = new PositionDTO(); ! pos.setCharacter(character); ! pos.setFixed(fixed); ! pos.setName(positionName); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos,client.getMac()); ! } ! /** ! * @param macAP ! * @param pm ! * @return ! * @throws MapException ! * @throws s ! */ ! private AccessPoint findOrCreateAccessPoint(String macAP, PersistenceManager pm) throws MapException{ ! try{ ! AccessPoint result = null; ! Collection results; ! Extent e = pm.getExtent(AccessPoint.class, true); ! Query query = pm.newQuery(e, "mac == myMac"); ! query.declareParameters("java.lang.String myMac"); ! query.declareImports("import java.lang.String;"); ! results = (Collection) query.execute(macAP); ! if (results != null && !results.isEmpty()){ ! result = (AccessPoint) results.iterator().next(); ! } else{ ! result = new AccessPoint(macAP); ! pm.makePersistent(result); ! } ! return result; ! } catch (Exception e){ ! // pm.currentTransaction().rollback(); ! throw new MapException("", e); ! } ! } ! /** ! * @param mapName ! * @param positionX ! * @param positionY ! * @param pm ! * @return ! * @throws MapException ! */ ! private Map checkMap(String mapName, int positionX, int positionY, PersistenceManager pm) throws MapException{ ! Map result = checkMap(mapName, pm); ! if (positionX < 0 || positionY < 0 || positionX > (result.getImageWidth().intValue() - 1) ! || positionY > (result.getImageHeight().intValue() - 1)){ ! // pm.currentTransaction().rollback(); ! throw new MapException("Position ist nicht auf der Karte"); ! } ! return result; ! } ! /** ! * @param mapName ! * @param pm ! * @return ! * @throws MapException ! */ ! private Map checkMap(String mapName, PersistenceManager pm) throws MapException{ ! Map result = null; ! Collection results; ! Extent e = pm.getExtent(Map.class, true); ! Query query = pm.newQuery(e, "name == myName"); ! query.declareParameters("java.lang.String myName"); ! results = (Collection) query.execute(mapName); ! if (results != null && !results.isEmpty()){ ! result = (Map) results.iterator().next(); ! } else{ ! throw new MapException("Karte mit dem namen:" + mapName + " existiert nicht"); ! } ! return result; ! } ! /** ! * @param sessionId ! * @param tx ! * @throws SessionException ! */ ! private Session checkSession(long sessionId, PersistenceManager pm) throws SessionException{ ! Session result = null; ! Collection results; ! Extent e = pm.getExtent(Session.class, true); ! Query query = pm.newQuery(e, "id == myId"); ! query.declareParameters("java.lang.Long myId"); ! results = (Collection) query.execute(new Long(sessionId)); ! if (results != null && !results.isEmpty()){ ! result = (Session) results.iterator().next(); ! } else{ ! // pm.currentTransaction().rollback(); ! throw new SessionException("Session mit der id:" + sessionId + " existiert nicht"); ! } ! return result; ! } ! /** ! * @param sessionId ! * @param tx ! * @throws SessionException ! */ ! private Client checkClient(String mac, PersistenceManager pm) throws MapException{ ! if (mac == null || "".equals(mac)){ ! // pm.currentTransaction().rollback(); ! throw new MapException("Client mac darf nicht leer sein"); ! } ! Client result = null; ! Collection results; ! Extent e = pm.getExtent(Client.class, true); ! Query query = pm.newQuery(e, "mac == myMac"); ! query.declareParameters("java.lang.String myMac"); ! results = (Collection) query.execute(mac); ! if (results != null && !results.isEmpty()){ ! result = (Client) results.iterator().next(); ! } else{ ! // pm.currentTransaction().rollback(); ! throw new MapException("Client mit der mac-adresse:" + mac + " existiert nicht"); ! } ! return result; ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateClientPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) ! */ ! public void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, MapException{ ! this.logger.info("createOrUpdateClientPosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, character, clientMac, fixed, pm); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("createOrUpdateClientPosition() - done"); ! } ! /** ! * @param sessionId ! * @param mapName ! * @param positionX ! * @param positionY ! * @param character ! * @param clientMac ! * @param pm ! * @throws SessionException ! * @throws MapException ! */ ! private void createOrUpdateClientPositionInternal(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String clientMac, boolean fixed, PersistenceManager pm) throws SessionException, ! MapException{ ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, positionX, positionY, pm); ! Client client = checkClient(clientMac, pm); ! PositionDTO pos = new PositionDTO(); ! if (client != null){ ! ClientDTO clientDTO = new ClientDTO(); ! clientDTO.setMac(client.getMac()); ! clientDTO.setId(new Long(client.getId())); ! clientDTO.setName(client.getName()); ! pos.setClient(clientDTO); ! } ! pos.setCharacter(character); ! pos.setFixed(fixed); ! pos.setName(clientMac); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateAccessPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) ! */ ! public void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, ! String accessPointMac, boolean fixed) throws SessionException, MapException{ ! this.logger.info("createOrUpdateAccessPosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, positionX, positionY, pm); ! AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); ! PositionDTO pos = new PositionDTO(); ! if (ap != null){ ! AccessPointDTO apDTO = new AccessPointDTO(); ! apDTO.setMac(ap.getMac()); ! apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet TODO ssid setzen ! apDTO.setHidden(ap.getHidden()); ! pos.setAccessPoint(apDTO); ! } ! pos.setFixed(fixed); ! pos.setName(accessPointMac); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("createOrUpdateAccessPosition() - done"); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) ! */ ! public void movePosition(long sessionId, String mapname, long positionId, int newPositionX, int newPositionY, boolean fixed) ! throws SessionException, MapException{ ! this.logger.info("movePosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapname, newPositionX, newPositionY, pm); ! PositionCache.getPositionCache().movePosition(map, positionId, newPositionX, newPositionY, fixed); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } ! catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("movePosition() - done"); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) ! */ ! public void deletePosition(long sessionId, String mapname, long positionId) throws SessionException, MapException{ ! this.logger.info("deletePosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapname, pm); ! PositionCache.getPositionCache().removePosition(map,positionId); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("deletePosition() - done"); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForMapSince(long, java.lang.String, long) ! */ ! public PositionDTO[] getPositionsForMapSince(long sessionId, String mapName, long timeStamp) throws MapException, ! SessionException{ ! this.logger.info("getPositionsForMapSince() " + timeStamp); ! PositionDTO [] result = null; ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, pm); ! result = PositionCache.getPositionCache().getPositionsForMapSince(map,timeStamp); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("getPositionsForMapSince() - done "); ! return result; ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForClientOnMap(long, java.lang.String, java.lang.String) ! */ ! public String getPositionForClientOnMap(long sessionId, String mapName, String clientMac) ! throws MapException, SessionException, RemoteException { ! this.logger.info("getPositionsForClientOnMap() "); ! PersistenceManager pm = null; ! String positionResult = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, pm); ! checkClient(clientMac, pm); ! PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map,clientMac); ! positionResult = String.valueOf(pos.getPosX())+ "#" + String.valueOf(pos.getPosY()) + "#" + String.valueOf(pos.isFixed()); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("getPositionsForClientOnMap() - done "); ! return positionResult; ! ! } ! public void setAccessPointHiddenStatus(long sessionId, String mapName, String accessPointMac, boolean hidden) throws MapException, SessionException, RemoteException{ ! this.logger.info("setAccessPointHiddenStatus() "); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, pm); ! PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map,accessPointMac); ! if (pos == null || pos.getAccessPoint() == null){ ! throw new MapException("Accesspoint mit der mac-adresse:" + accessPointMac + " existiert nicht"); ! } ! pos.getAccessPoint().setHidden(hidden); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos); ! pm.currentTransaction().commit(); ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); } ! this.logger.info("setAccessPointHiddenStatus() - done "); } ! } \ No newline at end of file --- 27,499 ---- public class PositionFacade2 implements PositionFacadeInterface { ! protected transient Category logger = Category.getInstance(this.getClass()); ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) ! */ ! public void createOrUpdatePosition(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String positionName, boolean fixed) throws SessionException, MapException{ ! this.logger.info("createOrUpdatePosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! createOrUpdatePositionInternal(sessionId, mapName, positionX, positionY, character, positionName, fixed, pm); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("createOrUpdatePosition() - done"); + } ! /** ! * @param sessionId ! * @param mapName ! * @param positionX ! * @param positionY ! * @param character ! * @param positionName ! * @param pm ! * @throws SessionException ! * @throws MapException ! */ ! private void createOrUpdatePositionInternal(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String positionName, boolean fixed, PersistenceManager pm) throws SessionException, ! MapException{ ! Session session = checkSession(sessionId, pm); ! Client client = session.getClient(); ! if (client == null){ ! throw new SessionException("Ungültige Session"); ! } ! if (character == null || character.getSimpleScanResults() == null || character.getSimpleScanResults().length == 0){ ! throw new MapException("Signalcharacter enthält keine Daten"); ! } ! if (positionName == null || "".equals(positionName)){ ! throw new MapException("Name der Position darf nicht leer sein"); ! } ! Map map = checkMap(mapName, positionX, positionY, pm); ! PositionDTO pos = new PositionDTO(); ! pos.setCharacter(character); ! pos.setFixed(fixed); ! pos.setName(positionName); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map, pos, client.getMac()); ! } + /** + * @param macAP + * @param pm + * @return + * @throws MapException + * @throws s + */ + private AccessPoint findOrCreateAccessPoint(String macAP, PersistenceManager pm) throws MapException{ + try{ + AccessPoint result = null; + Collection results; + Extent e = pm.getExtent(AccessPoint.class, true); + Query query = pm.newQuery(e, "mac == myMac"); + query.declareParameters("java.lang.String myMac"); + query.declareImports("import java.lang.String;"); + results = (Collection) query.execute(macAP); + if (results != null && !results.isEmpty()){ + result = (AccessPoint) results.iterator().next(); + } else{ + result = new AccessPoint(macAP); + pm.makePersistent(result); + } + return result; + } catch (Exception e){ + // pm.currentTransaction().rollback(); + throw new MapException("", e); + } ! } ! /** ! * @param mapName ! * @param positionX ! * @param positionY ! * @param pm ! * @return ! * @throws MapException ! */ ! private Map checkMap(String mapName, int positionX, int positionY, PersistenceManager pm) throws MapException{ ! Map result = checkMap(mapName, pm); ! if (positionX < 0 || positionY < 0 || positionX > (result.getImageWidth().intValue() - 1) ! || positionY > (result.getImageHeight().intValue() - 1)){ ! // pm.currentTransaction().rollback(); ! throw new MapException("Position ist nicht auf der Karte"); ! } ! return result; ! } ! /** ! * @param mapName ! * @param pm ! * @return ! * @throws MapException ! */ ! private Map checkMap(String mapName, PersistenceManager pm) throws MapException{ ! Map result = null; ! Collection results; ! Extent e = pm.getExtent(Map.class, true); ! Query query = pm.newQuery(e, "name == myName"); ! query.declareParameters("java.lang.String myName"); ! results = (Collection) query.execute(mapName); ! if (results != null && !results.isEmpty()){ ! result = (Map) results.iterator().next(); ! } else{ ! throw new MapException("Karte mit dem namen:" + mapName + " existiert nicht"); ! } ! return result; ! } ! /** ! * @param sessionId ! * @param tx ! * @throws SessionException ! */ ! private Session checkSession(long sessionId, PersistenceManager pm) throws SessionException{ ! Session result = null; ! Collection results; ! Extent e = pm.getExtent(Session.class, true); ! Query query = pm.newQuery(e, "id == myId"); ! query.declareParameters("java.lang.Long myId"); ! results = (Collection) query.execute(new Long(sessionId)); ! if (results != null && !results.isEmpty()){ ! result = (Session) results.iterator().next(); ! } else{ ! // pm.currentTransaction().rollback(); ! throw new SessionException("Session mit der id:" + sessionId + " existiert nicht"); ! } ! return result; ! } ! /** ! * @param sessionId ! * @param tx ! * @throws SessionException ! */ ! private Client checkClient(String mac, PersistenceManager pm) throws MapException{ ! if (mac == null || "".equals(mac)){ ! // pm.currentTransaction().rollback(); ! throw new MapException("Client mac darf nicht leer sein"); ! } ! Client result = null; ! Collection results; ! Extent e = pm.getExtent(Client.class, true); ! Query query = pm.newQuery(e, "mac == myMac"); ! query.declareParameters("java.lang.String myMac"); ! results = (Collection) query.execute(mac); ! if (results != null && !results.isEmpty()){ ! result = (Client) results.iterator().next(); ! } else{ ! // pm.currentTransaction().rollback(); ! throw new MapException("Client mit der mac-adresse:" + mac + " existiert nicht"); ! } ! return result; ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateClientPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) ! */ ! public void createOrUpdateClientPosition(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, MapException{ ! this.logger.info("createOrUpdateClientPosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! createOrUpdateClientPositionInternal(sessionId, mapName, positionX, positionY, character, clientMac, fixed, pm); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("createOrUpdateClientPosition() - done"); ! } ! /** ! * @param sessionId ! * @param mapName ! * @param positionX ! * @param positionY ! * @param character ! * @param clientMac ! * @param pm ! * @throws SessionException ! * @throws MapException ! */ ! private void createOrUpdateClientPositionInternal(long sessionId, String mapName, int positionX, int positionY, ! SignalCharacterDTO character, String clientMac, boolean fixed, PersistenceManager pm) throws SessionException, ! MapException{ ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, positionX, positionY, pm); ! Client client = checkClient(clientMac, pm); ! PositionDTO pos = new PositionDTO(); ! if (client != null){ ! ClientDTO clientDTO = new ClientDTO(); ! clientDTO.setMac(client.getMac()); ! clientDTO.setId(new Long(client.getId())); ! clientDTO.setName(client.getName()); ! pos.setClient(clientDTO); ! } ! pos.setCharacter(character); ! pos.setFixed(fixed); ! pos.setName(clientMac); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map, pos); ! } + /* (non-Javadoc) + * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#createOrUpdateAccessPosition(long, java.lang.String, int, int, net.sf.magicmap.server.facade.dto.SignalCharacter, java.lang.String) + */ + public void createOrUpdateAccessPosition(long sessionId, String mapName, int positionX, int positionY, + String accessPointMac, boolean fixed) throws SessionException, MapException{ + this.logger.info("createOrUpdateAccessPosition()"); + PersistenceManager pm = null; + try{ + pm = JDOUtil.pmfactory.getPersistenceManager(); + pm.currentTransaction().begin(); + checkSession(sessionId, pm); + Map map = checkMap(mapName, positionX, positionY, pm); + AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); ! PositionDTO pos = new PositionDTO(); ! if (ap != null){ ! AccessPointDTO apDTO = new AccessPointDTO(); ! apDTO.setMac(ap.getMac()); ! apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet TODO ssid setzen ! apDTO.setHidden(ap.getHidden()); ! pos.setAccessPoint(apDTO); ! } ! pos.setFixed(fixed); ! pos.setName(accessPointMac); ! pos.setPosX(positionX); ! pos.setPosY(positionY); ! PositionCache.getPositionCache().createOrUpdatePosition(map, pos); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("createOrUpdateAccessPosition() - done"); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#movePosition(long, long, int, int) ! */ ! public void movePosition(long sessionId, String mapname, long positionId, int newPositionX, int newPositionY, ! boolean fixed) throws SessionException, MapException{ ! this.logger.info("movePosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapname, newPositionX, newPositionY, pm); ! PositionCache.getPositionCache().movePosition(map, positionId, newPositionX, newPositionY, fixed); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("movePosition() - done"); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#deletePosition(long, long) ! */ ! public void deletePosition(long sessionId, String mapname, long positionId) throws SessionException, MapException{ ! this.logger.info("deletePosition()"); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapname, pm); ! PositionCache.getPositionCache().removePosition(map, positionId); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("deletePosition() - done"); ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForMapSince(long, java.lang.String, long) ! */ ! public PositionDTO[] getPositionsForMapSince(long sessionId, String mapName, long timeStamp) throws MapException, ! SessionException{ ! this.logger.info("getPositionsForMapSince() " + timeStamp); ! PositionDTO[] result = null; ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, pm); ! result = PositionCache.getPositionCache().getPositionsForMapSince(map, timeStamp); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("getPositionsForMapSince() - done "); ! return result; ! } ! /* (non-Javadoc) ! * @see net.sf.magicmap.server.facade.interfaces.PositionFacadeInterface#getPositionsForClientOnMap(long, java.lang.String, java.lang.String) ! */ ! public String getPositionForClientOnMap(long sessionId, String mapName, String clientMac) throws MapException, ! SessionException, RemoteException{ ! this.logger.info("getPositionsForClientOnMap() "); ! PersistenceManager pm = null; ! String positionResult = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! Map map = checkMap(mapName, pm); ! checkClient(clientMac, pm); ! PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map, clientMac); ! positionResult = String.valueOf(pos.getPosX()) + "#" + String.valueOf(pos.getPosY()) + "#" ! + String.valueOf(pos.isFixed()); ! if (pm.currentTransaction().isActive()){ ! pm.currentTransaction().commit(); ! } ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); ! } ! this.logger.info("getPositionsForClientOnMap() - done "); ! return positionResult; ! } ! public void setAccessPointHiddenStatus(long sessionId, String mapName, String accessPointMac, boolean hidden) ! throws MapException, SessionException, RemoteException{ ! this.logger.info("setAccessPointHiddenStatus() "); ! PersistenceManager pm = null; ! try{ ! pm = JDOUtil.pmfactory.getPersistenceManager(); ! pm.currentTransaction().begin(); ! checkSession(sessionId, pm); ! AccessPoint ap = findOrCreateAccessPoint(accessPointMac,pm); ! ap.setHidden(hidden); ! ! Map map = checkMap(mapName, pm); ! PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map,accessPointMac); ! if (pos != null && pos.getAccessPoint() != null){ ! pos.getAccessPoint().setHidden(hidden); ! PositionCache.getPositionCache().createOrUpdatePosition(map,pos); ! }else { ! pos = new PositionDTO(); ! if (ap != null){ ! AccessPointDTO apDTO = new AccessPointDTO(); ! apDTO.setMac(ap.getMac()); ! apDTO.setSsid(ap.getSsid()); // zur zeit noch nicht verwendet TODO ssid setzen ! apDTO.setHidden(ap.getHidden()); ! pos.setAccessPoint(apDTO); } ! pos.setFixed(false); ! pos.setName(accessPointMac); ! pos.setPosX(0); ! pos.setPosY(0); ! PositionCache.getPositionCache().createOrUpdatePosition(map, pos); ! } ! ! pm.currentTransaction().commit(); ! } catch (Exception e){ ! e.printStackTrace(); ! if (e instanceof MapException){ ! throw (MapException) e; ! } ! if (e instanceof SessionException){ ! throw (SessionException) e; ! } ! } finally{ ! JDOUtil.closePM(pm); } + this.logger.info("setAccessPointHiddenStatus() - done "); + } ! } \ No newline at end of file |
From: Johannes Z. <jza...@us...> - 2006-03-06 22:21:49
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/views In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18597/src/net/sf/magicmap/client/views Modified Files: MeasurementView.java Log Message: changed access to server communication for maps and geo points added base rfid support Index: MeasurementView.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/views/MeasurementView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MeasurementView.java 9 Jun 2005 15:14:42 -0000 1.2 --- MeasurementView.java 6 Mar 2006 22:21:43 -0000 1.3 *************** *** 37,41 **** public class MeasurementView extends View implements MeasurementModelListener { ! private JTable table; private DefaultTableColumnModel columnModel; private DefaultTableModel tableModel; --- 37,46 ---- public class MeasurementView extends View implements MeasurementModelListener { ! /** ! * serial version id ! */ ! private static final long serialVersionUID = 7568742160250506631L; ! ! private JTable table; private DefaultTableColumnModel columnModel; private DefaultTableModel tableModel; |
From: Johannes Z. <jza...@us...> - 2006-03-06 22:21:49
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18597/src/net/sf/magicmap/client/controller Modified Files: PollHandler.java Controller.java VirtualServerManager.java ServerManager.java SOAPServerManager.java ServerPoller.java Added Files: RFIDTagRead.java RFIDTagReader.java RFIDController.java Log Message: changed access to server communication for maps and geo points added base rfid support --- NEW FILE: RFIDController.java --- /** * */ package net.sf.magicmap.client.controller; import sun.security.jca.GetInstance; import de.feig.FeIscListener; import de.feig.FePortDriverException; import de.feig.FeReaderDriverException; import de.feig.FedmException; import de.feig.FedmIscReader; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class RFIDController implements FeIscListener, RFIDTagRead { FedmIscReader rfidReader; RFIDTagReader tagReader; /** * */ public RFIDController(FedmIscReader reader) { this.rfidReader = reader; } public boolean connect() { try { if (rfidReader.isConnected()) { try { rfidReader.removeEventListener(this, FeIscListener.RECEIVE_STRING_EVENT); rfidReader.removeEventListener(this, FeIscListener.SEND_STRING_EVENT); rfidReader.removeEventListener(this, FeIscListener.SCANNER_PRT_EVENT); } catch (Exception ex) {} try { rfidReader.disConnect(); } catch (Exception ex) {} } rfidReader.connectTCP("192.168.10.10", 10001); } catch (FedmException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FePortDriverException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FeReaderDriverException e) { // TODO Auto-generated catch block e.printStackTrace(); } return rfidReader.isConnected(); } /* (non-Javadoc) * @see de.feig.FeIscListener#onSendProtocol(de.feig.FedmIscReader, java.lang.String) */ public void onSendProtocol(FedmIscReader arg0, String arg1) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see de.feig.FeIscListener#onReceiveProtocol(de.feig.FedmIscReader, java.lang.String) */ public void onReceiveProtocol(FedmIscReader arg0, String arg1) { System.out.println("received: " + arg1); } /* (non-Javadoc) * @see de.feig.FeIscListener#onSendProtocol(de.feig.FedmIscReader, byte[]) */ public void onSendProtocol(FedmIscReader arg0, byte[] arg1) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see de.feig.FeIscListener#onReceiveProtocol(de.feig.FedmIscReader, byte[]) */ public void onReceiveProtocol(FedmIscReader arg0, byte[] arg1) { System.out.println("received: " + arg1); } /* (non-Javadoc) * @see net.sf.magicmap.client.controller.RFIDTagRead#tagChanged(java.lang.String[], java.lang.String[]) */ public void tagChanged(String[] tagType, String[] serialNumber) { if (tagType.length > 0) { System.err.println("tags read:"); if (tagType.length == serialNumber.length) { for (int i=0; i< tagType.length; i++) { System.err.println("type " + tagType[i] + ", serial " + serialNumber[i]); } } else { System.err.println("number inconsistency, aborting"); } } } /* (non-Javadoc) * @see net.sf.magicmap.client.controller.RFIDTagRead#lastError(java.lang.String) */ public void lastError(String error) { System.err.println("error: " + error); } public void startReading() { tagReader = new RFIDTagReader(this, rfidReader); tagReader.start(); } public void stopReading() { tagReader.stop(); } } Index: VirtualServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/VirtualServerManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VirtualServerManager.java 2 Mar 2006 11:06:32 -0000 1.8 --- VirtualServerManager.java 6 Mar 2006 22:21:42 -0000 1.9 *************** *** 11,15 **** --- 11,20 ---- import net.sf.magicmap.client.interfaces.CreatePositionCallback; import net.sf.magicmap.client.interfaces.DeletePositionCallback; + import net.sf.magicmap.client.interfaces.FetchGeoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchInfoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchMapsCallback; import net.sf.magicmap.client.interfaces.FetchPositionsCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDAntennasCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDTagsCallback; import net.sf.magicmap.client.interfaces.MapCallback; import net.sf.magicmap.client.interfaces.MapNamesCallback; *************** *** 520,522 **** --- 525,581 ---- } + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#deleteGeoPoint(long, java.lang.String, net.sf.magicmap.client.interfaces.DeletePositionCallback) + */ + @Override + public void deleteGeoPoint(long id, String string, DeletePositionCallback callback) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#fetchGeoPointsFromServer(net.sf.magicmap.client.interfaces.FetchGeoPointsCallback) + */ + @Override + public void fetchGeoPointsFromServer(FetchGeoPointsCallback callback) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#fetchMapsFromServer(net.sf.magicmap.client.interfaces.FetchMapsCallback) + */ + @Override + public void fetchMapsFromServer(FetchMapsCallback callback) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#fetchInfoPointsFromServer(net.sf.magicmap.client.interfaces.FetchInfoPointsCallback) + */ + @Override + public void fetchInfoPointsFromServer(FetchInfoPointsCallback poller) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#fetchRFIDAntennasFromServer(net.sf.magicmap.client.interfaces.FetchRFIDAntennasCallback) + */ + @Override + public void fetchRFIDAntennasFromServer(FetchRFIDAntennasCallback poller) { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#fetchRFIDTagsFromServer(net.sf.magicmap.client.interfaces.FetchRFIDTagsCallback) + */ + @Override + public void fetchRFIDTagsFromServer(FetchRFIDTagsCallback poller) { + // TODO Auto-generated method stub + + } + } \ No newline at end of file Index: Controller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/Controller.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Controller.java 2 Mar 2006 11:06:32 -0000 1.12 --- Controller.java 6 Mar 2006 22:21:42 -0000 1.13 *************** *** 11,15 **** --- 11,21 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.HashMap; + + import de.feig.FedmException; + import de.feig.FedmIscReader; + import net.sf.magicmap.client.gui.MainGUI; + import net.sf.magicmap.client.gui.MapPanel; import net.sf.magicmap.client.gui.utils.GUIUtils; import net.sf.magicmap.client.interfaces.CreateNewMapCallback; *************** *** 75,78 **** --- 81,85 ---- private boolean invisble; // Invisible-Modus (keine Daten an Server) + private boolean rfidPollingActive; // pseudo server items *************** *** 80,83 **** --- 87,92 ---- private Collection rfidAntennas; private ArrayList rfidTags; + private HashMap rfidDataChunks; + private RFIDController rfidController; /** *************** *** 120,123 **** --- 129,140 ---- rfidAntennas = new ArrayList(); rfidTags = new ArrayList(); + try { + rfidController = new RFIDController(new FedmIscReader()); + } catch (FedmException e) { + System.err.println("error creating RFID controller"); + } catch (Exception e) { + System.err.println("error creating RFID controller"); + } + setRfidPollingActive(false); initializeScanner(); *************** *** 477,480 **** --- 494,498 ---- } else{ serverManager.createRFIDAntenna(x, y, fixed, antenna, mapName, callback); + MainGUI.getInstance().getRfidPollAction().setEnabled(true); } *************** *** 495,498 **** --- 513,544 ---- } } + + + /** + * @param name + * @param string + * @param panel + */ + public void deleteRfidAntenna(String name, String string, DeletePositionCallback callback) { + // TODO Auto-generated method stub + + } + + /** + * @param name + * @param string + * @param panel + */ + public void deleteGeoPoint(String name, String string, DeletePositionCallback callback) { + Node node = nodeModel.findNode(name); + if (node != null){ + if (node.getId() != -1){ + serverManager.deleteGeoPoint(node.getId(), Controller.getInstance().getCurrentMap().name, callback); + } else{ + System.out.println("Node has no positionId, so its position cannot be deleted."); + } + } + } + public void setClientPosition(final int x, final int y, final boolean fixed, final String clientMac, *************** *** 556,563 **** int index = rfidTags.indexOf(id); ((RFIDTag) rfidTags.get(index)).setTimestamp(timestamp); ! } else{ rfidTags.add(new RFIDTag(id, timestamp)); } } } --- 602,622 ---- int index = rfidTags.indexOf(id); ((RFIDTag) rfidTags.get(index)).setTimestamp(timestamp); ! } else { rfidTags.add(new RFIDTag(id, timestamp)); } } + + public RFIDController getRfidController() { + return rfidController; + } + + public boolean isRfidPollingActive() { + return rfidPollingActive; + } + + public void setRfidPollingActive(boolean rfidPollingActive) { + this.rfidPollingActive = rfidPollingActive; + } + } --- NEW FILE: RFIDTagReader.java --- (This appears to be a binary file; contents omitted.) Index: PollHandler.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/PollHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PollHandler.java 2 Mar 2006 11:06:32 -0000 1.8 --- PollHandler.java 6 Mar 2006 22:21:42 -0000 1.9 *************** *** 135,139 **** SignalCharacterDTO sc = position.getCharacter(); SimpleScanResultDTO[] sr = sc.getSimpleScanResults(); ! for (int i = 0; i < sr.length; i++) { SimpleScanResultDTO r = sr[i]; String mac = r.getMacAP(); --- 135,139 ---- SignalCharacterDTO sc = position.getCharacter(); SimpleScanResultDTO[] sr = sc.getSimpleScanResults(); ! for (int i = 0; sr != null && i < sr.length; i++) { SimpleScanResultDTO r = sr[i]; String mac = r.getMacAP(); *************** *** 389,393 **** pointDTO.getGeoPointAlt().intValue()); geoNode.setName(pointDTO.toString()); ! geoNode.setId(geoNode.hashCode()); geoNode.setGeoPos(geoPos); nodeModel.addNode(geoNode); --- 389,394 ---- pointDTO.getGeoPointAlt().intValue()); geoNode.setName(pointDTO.toString()); ! geoNode.setId(pointDTO.getId()); ! System.err.println("created geo node: " + geoNode.getId()); geoNode.setGeoPos(geoPos); nodeModel.addNode(geoNode); *************** *** 463,466 **** --- 464,468 ---- RFIDAntennaNode antennaNode = new RFIDAntennaNode(nodeModel); antennaNode.setName(antenna.getURL()); + antennaNode.setAntenna(antenna); antennaNode.setId(antenna.hashCode()); if (antenna.getMap().equals(Controller.getInstance().getCurrentMap().name)) { Index: SOAPServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/SOAPServerManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SOAPServerManager.java 2 Mar 2006 11:06:32 -0000 1.9 --- SOAPServerManager.java 6 Mar 2006 22:21:42 -0000 1.10 *************** *** 18,22 **** --- 18,27 ---- import net.sf.magicmap.client.interfaces.CreatePositionCallback; import net.sf.magicmap.client.interfaces.DeletePositionCallback; + import net.sf.magicmap.client.interfaces.FetchGeoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchInfoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchMapsCallback; import net.sf.magicmap.client.interfaces.FetchPositionsCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDAntennasCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDTagsCallback; import net.sf.magicmap.client.interfaces.MapCallback; import net.sf.magicmap.client.interfaces.MapNamesCallback; *************** *** 362,365 **** --- 367,392 ---- } } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.controller.ServerManager#deleteGeoPoint(long, java.lang.String, net.sf.magicmap.client.interfaces.DeletePositionCallback) + */ + @Override + public void deleteGeoPoint(final long id, final String string, final DeletePositionCallback callback) { + if (isConnected()) { + Thread deleteGeoPosThread = new Thread() { + public void run() { + synchronized(mutex) { + try { + SOAPServerManager.this.mapDelegate.deleteGeoPoint(SOAPServerManager.this.sessionId, id); + } catch (Exception e){ + callback.positionDeleteError(e); + } + } + } + }; + deleteGeoPosThread.start(); + } + + } /** *************** *** 502,554 **** } ! callback.positionsFetched(positions); ! ! //TODO: retrieve maps ! ! //TODO: retrieve info objects ! ! //TODO: retrieve RFID antennas ! ! // geoPoses.toString(); ! // callback.geoPointsFetched(geoPoses); ! ! } catch (Exception e){ ! callback.positionFetchError(e); ! } ! ! // retrieve other positions (e.g. geopoints, infoobjects, rfid antennas) ! try{ ! // retrieve maps ! String[] names = SOAPServerManager.this.mapDelegate.getMapNames(); ! MapDTO[] mapDTOs = new MapDTO[names.length]; ! for (int i = 0; i < names.length; i++){ ! mapDTOs[i] = SOAPServerManager.this.mapDelegate.getMap(names[i]); ! } ! callback.mapsFetched(mapDTOs); ! ! // retrieve geo points ! GeoPointDTO[] geoPoses = SOAPServerManager.this.mapDelegate.getGeoPointsForMap( ! SOAPServerManager.this.sessionId, controller.getCurrentMap().name); ! if (geoPoses != null){ ! callback.geoPointsFetches(geoPoses); ! } ! ! // retrieve info points ! Collection infoObjects = Controller.getInstance().getInfoObjects(); ! if (infoObjects != null && infoObjects.size() > 0){ ! callback.infoPointsFetched(infoObjects); ! } ! ! // retrieve RFID antennas ! Collection rfidAntennas = Controller.getInstance().getRfidAntennas(); ! if (rfidAntennas != null && rfidAntennas.size() > 0){ ! callback.rfidAntennasFetched(rfidAntennas); ! } ! ! // retrieve RFID tags ! Collection rfidTags = Controller.getInstance().getRfidTags(); ! if (rfidTags != null && rfidTags.size() > 0){ ! callback.rfidTagsFetched(rfidTags); ! } } catch (Exception e){ --- 529,533 ---- } ! callback.positionsFetched(positions); } catch (Exception e){ *************** *** 630,632 **** } ! } \ No newline at end of file --- 609,747 ---- } ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.controller.ServerManager#fetchGeoPointsFromServer(net.sf.magicmap.client.interfaces.FetchGeoPointsCallback) ! */ ! @Override ! public void fetchGeoPointsFromServer(final FetchGeoPointsCallback callback) { ! ! if (isConnected()) { ! ! Thread fetchGeoPointsThread = new Thread() { ! public void run() { ! synchronized (mutex) { ! try { ! // retrieve geo points ! GeoPointDTO[] geoPoses = SOAPServerManager.this.mapDelegate.getGeoPointsForMap ( ! SOAPServerManager.this.sessionId, controller.getCurrentMap().name); ! if (geoPoses != null) { ! callback.geoPointsFetched(geoPoses); ! } ! } catch (Exception e) { ! callback.geoPointFetchError(e); ! } ! } ! } ! }; ! fetchGeoPointsThread.start(); ! } ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.controller.ServerManager#fetchMapsFromServer(net.sf.magicmap.client.interfaces.FetchMapsCallback) ! */ ! @Override ! public void fetchMapsFromServer(final FetchMapsCallback callback) { ! ! if (isConnected()) { ! ! Thread fetchMapsThread = new Thread() { ! ! public void run() { ! synchronized (mutex) { ! try { ! // retrieve maps ! String[] names = SOAPServerManager.this.mapDelegate.getMapNames(); ! MapDTO[] mapDTOs = new MapDTO[names.length]; ! for (int i = 0; i < names.length; i++) { ! mapDTOs[i] = SOAPServerManager.this.mapDelegate.getMap(names[i]); ! } ! callback.mapsFetched(mapDTOs); ! } catch (Exception e) { ! callback.mapFetchError(e); ! } ! } ! } ! }; ! fetchMapsThread.start(); ! } ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.controller.ServerManager#fetchInfoPointsFromServer(net.sf.magicmap.client.interfaces.FetchInfoPointsCallback) ! */ ! @Override ! public void fetchInfoPointsFromServer(final FetchInfoPointsCallback callback) { ! if (isConnected()) { ! Thread fetchInfoPointsThread = new Thread() { ! public void run() { ! synchronized (mutex) { ! try { ! // retrieve info points ! Collection infoObjects = Controller.getInstance().getInfoObjects(); ! if (infoObjects != null && infoObjects.size() > 0) { ! callback.infoPointsFetched(infoObjects); ! } ! } catch (Exception e){ ! callback.infoPointFetchError(e); ! } ! } ! } ! }; ! fetchInfoPointsThread.start(); ! } ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.controller.ServerManager#fetchRFIDAntennasFromServer(net.sf.magicmap.client.interfaces.FetchRFIDAntennasCallback) ! */ ! @Override ! public void fetchRFIDAntennasFromServer(final FetchRFIDAntennasCallback callback) { ! if (isConnected()) { ! Thread fetchMapsThread = new Thread() { ! public void run() { ! synchronized (mutex) { ! try { ! // retrieve RFID antennas ! Collection rfidAntennas = Controller.getInstance().getRfidAntennas(); ! if (rfidAntennas != null && rfidAntennas.size() > 0) { ! callback.rfidAntennasFetched(rfidAntennas); ! } ! } catch (Exception e){ ! callback.rfidAntennasFetchError(e); ! } ! } ! } ! }; ! fetchMapsThread.start(); ! } ! ! } ! ! /* (non-Javadoc) ! * @see net.sf.magicmap.client.controller.ServerManager#fetchRFIDTagsFromServer(net.sf.magicmap.client.interfaces.FetchRFIDTagsCallback) ! */ ! @Override ! public void fetchRFIDTagsFromServer(final FetchRFIDTagsCallback callback) { ! if (isConnected()) { ! Thread fetchMapsThread = new Thread() { ! public void run() { ! synchronized (mutex) { ! try { ! // retrieve RFID tags ! Collection rfidTags = Controller.getInstance().getRfidTags(); ! if (rfidTags != null && rfidTags.size() > 0){ ! callback.rfidTagsFetched(rfidTags); ! } ! } catch (Exception e){ ! callback.rfidTagFetchError(e); ! } ! } ! } ! }; ! fetchMapsThread.start(); ! } ! ! } ! ! } ! --- NEW FILE: RFIDTagRead.java --- (This appears to be a binary file; contents omitted.) Index: ServerPoller.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/ServerPoller.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ServerPoller.java 28 Feb 2006 11:23:16 -0000 1.6 --- ServerPoller.java 6 Mar 2006 22:21:42 -0000 1.7 *************** *** 10,14 **** --- 10,19 ---- import java.util.TimerTask; + import net.sf.magicmap.client.interfaces.FetchGeoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchInfoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchMapsCallback; import net.sf.magicmap.client.interfaces.FetchPositionsCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDAntennasCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDTagsCallback; import net.sf.magicmap.client.interfaces.ServerPollerListener; import net.sf.magicmap.client.model.node.InfoObject; *************** *** 26,30 **** * @author thuebner */ ! public class ServerPoller implements FetchPositionsCallback { private static String syncObj = "TEST"; --- 31,37 ---- * @author thuebner */ ! public class ServerPoller implements FetchPositionsCallback, ! FetchGeoPointsCallback, FetchMapsCallback, FetchInfoPointsCallback, ! FetchRFIDAntennasCallback, FetchRFIDTagsCallback { private static String syncObj = "TEST"; *************** *** 63,66 **** --- 70,78 ---- isFetching = true; ServerPoller.this.serverManager.fetchPositionsFromServer(ServerPoller.this); + ServerPoller.this.serverManager.fetchGeoPointsFromServer(ServerPoller.this); + ServerPoller.this.serverManager.fetchMapsFromServer(ServerPoller.this); + ServerPoller.this.serverManager.fetchInfoPointsFromServer(ServerPoller.this); + ServerPoller.this.serverManager.fetchRFIDAntennasFromServer(ServerPoller.this); + ServerPoller.this.serverManager.fetchRFIDTagsFromServer(ServerPoller.this); ServerPoller.this.serverManager.submitClientInfo(); } *************** *** 95,102 **** } /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.FetchPositionsCallback#geoPointsFetches(net.sf.magicmap.server.dto.GeoPointDTO[]) */ ! public void geoPointsFetches(GeoPointDTO[] geoPoses) { for (int i = 0; i < geoPoses.length; i++) { --- 107,115 ---- } + /* (non-Javadoc) ! * @see net.sf.magicmap.client.interfaces.FetchGeoPointsCallback#geoPointsFetched(net.sf.magicmap.server.dto.GeoPointDTO[]) */ ! public void geoPointsFetched(GeoPointDTO[] geoPoses) { for (int i = 0; i < geoPoses.length; i++) { *************** *** 106,109 **** --- 119,123 ---- isFetching = false; } + } *************** *** 163,166 **** --- 177,230 ---- } + /* (non-Javadoc) + * @see net.sf.magicmap.client.interfaces.FetchGeoPointsCallback#geoPointFetchError(java.lang.Exception) + */ + public void geoPointFetchError(Exception e) { + e.printStackTrace(); + synchronized (syncObj){ + isFetching = false; + } + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.interfaces.FetchMapsCallback#mapFetchError(java.lang.Exception) + */ + public void mapFetchError(Exception e) { + e.printStackTrace(); + synchronized (syncObj){ + isFetching = false; + } + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.interfaces.FetchInfoPointsCallback#infoPointFetchError(java.lang.Exception) + */ + public void infoPointFetchError(Exception e) { + e.printStackTrace(); + synchronized (syncObj){ + isFetching = false; + } + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.interfaces.FetchRFIDAntennasCallback#rfidAntennasFetchError(java.lang.Exception) + */ + public void rfidAntennasFetchError(Exception e) { + e.printStackTrace(); + synchronized (syncObj){ + isFetching = false; + } + } + + /* (non-Javadoc) + * @see net.sf.magicmap.client.interfaces.FetchRFIDTagsCallback#rfidTagFetchError(java.lang.Exception) + */ + public void rfidTagFetchError(Exception e) { + e.printStackTrace(); + synchronized (syncObj){ + isFetching = false; + } + } + } Index: ServerManager.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/controller/ServerManager.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ServerManager.java 2 Mar 2006 11:06:32 -0000 1.13 --- ServerManager.java 6 Mar 2006 22:21:42 -0000 1.14 *************** *** 18,22 **** --- 18,27 ---- import net.sf.magicmap.client.interfaces.CreatePositionCallback; import net.sf.magicmap.client.interfaces.DeletePositionCallback; + import net.sf.magicmap.client.interfaces.FetchGeoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchInfoPointsCallback; + import net.sf.magicmap.client.interfaces.FetchMapsCallback; import net.sf.magicmap.client.interfaces.FetchPositionsCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDAntennasCallback; + import net.sf.magicmap.client.interfaces.FetchRFIDTagsCallback; import net.sf.magicmap.client.interfaces.MapCallback; import net.sf.magicmap.client.interfaces.MapNamesCallback; *************** *** 223,226 **** --- 228,241 ---- public abstract void fetchPositionsFromServer(final FetchPositionsCallback callback); + + public abstract void fetchGeoPointsFromServer(final FetchGeoPointsCallback callback); + + public abstract void fetchMapsFromServer(final FetchMapsCallback callback); + + public abstract void fetchInfoPointsFromServer(final FetchInfoPointsCallback poller); + + public abstract void fetchRFIDAntennasFromServer(final FetchRFIDAntennasCallback poller); + + public abstract void fetchRFIDTagsFromServer(final FetchRFIDTagsCallback poller); /* (non-Javadoc) *************** *** 233,236 **** --- 248,259 ---- public abstract void submitClientInfo(); + /** + * @param id + * @param string + * @param callback + */ + public abstract void deleteGeoPoint(long id, String string, DeletePositionCallback callback); + + // /** // * Load new map |
From: Johannes Z. <jza...@us...> - 2006-03-06 22:21:48
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18597/src/net/sf/magicmap/client/interfaces Modified Files: FetchPositionsCallback.java Added Files: FetchGeoPointsCallback.java FetchRFIDTagsCallback.java FetchInfoPointsCallback.java FetchMapsCallback.java FetchRFIDAntennasCallback.java Log Message: changed access to server communication for maps and geo points added base rfid support --- NEW FILE: FetchRFIDAntennasCallback.java --- /** * */ package net.sf.magicmap.client.interfaces; import java.util.Collection; /** * @author Johannes Zapotoczky (joh...@za...) * */ public interface FetchRFIDAntennasCallback { /** * @param rfidAntennas */ public void rfidAntennasFetched(Collection rfidAntennas); /** * An error has occurred during fetch * @param e */ public void rfidAntennasFetchError(Exception e); } --- NEW FILE: FetchMapsCallback.java --- /** * */ package net.sf.magicmap.client.interfaces; import net.sf.magicmap.server.dto.MapDTO; /** * @author Johannes Zapotoczky (joh...@za...) * */ public interface FetchMapsCallback { /** * Is called, when the server has fetched the MapDTOs from the server * @param mapDTOs */ public void mapsFetched(MapDTO[] mapDTOs); /** * An error has occurred during fetch * @param e */ public void mapFetchError(Exception e); } --- NEW FILE: FetchRFIDTagsCallback.java --- /** * */ package net.sf.magicmap.client.interfaces; import java.util.Collection; /** * @author Johannes Zapotoczky (joh...@za...) * */ public interface FetchRFIDTagsCallback { /** * @param rfidTags */ public void rfidTagsFetched(Collection rfidTags); /** * An error has occurred during fetch * @param e */ public void rfidTagFetchError(Exception e); } Index: FetchPositionsCallback.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/interfaces/FetchPositionsCallback.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FetchPositionsCallback.java 28 Feb 2006 11:23:16 -0000 1.5 --- FetchPositionsCallback.java 6 Mar 2006 22:21:42 -0000 1.6 *************** *** 5,12 **** package net.sf.magicmap.client.interfaces; - import java.util.Collection; - - import net.sf.magicmap.server.dto.GeoPointDTO; - import net.sf.magicmap.server.dto.MapDTO; import net.sf.magicmap.server.dto.PositionDTO; --- 5,8 ---- *************** *** 22,61 **** public void positionsFetched(PositionDTO[] positions); - /** - * Is called if new geo points have been transmitted - * @param geoPoints - */ - // public void geoPointsFetched(GeoPointDTO[] geoPoints); public void positionFetchError(Exception e); - /** - * Is called, when the server has fetched the MapDTOs from the server - * @param mapDTOs - */ - public void mapsFetched(MapDTO[] mapDTOs); - - /** - * Is called when the server has fetched the GeoPointDTOs from the server - * @param geoPoses - */ - public void geoPointsFetches(GeoPointDTO[] geoPoses); - - - /** - * - * @param infoObjects - */ - public void infoPointsFetched(Collection infoObjects); - - /** - * @param rfidAntennas - */ - public void rfidAntennasFetched(Collection rfidAntennas); - /** - * @param rfidTags - */ - public void rfidTagsFetched(Collection rfidTags); } \ No newline at end of file --- 18,25 ---- --- NEW FILE: FetchGeoPointsCallback.java --- /** * */ package net.sf.magicmap.client.interfaces; import net.sf.magicmap.server.dto.GeoPointDTO; /** * @author Johannes Zapotoczky (joh...@za...) * */ public interface FetchGeoPointsCallback { /** * Is called when the server has fetched the GeoPointDTOs from the server * @param geoPoses */ public void geoPointsFetched(GeoPointDTO[] geoPoses); /** * An error has occurred during fetch * @param e */ public void geoPointFetchError(Exception e); } --- NEW FILE: FetchInfoPointsCallback.java --- /** * */ package net.sf.magicmap.client.interfaces; import java.util.Collection; /** * @author Johannes Zapotoczky (joh...@za...) * */ public interface FetchInfoPointsCallback { /** * * @param infoObjects */ public void infoPointsFetched(Collection infoObjects); /** * An error has occurred during fetch * @param e */ public void infoPointFetchError(Exception e); } |
From: Johannes Z. <jza...@us...> - 2006-03-06 22:21:48
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18597/src/net/sf/magicmap/client/model/node Modified Files: RFIDAntennaNode.java Log Message: changed access to server communication for maps and geo points added base rfid support Index: RFIDAntennaNode.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node/RFIDAntennaNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RFIDAntennaNode.java 28 Feb 2006 11:23:16 -0000 1.1 --- RFIDAntennaNode.java 6 Mar 2006 22:21:43 -0000 1.2 *************** *** 11,14 **** --- 11,16 ---- */ public class RFIDAntennaNode extends Node { + + private RFIDAntenna antenna; /** *************** *** 35,37 **** --- 37,47 ---- } + public RFIDAntenna getAntenna() { + return antenna; + } + + public void setAntenna(RFIDAntenna antenna) { + this.antenna = antenna; + } + } |
From: Johannes Z. <jza...@us...> - 2006-03-06 22:21:46
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18597/src/net/sf/magicmap/client/gui Modified Files: MainGUI.java MapPanel.java Log Message: changed access to server communication for maps and geo points added base rfid support Index: MainGUI.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MainGUI.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MainGUI.java 6 Mar 2006 10:46:57 -0000 1.17 --- MainGUI.java 6 Mar 2006 22:21:43 -0000 1.18 *************** *** 14,17 **** --- 14,18 ---- import java.io.StringWriter; import java.rmi.RemoteException; + import java.util.Iterator; import java.util.Locale; *************** *** 47,50 **** --- 48,52 ---- import net.sf.magicmap.client.model.node.MapNode; import net.sf.magicmap.client.model.node.NodeModel; + import net.sf.magicmap.client.model.node.RFIDAntenna; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.utils.Version; *************** *** 116,119 **** --- 118,122 ---- MapView mapView; private MagicAction invisibleAction; + private MagicAction rfidPollAction; private MagicAction simpleView; private MagicAction normalView; *************** *** 123,128 **** private static final int numberOfdataInvocationRateAction = 10; private MagicAction[] dataInvocationRateAction; - - private Cursor cursor; /** --- 126,129 ---- *************** *** 347,350 **** --- 348,364 ---- }; + rfidPollAction = new MagicAction("rfidpolling", GUIConstants.ICON_RFID_TAG, "rfidpollingtooltip") { + /** + * serial version id + */ + private static final long serialVersionUID = 5676607442930257839L; + /* (non-Javadoc) + * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) + */ + public void actionPerformed(ActionEvent e) { + toogleRfidPolling(); + } + }; + // showAccessPoints = new MagicAction("showaccesspoints") { // *************** *** 496,499 **** --- 510,514 ---- invisibleAction.setEnabled(false); + rfidPollAction.setEnabled(false); disconnectAction.setEnabled(false); newMapAction.setEnabled(false); *************** *** 654,657 **** --- 669,674 ---- bar.addSeparator(); bar.add(GUIBuilder.createToolToggleButton(invisibleAction)); + bar.addSeparator(); + bar.add(GUIBuilder.createToolToggleButton(rfidPollAction)); } *************** *** 684,688 **** newMapAction.setEnabled(true); loadMapAction.setEnabled(true); ! setCursor(cursor); // Controller.getInstance().retrieveMapNames(MainGUI.this, false); --- 701,705 ---- newMapAction.setEnabled(true); loadMapAction.setEnabled(true); ! setCursor(Cursor.DEFAULT_CURSOR); // Controller.getInstance().retrieveMapNames(MainGUI.this, false); *************** *** 798,801 **** --- 815,827 ---- expertView.setEnabled(true); userDefinedView.setEnabled(true); + + boolean rfidAntennaOnMap = false; + Iterator antennaIterator = Controller.getInstance().getRfidAntennas().iterator(); + while (antennaIterator.hasNext()) { + if (((RFIDAntenna) antennaIterator.next()).getMap().equals(info.name)) { + rfidAntennaOnMap = true; + } + } + rfidPollAction.setEnabled(rfidAntennaOnMap); } *************** *** 809,812 **** --- 835,847 ---- statusBar.setInvisible(Controller.getInstance().isInvisible()); } + + + /** + * Allows to activate the rfid polling + */ + protected void toogleRfidPolling() { + Controller.getInstance().setRfidPollingActive(!Controller.getInstance().isRfidPollingActive()); + // Controller.getInstance(). + } *************** *** 815,819 **** */ protected void connect() { - cursor = getCursor(); setCursor(new Cursor(Cursor.WAIT_CURSOR)); statusBar.setMessage(GUIUtils.i18n(GUIConstants.STATE_CONNECTING)); --- 850,853 ---- *************** *** 822,824 **** --- 856,863 ---- } + + public MagicAction getRfidPollAction() { + return rfidPollAction; + } + } Index: MapPanel.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MapPanel.java 28 Feb 2006 11:23:16 -0000 1.15 --- MapPanel.java 6 Mar 2006 22:21:43 -0000 1.16 *************** *** 38,41 **** --- 38,42 ---- import net.sf.magicmap.client.model.node.NodeModel; import net.sf.magicmap.client.model.node.RFIDAntenna; + import net.sf.magicmap.client.model.node.RFIDAntennaNode; import net.sf.magicmap.client.utils.Settings; import net.sf.magicmap.client.views.MapView; *************** *** 275,279 **** menu.addSeparator(); menu.add(GUIBuilder.createMenuItem(propertiesAction)); ! deleteAction.setEnabled(node.getType() == NodeModel.NODETYPE_LOCATION); renameAction.setEnabled(false); propertiesAction.setEnabled(false); --- 276,285 ---- menu.addSeparator(); menu.add(GUIBuilder.createMenuItem(propertiesAction)); ! boolean deletionPossible = node.getType() == NodeModel.NODETYPE_LOCATION ! || ! // node.getType() == NodeModel.NODETYPE_RFID_ANTENNA || ! // node.getType() == NodeModel.NODETYPE_INFO || ! node.getType() == NodeModel.NODETYPE_GEOPOS; ! deleteAction.setEnabled(deletionPossible); renameAction.setEnabled(false); propertiesAction.setEnabled(false); *************** *** 427,430 **** --- 433,444 ---- return; } + if (selectedNode.getType() == NodeModel.NODETYPE_RFID_ANTENNA) { + Controller.getInstance().getRfidAntennas().remove(((RFIDAntennaNode) selectedNode).getAntenna()); + Controller.getInstance().deleteRfidAntenna(selectedNode.getName(), Controller.getInstance().getCurrentMap().name, this); + return; + } + if (selectedNode.getType() == NodeModel.NODETYPE_GEOPOS) { + Controller.getInstance().deleteGeoPoint(selectedNode.getName(), Controller.getInstance().getCurrentMap().name, this); + } } |
From: Johannes Z. <jza...@us...> - 2006-03-06 22:21:46
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18597/src/net/sf/magicmap/client/delegate Modified Files: MapDelegate.java Log Message: changed access to server communication for maps and geo points added base rfid support Index: MapDelegate.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/delegate/MapDelegate.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MapDelegate.java 28 Feb 2006 11:23:16 -0000 1.7 --- MapDelegate.java 6 Mar 2006 22:21:43 -0000 1.8 *************** *** 114,118 **** public void deleteGeoPoint(long sessionId, long id) throws MapException, SessionException, RemoteException{ try { ! this.deleteGeoPoint(sessionId, id); } catch (Exception e) { throw ExceptionHandler.checkException(e); --- 114,118 ---- public void deleteGeoPoint(long sessionId, long id) throws MapException, SessionException, RemoteException{ try { ! this.binding.deleteGeoPoint(sessionId, id); } catch (Exception e) { throw ExceptionHandler.checkException(e); *************** *** 134,137 **** --- 134,139 ---- Controller.getInstance().getRfidAntennas().add(new RFIDAntenna(url, x, y, mapName)); } + + // public void delteRFIDAntenna(long sessionId, id); } \ No newline at end of file |