From 46ca54bc0b6677080d5fe76e0c3c315d023ac75b Mon Sep 17 00:00:00 2001 From: Sungho Park Date: Mon, 27 Feb 2012 21:19:43 +0900 Subject: [PATCH] Initialize --- AUTHORS | 13 + LICENSE | 206 +++++ NOTICE | 1 + build.sh | 159 ++++ builder/build.properties.clean | 259 ++++++ builder/customTargets.xml | 187 ++++ ...rg.tizen.telephony.call_1.3.20.201202101837.jar | Bin 0 -> 29177 bytes ...org.tizen.telephony.sms_1.3.20.201202101837.jar | Bin 0 -> 26699 bytes builder/metadata/pkginfo.manifest | 9 + builder/metadata/web/pkginfo.manifest | 8 + org.tizen.device/.classpath | 7 + org.tizen.device/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 8 + org.tizen.device/META-INF/MANIFEST.MF | 14 + org.tizen.device/build.properties | 5 + org.tizen.device/plugin.xml | 41 + .../src/org/tizen/device/battery/Battery.java | 39 + .../device/battery/page/BatteryConstants.java | 32 + .../org/tizen/device/battery/page/BatteryPage.java | 194 +++++ .../src/org/tizen/device/earjack/Earjack.java | 40 + .../device/earjack/page/EarjackConstants.java | 33 + .../org/tizen/device/earjack/page/EarjackPage.java | 203 +++++ .../src/org/tizen/device/rssi/Rssi.java | 39 + .../src/org/tizen/device/rssi/page/RssiPage.java | 153 ++++ org.tizen.device/src/org/tizen/device/usb/Usb.java | 40 + .../org/tizen/device/usb/page/UsbConstants.java | 32 + .../src/org/tizen/device/usb/page/UsbPage.java | 170 ++++ org.tizen.eventinjector.feature/.project | 17 + org.tizen.eventinjector.feature/build.properties | 2 + org.tizen.eventinjector.feature/feature.properties | 52 ++ org.tizen.eventinjector.feature/feature.xml | 99 +++ org.tizen.injector/.classpath | 7 + org.tizen.injector/.project | 28 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + org.tizen.injector/META-INF/MANIFEST.MF | 25 + org.tizen.injector/OSGI-INF/l10n/bundle.properties | 5 + org.tizen.injector/build.properties | 9 + org.tizen.injector/icons/connect.png | Bin 0 -> 829 bytes org.tizen.injector/icons/disconnect.png | Bin 0 -> 762 bytes org.tizen.injector/icons/injector_view.png | Bin 0 -> 573 bytes org.tizen.injector/plugin.xml | 37 + .../schema/injectorItemProvider.exsd | 115 +++ .../src/org/tizen/injector/DebugLog.java | 35 + .../src/org/tizen/injector/Injector.java | 80 ++ .../org/tizen/injector/protocol/AbstractGA.java | 202 +++++ .../org/tizen/injector/protocol/AbstractItem.java | 55 ++ .../org/tizen/injector/protocol/ByteArrayItem.java | 47 + .../src/org/tizen/injector/protocol/IntItem.java | 47 + .../injector/protocol/InvalidTypeException.java | 37 + .../src/org/tizen/injector/protocol/ItemType.java | 32 + .../org/tizen/injector/protocol/StructureGA.java | 150 ++++ .../protocol/sensor/AbstractSenserMessage.java | 34 + .../protocol/sensor/TestSensorMessage.java | 73 ++ .../injector/provider/AbstractInjectorItem.java | 86 ++ .../injector/provider/AbstractInjectorPage.java | 83 ++ .../receiver/AbstractInjectorReceiver.java | 61 ++ .../org/tizen/injector/socket/LocationSocket.java | 110 +++ .../org/tizen/injector/socket/SensorTCPSocket.java | 137 +++ .../org/tizen/injector/socket/SensorUDPSocket.java | 111 +++ .../org/tizen/injector/socket/TelephonySocket.java | 417 +++++++++ .../sourceProvider/InjectorStateProvider.java | 96 +++ .../src/org/tizen/injector/util/ByteUtil.java | 136 +++ .../src/org/tizen/injector/util/FormPageUtil.java | 378 ++++++++ .../src/org/tizen/injector/util/StringUtil.java | 58 ++ .../src/org/tizen/injector/view/InjectorView.java | 390 +++++++++ .../src/org/tizen/injector/view/Messages.java | 43 + .../org/tizen/injector/view/messages.properties | 2 + org.tizen.location.core/.classpath | 7 + org.tizen.location.core/.project | 28 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 8 + org.tizen.location.core/META-INF/MANIFEST.MF | 16 + .../OSGI-INF/l10n/bundle.properties | 4 + org.tizen.location.core/build.properties | 7 + .../org/tizen/location/core/injector/DebugLog.java | 34 + .../location/core/injector/LocationInjector.java | 222 +++++ .../tizen/location/core/model/GeoLocationVO.java | 89 ++ .../location/core/protocol/AbstractNMEA0183.java | 96 +++ .../tizen/location/core/protocol/GeoLocation.java | 115 +++ .../core/protocol/IdentifiersConstants.java | 121 +++ .../org/tizen/location/core/protocol/Messages.java | 42 + .../location/core/protocol/NMEA0183_GPGGA.java | 114 +++ .../location/core/protocol/NMEA0183_GPGSA.java | 83 ++ .../location/core/protocol/NMEA0183_GPGSV.java | 107 +++ .../location/core/protocol/NMEA0183_GPRMC.java | 106 +++ .../location/core/protocol/SatelliteInfo.java | 100 +++ .../location/core/protocol/messages.properties | 1 + org.tizen.location.log/.classpath | 7 + org.tizen.location.log/.project | 28 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + org.tizen.location.log/META-INF/MANIFEST.MF | 14 + .../OSGI-INF/l10n/bundle.properties | 4 + org.tizen.location.log/build.properties | 8 + org.tizen.location.log/plugin.xml | 13 + .../src/org/tizen/location/log/Log.java | 58 ++ .../src/org/tizen/location/log/Messages.java | 43 + .../src/org/tizen/location/log/messages.properties | 2 + .../src/org/tizen/location/log/page/LogFile.java | 208 +++++ .../src/org/tizen/location/log/page/Messages.java | 44 + .../tizen/location/log/page/messages.properties | 3 + org.tizen.location.manual/.classpath | 7 + org.tizen.location.manual/.project | 28 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + org.tizen.location.manual/META-INF/MANIFEST.MF | 14 + .../OSGI-INF/l10n/bundle.properties | 4 + org.tizen.location.manual/build.properties | 9 + org.tizen.location.manual/plugin.xml | 13 + .../src/org/tizen/location/manual/Manual.java | 58 ++ .../src/org/tizen/location/manual/Messages.java | 43 + .../org/tizen/location/manual/messages.properties | 2 + .../org/tizen/location/manual/page/Coordinate.java | 203 +++++ .../org/tizen/location/manual/page/Messages.java | 45 + .../tizen/location/manual/page/messages.properties | 4 + org.tizen.location.map/.classpath | 7 + org.tizen.location.map/.project | 28 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.core.runtime.prefs | 3 + org.tizen.location.map/META-INF/MANIFEST.MF | 15 + .../OSGI-INF/l10n/bundle.properties | 4 + org.tizen.location.map/build.properties | 8 + org.tizen.location.map/html/googleMap.html | 1 + org.tizen.location.map/plugin.xml | 13 + .../src/org/tizen/location/map/Map.java | 111 +++ .../src/org/tizen/location/map/Messages.java | 43 + .../src/org/tizen/location/map/messages.properties | 2 + .../src/org/tizen/location/map/page/MapImage.java | 400 +++++++++ .../src/org/tizen/location/map/page/Messages.java | 48 ++ .../tizen/location/map/page/messages.properties | 7 + org.tizen.nfc/.classpath | 7 + org.tizen.nfc/.project | 28 + org.tizen.nfc/.settings/org.eclipse.jdt.core.prefs | 8 + org.tizen.nfc/META-INF/MANIFEST.MF | 14 + org.tizen.nfc/build.properties | 5 + org.tizen.nfc/plugin.xml | 13 + org.tizen.nfc/src/org/tizen/nfc/Nfc.java | 33 + .../src/org/tizen/nfc/page/NDEFRecord.java | 61 ++ .../src/org/tizen/nfc/page/NfcCommand.java | 10 + .../src/org/tizen/nfc/page/NfcDialog.java | 72 ++ .../src/org/tizen/nfc/page/NfcMimeType.java | 81 ++ org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java | 954 +++++++++++++++++++++ .../src/org/tizen/nfc/page/NfcStringResource.java | 81 ++ org.tizen.sensor.accelerometer/.classpath | 7 + org.tizen.sensor.accelerometer/.project | 28 + .../.settings/org.eclipse.core.runtime.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 8 + .../META-INF/MANIFEST.MF | 12 + org.tizen.sensor.accelerometer/build.properties | 5 + org.tizen.sensor.accelerometer/plugin.xml | 14 + .../src/org/tizen/sensor/accelerometer/Sensor.java | 39 + .../sensor/accelerometer/page/Accelerometer.java | 688 +++++++++++++++ .../sensor/accelerometer/page/MobilePanel.java | 925 ++++++++++++++++++++ .../tizen/sensor/accelerometer/page/Vector.java | 243 ++++++ .../src/org/tizen/sensor/magnetic/Magnetic.java | 241 ++++++ org.tizen.sensor.light/.classpath | 7 + org.tizen.sensor.light/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 8 + org.tizen.sensor.light/META-INF/MANIFEST.MF | 16 + org.tizen.sensor.light/build.properties | 5 + org.tizen.sensor.light/plugin.xml | 14 + .../src/org/tizen/sensor/light/Light.java | 40 + .../src/org/tizen/sensor/light/page/LightPage.java | 194 +++++ org.tizen.sensor.motion/.classpath | 7 + org.tizen.sensor.motion/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 8 + org.tizen.sensor.motion/META-INF/MANIFEST.MF | 15 + org.tizen.sensor.motion/build.properties | 5 + org.tizen.sensor.motion/plugin.xml | 14 + .../src/org/tizen/sensor/motion/Motion.java | 40 + .../org/tizen/sensor/motion/page/MotionPage.java | 210 +++++ org.tizen.sensor.proximity/.classpath | 7 + org.tizen.sensor.proximity/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 8 + org.tizen.sensor.proximity/META-INF/MANIFEST.MF | 17 + org.tizen.sensor.proximity/build.properties | 5 + org.tizen.sensor.proximity/plugin.xml | 14 + .../src/org/tizen/sensor/proximity/Proximity.java | 41 + .../sensor/proximity/page/ProximityConstants.java | 33 + .../tizen/sensor/proximity/page/ProximityPage.java | 157 ++++ package/build.linux | 296 +++++++ package/build.windows | 296 +++++++ package/pkginfo.manifest | 19 + packaging_eventinjector.sh | 122 +++ packaging_eventinjector_wac.sh | 123 +++ 187 files changed, 13480 insertions(+) create mode 100644 AUTHORS create mode 100644 LICENSE create mode 100644 NOTICE create mode 100755 build.sh create mode 100644 builder/build.properties.clean create mode 100644 builder/customTargets.xml create mode 100644 builder/metadata/data/IDE/plugins/org.tizen.telephony.call_1.3.20.201202101837.jar create mode 100644 builder/metadata/data/IDE/plugins/org.tizen.telephony.sms_1.3.20.201202101837.jar create mode 100644 builder/metadata/pkginfo.manifest create mode 100644 builder/metadata/web/pkginfo.manifest create mode 100644 org.tizen.device/.classpath create mode 100644 org.tizen.device/.project create mode 100644 org.tizen.device/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.device/META-INF/MANIFEST.MF create mode 100644 org.tizen.device/build.properties create mode 100644 org.tizen.device/plugin.xml create mode 100644 org.tizen.device/src/org/tizen/device/battery/Battery.java create mode 100644 org.tizen.device/src/org/tizen/device/battery/page/BatteryConstants.java create mode 100644 org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java create mode 100644 org.tizen.device/src/org/tizen/device/earjack/Earjack.java create mode 100644 org.tizen.device/src/org/tizen/device/earjack/page/EarjackConstants.java create mode 100644 org.tizen.device/src/org/tizen/device/earjack/page/EarjackPage.java create mode 100644 org.tizen.device/src/org/tizen/device/rssi/Rssi.java create mode 100644 org.tizen.device/src/org/tizen/device/rssi/page/RssiPage.java create mode 100644 org.tizen.device/src/org/tizen/device/usb/Usb.java create mode 100644 org.tizen.device/src/org/tizen/device/usb/page/UsbConstants.java create mode 100644 org.tizen.device/src/org/tizen/device/usb/page/UsbPage.java create mode 100644 org.tizen.eventinjector.feature/.project create mode 100644 org.tizen.eventinjector.feature/build.properties create mode 100644 org.tizen.eventinjector.feature/feature.properties create mode 100644 org.tizen.eventinjector.feature/feature.xml create mode 100644 org.tizen.injector/.classpath create mode 100644 org.tizen.injector/.project create mode 100644 org.tizen.injector/.settings/org.eclipse.core.resources.prefs create mode 100644 org.tizen.injector/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.tizen.injector/META-INF/MANIFEST.MF create mode 100644 org.tizen.injector/OSGI-INF/l10n/bundle.properties create mode 100644 org.tizen.injector/build.properties create mode 100644 org.tizen.injector/icons/connect.png create mode 100644 org.tizen.injector/icons/disconnect.png create mode 100644 org.tizen.injector/icons/injector_view.png create mode 100644 org.tizen.injector/plugin.xml create mode 100644 org.tizen.injector/schema/injectorItemProvider.exsd create mode 100644 org.tizen.injector/src/org/tizen/injector/DebugLog.java create mode 100644 org.tizen.injector/src/org/tizen/injector/Injector.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/AbstractGA.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/AbstractItem.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/ByteArrayItem.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/IntItem.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/InvalidTypeException.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/ItemType.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/StructureGA.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/sensor/AbstractSenserMessage.java create mode 100644 org.tizen.injector/src/org/tizen/injector/protocol/sensor/TestSensorMessage.java create mode 100644 org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorItem.java create mode 100644 org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorPage.java create mode 100644 org.tizen.injector/src/org/tizen/injector/receiver/AbstractInjectorReceiver.java create mode 100644 org.tizen.injector/src/org/tizen/injector/socket/LocationSocket.java create mode 100644 org.tizen.injector/src/org/tizen/injector/socket/SensorTCPSocket.java create mode 100644 org.tizen.injector/src/org/tizen/injector/socket/SensorUDPSocket.java create mode 100644 org.tizen.injector/src/org/tizen/injector/socket/TelephonySocket.java create mode 100644 org.tizen.injector/src/org/tizen/injector/sourceProvider/InjectorStateProvider.java create mode 100644 org.tizen.injector/src/org/tizen/injector/util/ByteUtil.java create mode 100644 org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java create mode 100644 org.tizen.injector/src/org/tizen/injector/util/StringUtil.java create mode 100644 org.tizen.injector/src/org/tizen/injector/view/InjectorView.java create mode 100644 org.tizen.injector/src/org/tizen/injector/view/Messages.java create mode 100644 org.tizen.injector/src/org/tizen/injector/view/messages.properties create mode 100644 org.tizen.location.core/.classpath create mode 100644 org.tizen.location.core/.project create mode 100644 org.tizen.location.core/.settings/org.eclipse.core.resources.prefs create mode 100644 org.tizen.location.core/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.tizen.location.core/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.location.core/META-INF/MANIFEST.MF create mode 100644 org.tizen.location.core/OSGI-INF/l10n/bundle.properties create mode 100644 org.tizen.location.core/build.properties create mode 100644 org.tizen.location.core/src/org/tizen/location/core/injector/DebugLog.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/AbstractNMEA0183.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/GeoLocation.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/IdentifiersConstants.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/Messages.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGGA.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSA.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSV.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPRMC.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/SatelliteInfo.java create mode 100644 org.tizen.location.core/src/org/tizen/location/core/protocol/messages.properties create mode 100644 org.tizen.location.log/.classpath create mode 100644 org.tizen.location.log/.project create mode 100644 org.tizen.location.log/.settings/org.eclipse.core.resources.prefs create mode 100644 org.tizen.location.log/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.tizen.location.log/META-INF/MANIFEST.MF create mode 100644 org.tizen.location.log/OSGI-INF/l10n/bundle.properties create mode 100644 org.tizen.location.log/build.properties create mode 100644 org.tizen.location.log/plugin.xml create mode 100644 org.tizen.location.log/src/org/tizen/location/log/Log.java create mode 100644 org.tizen.location.log/src/org/tizen/location/log/Messages.java create mode 100644 org.tizen.location.log/src/org/tizen/location/log/messages.properties create mode 100644 org.tizen.location.log/src/org/tizen/location/log/page/LogFile.java create mode 100644 org.tizen.location.log/src/org/tizen/location/log/page/Messages.java create mode 100644 org.tizen.location.log/src/org/tizen/location/log/page/messages.properties create mode 100644 org.tizen.location.manual/.classpath create mode 100644 org.tizen.location.manual/.project create mode 100644 org.tizen.location.manual/.settings/org.eclipse.core.resources.prefs create mode 100644 org.tizen.location.manual/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.tizen.location.manual/META-INF/MANIFEST.MF create mode 100644 org.tizen.location.manual/OSGI-INF/l10n/bundle.properties create mode 100644 org.tizen.location.manual/build.properties create mode 100644 org.tizen.location.manual/plugin.xml create mode 100644 org.tizen.location.manual/src/org/tizen/location/manual/Manual.java create mode 100644 org.tizen.location.manual/src/org/tizen/location/manual/Messages.java create mode 100644 org.tizen.location.manual/src/org/tizen/location/manual/messages.properties create mode 100644 org.tizen.location.manual/src/org/tizen/location/manual/page/Coordinate.java create mode 100644 org.tizen.location.manual/src/org/tizen/location/manual/page/Messages.java create mode 100644 org.tizen.location.manual/src/org/tizen/location/manual/page/messages.properties create mode 100644 org.tizen.location.map/.classpath create mode 100644 org.tizen.location.map/.project create mode 100644 org.tizen.location.map/.settings/org.eclipse.core.resources.prefs create mode 100644 org.tizen.location.map/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.tizen.location.map/META-INF/MANIFEST.MF create mode 100644 org.tizen.location.map/OSGI-INF/l10n/bundle.properties create mode 100644 org.tizen.location.map/build.properties create mode 100644 org.tizen.location.map/html/googleMap.html create mode 100644 org.tizen.location.map/plugin.xml create mode 100644 org.tizen.location.map/src/org/tizen/location/map/Map.java create mode 100644 org.tizen.location.map/src/org/tizen/location/map/Messages.java create mode 100644 org.tizen.location.map/src/org/tizen/location/map/messages.properties create mode 100644 org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java create mode 100644 org.tizen.location.map/src/org/tizen/location/map/page/Messages.java create mode 100644 org.tizen.location.map/src/org/tizen/location/map/page/messages.properties create mode 100644 org.tizen.nfc/.classpath create mode 100644 org.tizen.nfc/.project create mode 100644 org.tizen.nfc/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.nfc/META-INF/MANIFEST.MF create mode 100644 org.tizen.nfc/build.properties create mode 100644 org.tizen.nfc/plugin.xml create mode 100644 org.tizen.nfc/src/org/tizen/nfc/Nfc.java create mode 100644 org.tizen.nfc/src/org/tizen/nfc/page/NDEFRecord.java create mode 100644 org.tizen.nfc/src/org/tizen/nfc/page/NfcCommand.java create mode 100644 org.tizen.nfc/src/org/tizen/nfc/page/NfcDialog.java create mode 100644 org.tizen.nfc/src/org/tizen/nfc/page/NfcMimeType.java create mode 100644 org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java create mode 100644 org.tizen.nfc/src/org/tizen/nfc/page/NfcStringResource.java create mode 100644 org.tizen.sensor.accelerometer/.classpath create mode 100644 org.tizen.sensor.accelerometer/.project create mode 100644 org.tizen.sensor.accelerometer/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.tizen.sensor.accelerometer/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF create mode 100644 org.tizen.sensor.accelerometer/build.properties create mode 100644 org.tizen.sensor.accelerometer/plugin.xml create mode 100644 org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/Sensor.java create mode 100644 org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/Accelerometer.java create mode 100644 org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/MobilePanel.java create mode 100644 org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/Vector.java create mode 100644 org.tizen.sensor.accelerometer/src/org/tizen/sensor/magnetic/Magnetic.java create mode 100644 org.tizen.sensor.light/.classpath create mode 100644 org.tizen.sensor.light/.project create mode 100644 org.tizen.sensor.light/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.sensor.light/META-INF/MANIFEST.MF create mode 100644 org.tizen.sensor.light/build.properties create mode 100644 org.tizen.sensor.light/plugin.xml create mode 100644 org.tizen.sensor.light/src/org/tizen/sensor/light/Light.java create mode 100644 org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java create mode 100644 org.tizen.sensor.motion/.classpath create mode 100644 org.tizen.sensor.motion/.project create mode 100644 org.tizen.sensor.motion/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.sensor.motion/META-INF/MANIFEST.MF create mode 100644 org.tizen.sensor.motion/build.properties create mode 100644 org.tizen.sensor.motion/plugin.xml create mode 100644 org.tizen.sensor.motion/src/org/tizen/sensor/motion/Motion.java create mode 100644 org.tizen.sensor.motion/src/org/tizen/sensor/motion/page/MotionPage.java create mode 100644 org.tizen.sensor.proximity/.classpath create mode 100644 org.tizen.sensor.proximity/.project create mode 100644 org.tizen.sensor.proximity/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.tizen.sensor.proximity/META-INF/MANIFEST.MF create mode 100644 org.tizen.sensor.proximity/build.properties create mode 100644 org.tizen.sensor.proximity/plugin.xml create mode 100644 org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/Proximity.java create mode 100644 org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityConstants.java create mode 100644 org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityPage.java create mode 100755 package/build.linux create mode 100755 package/build.windows create mode 100644 package/pkginfo.manifest create mode 100755 packaging_eventinjector.sh create mode 100755 packaging_eventinjector_wac.sh diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..fe14544 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,13 @@ +YeongKyoon Lee +DongKyun Yun +DoHyung Hong +SeokYeon Hwang +Hyunjun Son +SangJin Kim +KiTae Kim +JinHyung Jo +SungMin Ha +MunKyu Im +JiHye Kim +GiWoong Kim +HyunGoo Kang diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bbe9d02 --- /dev/null +++ b/LICENSE @@ -0,0 +1,206 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..f085dc6 --- /dev/null +++ b/NOTICE @@ -0,0 +1 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..5bea2e6 --- /dev/null +++ b/build.sh @@ -0,0 +1,159 @@ +#!/bin/bash +start_path=`pwd` + +############################################################### +## +## Please modify parameter value. +## +############################################################### +build_type=N +build_id=eventinjector_build +build_path="`pwd`/../build_result" + +############################################################### +## +## Do not touch here. +## +############################################################### +build_result_directory=${build_type}.${build_id} +builder_path="$start_path/builder" +equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar` +pde_build=`echo org.eclipse.pde.build_*` +metadata_path=$start_path/builder + +if [ "x$1" = "x" ] +then + echo " +Usage : build_ide.sh PLATFORM_NAME TARGET_ECLIPSE_PATH + + PLATFORM_NAME You can set \"linux\" or \"windows\" + TARGET_ECLIPSE_PATH Set target eclipse path. + For example, $HOME/git/fresh-ide-pde +" + exit 1 +fi + +if [ "x$2" = "x" ] +then + echo " +Usage : build_ide.sh $1 TARGET_ECLIPSE_PATH + TARGET_ECLIPSE_PATH Set target eclipse path. + For example, $HOME/git/fresh-ide-pde +" + exit 1 +fi + +build_result_path="$build_path/$build_result_directory" +platform=$1 +based_eclipse_path=$2 +fresh_ide_path=$3 +parent_path_of_based_eclipse=${based_eclipse_path}/.. +architecture=x86 + +case ${platform} in + linux) + archive_platform_name=linux + windowing=gtk + ;; + windows) + archive_platform_name=win32 + windowing=win32 + ;; + *) + echo "${platform} is not support yet." + exit 1 + ;; +esac + +result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip + +if [ -d $build_path ] +then + echo "Build result directory : [$build_path]" +else + echo "Make build result directory [$build_path]" + mkdir -p $build_path +fi + +echo "Remove legacy build files..." +if [ -d ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} ] +then + rm -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} +fi +if [ -e ${build_result_path}/${result_archive_file} ] +then + rm -rf ${build_result_path}/${result_archive_file} +fi + +if [ -d $build_path/plugins ] +then + echo "plugins directory recreate..." + rm -rf $build_path/plugins + mkdir $build_path/plugins +else + echo "Make plugins directory..." + mkdir $build_path/plugins +fi +if [ -d $build_path/features/ ] +then + echo "features directory recreate..." + rm -rf $build_path/features + mkdir $build_path/features +else + echo "Make features directory..." + mkdir $build_path/features +fi + +echo "Copy features from $start_path to $build_path/features" +cp -r $start_path/*.feature $build_path/features + +echo "Copy plugins from $start_path to $build_path/plugins" +cp -r $start_path/* $build_path/plugins +rm -rf $build_path/plugins/*.feature + +echo "Copy fresh ide plugins..." +if [ -d ${fresh_ide_path} ] +then + cp -rf ${fresh_ide_path}/${archive_platform_name}.${windowing}.${architecture}/IDE/features/* ${build_path}/features + cp -rf ${fresh_ide_path}/${archive_platform_name}.${windowing}.${architecture}/IDE/plugins/* ${build_path}/plugins +else + echo "ERROR : Fresh IDE does not exist..." + exit 1 +fi + +echo "Make build.properties file..." +if [ ! -e $builder_path/build.properties.clean ] ; then + echo "ERROR : \"build.properties.clean\" file does not exist..." + exit 1 +fi +cp $builder_path/build.properties.clean $build_path +cp $builder_path/customTargets.xml $build_path + +if [ -d $based_eclipse_path ] +then + sed -e "s;\(^buildDirectory=\).*;\1${build_path};g" -e "s;\(^base=\).*;\1${parent_path_of_based_eclipse};g" -e "s;\(^baseLocation=\).*;\1${based_eclipse_path};g" -e "s;\(^configs=\).*;\1${archive_platform_name},${windowing},${architecture};g" -e "s;\(^buildType=\).*;\1${build_type};g" -e "s;\(^buildId=\).*;\1${build_id};g" < $build_path/build.properties.clean > $build_path/build.properties +else + echo "ERROR : target eclipse is not exist." + exit 1 +fi + +echo "Execute Product Ant Builder..." +java -server -XX:+UseParNewGC -jar ${based_eclipse_path}/plugins/$equinox_launcher -application org.eclipse.ant.core.antRunner -buildfile ${based_eclipse_path}/plugins/$pde_build/scripts/productBuild/productBuild.xml -Dbuilder=$build_path 2>&1 + +if [ $? != 0 ]; +then + echo "Build failed..." + exit 1 +fi + +echo "unzip to $build_result_path" +unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture} + +#echo "Delete temp files..." +#rm -rf $build_path/features +#rm -rf $build_path/plugins +#rm $build_path/*.xml +#rm $build_path/*.properties +#rm $build_path/*.properties.clean + +echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"." diff --git a/builder/build.properties.clean b/builder/build.properties.clean new file mode 100644 index 0000000..1e101ef --- /dev/null +++ b/builder/build.properties.clean @@ -0,0 +1,259 @@ +############################################################################### +# Copyright (c) 2003, 2006 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +##################### +# Parameters describing how and where to execute the build. +# Typical users need only update the following properties: +# baseLocation - where things you are building against are installed +# bootclasspath - The base jars to compile against (typicaly rt.jar) +# configs - the list of {os, ws, arch} configurations to build. +# +# Of course any of the settings here can be overridden by spec'ing +# them on the command line (e.g., -DbaseLocation=d:/eclipse + +#The type of the top level element we are building, generally "feature" +topLevelElementType=feature +#The id of the top level element we are building +topLevelElementId=org.tizen.eventinjector.feature + +############# PRODUCT/PACKAGING CONTROL ############# +#runPackager=true + +#Set the name of the archive that will result from the product build. +#archiveNamePrefix= + +# The prefix that will be used in the generated archive. +archivePrefix=eventinjector + +# The location underwhich all of the build output will be collected. +collectingFolder=${archivePrefix} + +# The list of {os, ws, arch} configurations to build. This +# value is a '&' separated list of ',' separate triples. For example, +# configs=win32,win32,x86 & linux,motif,x86 +# By default the value is *,*,* +configs="Do not touch here." +#configs=win32, win32, x86 & \ +# win32,win32,x86_64 & \ +# win32,win32,wpf & \ +# linux, gtk, ppc & \ +# linux, gtk, x86 & \ +# linux, gtk, x86_64 & \ +# linux, motif, x86 & \ +# solaris, motif, sparc & \ +# solaris, gtk, sparc & \ +# aix, motif, ppc & \ +# hpux, motif, ia64_32 & \ +# macosx, carbon, ppc & \ +# macosx, carbon, x86 & \ +# macosx, cocoa, ppc & \ +# macosx, cocoa, x86 & \ +# macosx, cocoa, x86_64 + +# By default PDE creates one archive (result) per entry listed in the configs property. +# Setting this value to true will cause PDE to only create one output containing all +# artifacts for all the platforms listed in the configs property. +# To control the output format for the group, add a "group, group, group - " entry to the +# archivesFormat. +#groupConfigurations=true + +#The format of the archive. By default a zip is created using antZip. +#The list can only contain the configuration for which the desired format is different than zip. +#archivesFormat=win32, win32, x86 - antZip& \ +# linux, gtk, ppc - antZip &\ +# linux, gtk, x86 - antZip& \ +# linux, gtk, x86_64 - antZip& \ +# linux, motif, x86 - antZip& \ +# solaris, motif, sparc - antZip& \ +# solaris, gtk, sparc - antZip& \ +# aix, motif, ppc - antZip& \ +# hpux, motif, PA_RISC - antZip& \ +# macosx, carbon, ppc - antZip + +#Allow cycles involving at most one bundle that needs to be compiled with the rest being binary bundles. +allowBinaryCycles=true + +#Sort bundles depenedencies across all features instead of just within a given feature. +#flattenDependencies = true + +#Parallel compilation, requires flattenedDependencies=true +#parallelCompilation=true +#parallelThreadCount= +#parallelThreadsPerProcessor= + +#Set to true if you want the output to be ready for an update jar (no site.xml generated) +#outputUpdateJars = false + +#Set to true for Jnlp generation +#codebase should be a URL that will be used as the root of all relative URLs in the output. +#generateJnlp=false +#jnlp.codebase= +#jnlp.j2se= +#jnlp.locale= +#jnlp.generateOfflineAllowed=true or false generate attribute in the generated features +#jnlp.configs=${configs} #uncomment to filter the content of the generated jnlp files based on the configuration being built + +#Set to true if you want to sign jars +#signJars=false +#sign.alias= +#sign.keystore= +#sign.storepass= +#sign.keypass= + +#Arguments to send to the zip executable +#zipargs= + +#Arguments to send to the tar executable +#tarargs= + +#Control the creation of a file containing the version included in each configuration - on by default +#generateVersionsLists=false + +############## BUILD NAMING CONTROL ################ +# The directory into which the build elements are fetched and where +# the build takes place. +buildDirectory="Do not touch here" + +# Type of build. Used in naming the build output. Typically this value is +# one of I, N, M, S, ... +buildType="Do not touch here" + +# ID of the build. Used in naming the build output. +buildId="Do not touch here" + +# Label for the build. Used in naming the build output +buildLabel=${buildType}.${buildId} + +# Timestamp for the build. Used in naming the build output +timestamp=007 + +#The value to be used for the qualifier of a plugin or feature when you want to override the value computed by pde. +#The value will only be applied to plugin or features indicating build.properties, qualifier = context +#forceContextQualifier= + +#Enable / disable the generation of a suffix for the features that use .qualifier. +#The generated suffix is computed according to the content of the feature +#generateFeatureVersionSuffix=true + +############# BASE CONTROL ############# +# Settings for the base Eclipse components and Java class libraries +# against which you are building. +# Base location for anything the build needs to compile against. For example, +# in most RCP app or a plug-in, the baseLocation should be the location of a previously +# installed Eclipse against which the application or plug-in code will be compiled and the RCP delta pack. + +base="Do not touch here" +baseLocation="Do not touch here" + + +#Folder containing repositories whose content is needed to compile against +#repoBaseLocation=${base}/repos +#Folder where the content of the repositories from ${repoBaseLocation} will be made available as a form suitable to be compiled against +#transformedRepoLocation=${base}/transformedRepos + +#Os/Ws/Arch/nl of the eclipse specified by baseLocation +baseos=linux +basews=gtk +basearch=x86 + +#this property indicates whether you want the set of plug-ins and features to be considered during the build to be limited to the ones reachable from the features / plugins being built +filteredDependencyCheck=false + +#this property indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons) +resolution.devMode=false + +#pluginPath is a list of locations in which to find plugins and features. This list is separated by the platform file separator (; or :) +#a location is one of: +#- the location of the jar or folder that is the plugin or feature : /path/to/foo.jar or /path/to/foo +#- a directory that contains a /plugins or /features subdirectory +#- the location of a feature.xml, or for 2.1 style plugins, the plugin.xml or fragment.xml +#pluginPath= + +skipBase=true +eclipseURL= +eclipseBuildId= +eclipseBaseURL=${eclipseURL}/eclipse-platform-${eclipseBuildId}-win32.zip + + +############# MAP FILE CONTROL ################ +# This section defines CVS tags to use when fetching the map files from the repository. +# If you want to fetch the map file from repository / location, change the getMapFiles target in the customTargets.xml + +skipMaps=true +mapsRepo=:pserver:anonymous@example.com/path/to/repo +mapsRoot=path/to/maps +mapsCheckoutTag=HEAD + +#tagMaps=true +mapsTagTag=v${buildId} + + +############ REPOSITORY CONTROL ############### +# This section defines properties parameterizing the repositories where plugins, fragments +# bundles and features are being obtained from. + +# The tags to use when fetching elements to build. +# By default thebuilder will use whatever is in the maps. +# This value takes the form of a comma separated list of repository identifier (like used in the map files) and the +# overriding value +# For example fetchTag=CVS=HEAD, SVN=v20050101 +# fetchTag=HEAD +skipFetch=true + + +############# P2 OPTIONS ############## +#p2.gathering = true +#p2.compress=true + +############# JAVA COMPILER OPTIONS ############## +# The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE +#bootclasspath=${java.home}/lib/rt.jar + +# specific JRE locations to compile against. These values are used to compile bundles specifying a +# Bundle-RequiredExecutionEnvironment. Uncomment and set values for environments that you support +#CDC-1.0/Foundation-1.0= /path/to/rt.jar +#CDC-1.1/Foundation-1.1= +#OSGi/Minimum-1.0= +#OSGi/Minimum-1.1= +#JRE-1.1= +#J2SE-1.2= +#J2SE-1.3= +#J2SE-1.4= +#J2SE-1.5= +#JavaSE-1.6= +#PersonalJava-1.1= +#PersonalJava-1.2= +#CDC-1.0/PersonalBasis-1.0= +#CDC-1.0/PersonalJava-1.0= +#CDC-1.1/PersonalBasis-1.1= +#CDC-1.1/PersonalJava-1.1= + +# Specify the output format of the compiler log when eclipse jdt is used +logExtension=.log + +# Whether or not to include debug info in the output jars +javacDebugInfo=false + +# Whether or not to fail the build if there are compiler errors +javacFailOnError=true + +# Enable or disable verbose mode of the compiler +javacVerbose=true + +# Extra arguments for the compiler. These are specific to the java compiler being used. +#compilerArg= + +# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties +javacSource=1.6 + +# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties. +javacTarget=1.6 + + diff --git a/builder/customTargets.xml b/builder/customTargets.xml new file mode 100644 index 0000000..6a42e92 --- /dev/null +++ b/builder/customTargets.xml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/builder/metadata/data/IDE/plugins/org.tizen.telephony.call_1.3.20.201202101837.jar b/builder/metadata/data/IDE/plugins/org.tizen.telephony.call_1.3.20.201202101837.jar new file mode 100644 index 0000000000000000000000000000000000000000..971ecc5357bfa3c7d6c47a3a7605598f5c36950a GIT binary patch literal 29177 zcmbTdb9`mpwk?{9ZQHhO+pL%?wo!4#wr$(C?NpqKor?3a&)(;p`<-|1_ujti@80KF zztQ?=qt8BDQih~l z4#avV{ssgD4-5o^`jz%yp>jgn46tabK1{RJhDG8xRtVf-Corp;#zvRE}60*(Q@lutq}HI6_Y0Kj zFRY3O^9a`VGO6{B8pD|xB05{k=?i`fSzxbQLiVM@&o*>8aW?~ly7Q}Vrq-tR7IwBC zf0Kdr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n|SCHAJc=nJmDe!leyRa8S6bbd}6-RM6)B zH^y`}p5jk}3Ndc=ofe$oc=zxZSkLMM2QVu>rGUUP68M~mqbGQ!gqtCsT(pJYFtO1L zf{kOjP4+OC0Tq=euj(+{rgH{2te?&3>;h09Z@vO~8HShk=URraip*a41(TDKEFa{f zC-P3Wnpq}HKkW$8Jedaa1Iq(?Bwhdy>CR=J<##8e95kYJz{I2M!(+p$@>MLL7$$(i?@-jEE_fo zGn74z{@d&;Z(LY5Y&2mg+xpgTvqi7+S-{2?hOG=X;w7{)PP{*_3?}|1Y-O;q@1T_> z6aIN+Fp=1+8oeBDH?A`!AdE-_fFAtAPz^1Fa^3@^`EGzJ`P)!`@DTlBu}= zKk|RvRe{CB-mrk;-$24?{knbriT}y$gS|2U#mn*i3H~P&5Y`7Cil5>C6Z}u+AgnJn z6n`lA2l)T)SXdVcDEx`cui!uQ)IS|2V0#tz&>zaaA@{p%s0#or9rjQfN^g<>1Nzkw zH7p(Ws1r)>QT%QCPlhAxaTt_+P38C5e;0z;FwDZTVU3$m_H~`#V?#}yuxwasA(V}( z``hfFvIi+>?`9EEF0E90%bE9{DS@WQW(Zu0*i;; hutM=?M*rNtD#{>0*0a~H(LsK`qFuYTVSM@D{{bN_K{EgV literal 0 HcmV?d00001 diff --git a/builder/metadata/data/IDE/plugins/org.tizen.telephony.sms_1.3.20.201202101837.jar b/builder/metadata/data/IDE/plugins/org.tizen.telephony.sms_1.3.20.201202101837.jar new file mode 100644 index 0000000000000000000000000000000000000000..447f5185dfc1bd06e35bd4bdd273af4f24e7b691 GIT binary patch literal 26699 zcmb4qb9m;l4h-RGF zQtEQXJSv{RPkXTTzR5rTn0RV3%KWcPgG8x3=wheQ0sWzKoskL|vOC4LG1m;9L+17{l}D`Pr42U|O12Pbo5Mo^opbOlFQU%m6DV5)Dn{tw4~N2dS#D#BHm0bFD5*INYd~j<)V4`eeT+GSs@p;GP9l+^k=~X}ZPtyg zEp!Ct+dTmu=yHD{kG+)f9N@q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SNUhu7bYJw z3<1r5$@H82e?=o;YGAsq(Hgzye@o-nrxw#zjK+i5e+&O3lQHHoV488!BDXnyOXSDa zTud2EQz%--kn8`G`Q9Rmse)-rM5{>g{GJNhD)(=TBBmOq6%Vae1N?v0z8Ui{H86c` zXpKJ9TjFm#O$;zxZkPg?1~Ih29N%vV{9wz6sex(!LTfmoHUmF9h~EHXI=|51u3v!v zc;EP$4-9kcn3g8AgpR<^$Noc!KR;7r3Sc(gqXmdjX11SA&L0B5e)+&`zD9$sP$31s z1b^3xjX7M*hGH~z4rTWKPwHRo#h6sg23a)KLGm}Kf3?eEQZf57(NvK1Z&3g0(!``< zb^)TP0c{XLrQc;y%LZ=brp z-|b^g2IdA9jh;9DUG!huSxhwM<_wL#X8QeBO-BPC^_d3?iwpHNhx#uJ`erA8{STDR BlrjJS literal 0 HcmV?d00001 diff --git a/builder/metadata/pkginfo.manifest b/builder/metadata/pkginfo.manifest new file mode 100644 index 0000000..8bbc440 --- /dev/null +++ b/builder/metadata/pkginfo.manifest @@ -0,0 +1,9 @@ +Package:EventInjector +Version:1.1 +Architecture:i386 +Maintainer:juyung Kim , jaewon lim , sungmin Ha +Description:EventInjector for emulator +Install-script: +Remove-script: +Category:IDE/SLP IDE/Plugins/EventInjector +Depends: diff --git a/builder/metadata/web/pkginfo.manifest b/builder/metadata/web/pkginfo.manifest new file mode 100644 index 0000000..9fa75b9 --- /dev/null +++ b/builder/metadata/web/pkginfo.manifest @@ -0,0 +1,8 @@ +Package:EventInjector_Web +Version:1.1 +Architecture:i386 +Maintainer:dongkyun Yun , sungmin Ha +Description:EventInjector for emulator +Install-script: +Remove-script: +Category:IDE/WEB IDE/Plugins/EventInjector diff --git a/org.tizen.device/.classpath b/org.tizen.device/.classpath new file mode 100644 index 0000000..121e527 --- /dev/null +++ b/org.tizen.device/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.device/.project b/org.tizen.device/.project new file mode 100644 index 0000000..d1e624e --- /dev/null +++ b/org.tizen.device/.project @@ -0,0 +1,28 @@ + + + org.tizen.device + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.device/.settings/org.eclipse.jdt.core.prefs b/org.tizen.device/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..71c4657 --- /dev/null +++ b/org.tizen.device/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Tue Oct 04 17:29:44 KST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.device/META-INF/MANIFEST.MF b/org.tizen.device/META-INF/MANIFEST.MF new file mode 100644 index 0000000..6480f6d --- /dev/null +++ b/org.tizen.device/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Device +Bundle-SymbolicName: org.tizen.device;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Tizen +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.tizen.injector, + org.eclipse.swt;bundle-version="3.6.2", + org.tizen.common, + org.tizen.common.connection, + org.eclipse.core.runtime;bundle-version="3.7.0" +Import-Package: org.tizen.sdblib, + org.eclipse.ui.plugin diff --git a/org.tizen.device/build.properties b/org.tizen.device/build.properties new file mode 100644 index 0000000..e9863e2 --- /dev/null +++ b/org.tizen.device/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.tizen.device/plugin.xml b/org.tizen.device/plugin.xml new file mode 100644 index 0000000..67f0909 --- /dev/null +++ b/org.tizen.device/plugin.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/org.tizen.device/src/org/tizen/device/battery/Battery.java b/org.tizen.device/src/org/tizen/device/battery/Battery.java new file mode 100644 index 0000000..0dfad4d --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/battery/Battery.java @@ -0,0 +1,39 @@ +/* + * org.tizen.device.battery + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.battery; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.device.battery.page.BatteryPage; + +public class Battery extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new BatteryPage(this, "Battery")); + } + +} diff --git a/org.tizen.device/src/org/tizen/device/battery/page/BatteryConstants.java b/org.tizen.device/src/org/tizen/device/battery/page/BatteryConstants.java new file mode 100644 index 0000000..e7ee27d --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/battery/page/BatteryConstants.java @@ -0,0 +1,32 @@ +/* + * org.tizen.device.battery + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.battery.page; + +public class BatteryConstants { + public static final String Connect = "Connect"; + public static final String Disconnect = "Disconnect"; +} diff --git a/org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java b/org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java new file mode 100644 index 0000000..e4ac294 --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java @@ -0,0 +1,194 @@ +/* + * org.tizen.device.battery + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.battery.page; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Slider; +import org.eclipse.swt.widgets.Text; + +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; + +public class BatteryPage extends AbstractInjectorPage implements ISelectionListener { + private Text sliderText; + private Slider slider; + private final String levelNumber = "8\n"; + private final String batteryLevel = "Level : "; + private final String batteryCharger = "Charger : "; + private int sendData = 100; + private Button radioButton[]; + private int sensorOn; + private IDevice currentDevice; + + public BatteryPage(AbstractInjectorItem item, String name) { + super(item, name); + } + + @Override + protected void createContents() { + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + ConnectionPlugin.getDefault().addSelectionListener(this); + sensorOn = 0; + + Composite mainComposite = formUtil.createComposite(parent, 3); + formUtil.createLabel(mainComposite, batteryLevel); + slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL); + slider.setValues(100, 1, 101, 1, 1, 1); + slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); + sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection())); + sliderText.setEditable(false); + GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false); + gd.widthHint = 24; + sliderText.setLayoutData(gd); + sendData = slider.getSelection(); + slider.addSelectionListener(new SelectionListener() { + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + @Override + public void widgetSelected(SelectionEvent e) { + sendData = slider.getSelection(); + sliderText.setText(Integer.toString(sendData)); + sendMessage(sendData, sensorOn); + } + }); + + Composite secondComposite = formUtil.createComposite(parent, 5); + formUtil.createLabel(secondComposite, batteryCharger); + radioButton = new Button[2]; + radioButton[0] = formUtil.createButton(secondComposite, BatteryConstants.Connect, SWT.RADIO); + radioButton[1] = formUtil.createButton(secondComposite, BatteryConstants.Disconnect, SWT.RADIO); + radioButton[1].setSelection(true); + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) { // On + sensorOn = 1; + } + else { // Off + sensorOn = 0; + } + } + } + + radioButton[0].addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) { // On + sensorOn = 1; + } + else { // Off + sensorOn = 0; + } + } + super.widgetSelected(e); + sendMessage(sendData, sensorOn); + } + } + }); + + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } + } + + private boolean checkDeviceConnectedAlready() { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + public void sendMessage(int level, int charger) { + TestSensorMessage msg = new TestSensorMessage(level, charger); + try { + // sensorSocket.send(levelNumber + msg.getMessage()); + injectorSocket.sendSensor(levelNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + +// @Override + public void connect() { + // TODO Auto-generated method stub + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + } + +// @Override + public void disconnect() { + // TODO Auto-generated method stub + } + + @Override + protected void finalize() throws Throwable { + ConnectionPlugin.getDefault().removeSelectionListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + if( selectedEntry == null) + { + disconnect(); + return; + } + else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) + return; + + if(currentDevice == null && selectedEntry.getName() != null) + connect(); + else if(currentDevice == null && selectedEntry.getName() == null) + return; + else if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect(); + connect(); + } + sendMessage(sendData, sensorOn); + } +} diff --git a/org.tizen.device/src/org/tizen/device/earjack/Earjack.java b/org.tizen.device/src/org/tizen/device/earjack/Earjack.java new file mode 100644 index 0000000..4fd26e9 --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/earjack/Earjack.java @@ -0,0 +1,40 @@ +/* + * org.tizen.device.earjack + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.earjack; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.device.earjack.page.EarjackPage; + +public class Earjack extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new EarjackPage(this, "Earjack")); + + } + +} diff --git a/org.tizen.device/src/org/tizen/device/earjack/page/EarjackConstants.java b/org.tizen.device/src/org/tizen/device/earjack/page/EarjackConstants.java new file mode 100644 index 0000000..ed16665 --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/earjack/page/EarjackConstants.java @@ -0,0 +1,33 @@ +/* + * org.tizen.device.earjack + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.earjack.page; + +public class EarjackConstants { + public static final String wire3= "3 Wire"; + public static final String wire4 = "4 Wire"; + public static final String disconnect = "Disconnect"; +} diff --git a/org.tizen.device/src/org/tizen/device/earjack/page/EarjackPage.java b/org.tizen.device/src/org/tizen/device/earjack/page/EarjackPage.java new file mode 100644 index 0000000..52c0268 --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/earjack/page/EarjackPage.java @@ -0,0 +1,203 @@ +/* + * org.tizen.device.earjack + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.earjack.page; + +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.SWT; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; + +public class EarjackPage extends AbstractInjectorPage implements ISelectionListener { + + private Button radioButton[]; + private final String sensorNumber = "9\n"; + private int earjack_status, tmp_status = -1; + private IDevice currentDevice; + + public EarjackPage(AbstractInjectorItem item, String name) { + super(item, name); + // TODO Auto-generated constructor stub + } + + @Override + protected void createContents() { + ConnectionPlugin.getDefault().addSelectionListener(this); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + + Composite mainComposite = formUtil.createComposite(parent, 6); + radioButton = new Button[3]; + radioButton[0] = formUtil.createButton(mainComposite, EarjackConstants.wire3, SWT.RADIO); + radioButton[1] = formUtil.createButton(mainComposite, EarjackConstants.wire4, SWT.RADIO); + radioButton[2] = formUtil.createButton(mainComposite, EarjackConstants.disconnect, SWT.RADIO); + radioButton[2].setSelection(true); + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) // 3wire + earjack_status = 1; + else if(i == 1) // 4wire + earjack_status = 3; + else + earjack_status = 0; + } + } + + radioButton[0].addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) // 3wire + earjack_status = 1; + else if(i == 1) // 4wire + earjack_status = 3; + else + earjack_status = 0; + } + super.widgetSelected(e); + sendMessage(earjack_status); + } + } + }); + + radioButton[1].addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) // 3wire + earjack_status = 1; + else if(i == 1) // 4wire + earjack_status = 3; + else + earjack_status = 0; + } + super.widgetSelected(e); + sendMessage(earjack_status); + } + } + }); + + radioButton[2].addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) // 3wire + earjack_status = 1; + else if(i == 1) // 4wire + earjack_status = 3; + else + earjack_status = 0; + } + super.widgetSelected(e); + sendMessage(earjack_status); + } + } + }); + + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } + } + + private boolean checkDeviceConnectedAlready() { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + + public void sendMessage(int status) { + if(tmp_status != status) + { + TestSensorMessage msg = new TestSensorMessage(status); + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + tmp_status = status; + } + } + +// @Override + public void connect() { + // TODO Auto-generated method stub + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + } + +// @Override + public void disconnect() { + // TODO Auto-generated method stub + } + + @Override + protected void finalize() throws Throwable { + ConnectionPlugin.getDefault().removeSelectionListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + if( selectedEntry == null) + { + disconnect(); + return; + } + else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) + return; + + if(currentDevice == null && selectedEntry.getName() != null) + connect(); + else if(currentDevice == null && selectedEntry.getName() == null) + return; + else if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect(); + connect(); + } + sendMessage(earjack_status); + } +} diff --git a/org.tizen.device/src/org/tizen/device/rssi/Rssi.java b/org.tizen.device/src/org/tizen/device/rssi/Rssi.java new file mode 100644 index 0000000..eaae186 --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/rssi/Rssi.java @@ -0,0 +1,39 @@ +/* + * org.tizen.device.rssi + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.rssi; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.device.rssi.page.RssiPage; + +public class Rssi extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new RssiPage(this, "Rssi")); + } + +} diff --git a/org.tizen.device/src/org/tizen/device/rssi/page/RssiPage.java b/org.tizen.device/src/org/tizen/device/rssi/page/RssiPage.java new file mode 100644 index 0000000..884f486 --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/rssi/page/RssiPage.java @@ -0,0 +1,153 @@ +/* + * org.tizen.device.rssi + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.rssi.page; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Slider; +import org.eclipse.swt.widgets.Text; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; + +public class RssiPage extends AbstractInjectorPage implements ISelectionListener { + private Text sliderText; + private Slider slider; + private final String levelNumber = "11\n"; + private final String rssiLevel = "Level : "; + private int sendData = -1; // initial level + private IDevice currentDevice; + + public RssiPage(AbstractInjectorItem item, String name) { + super(item, name); + } + + @Override + protected void createContents() { + ConnectionPlugin.getDefault().addSelectionListener(this); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + + Composite mainComposite = formUtil.createComposite(parent, 3); + formUtil.createLabel(mainComposite, rssiLevel); + slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL); + slider.setValues(6, 0, 7, 1, 1, 1); + slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); + sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection())); + sliderText.setEditable(false); + GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false); + gd.widthHint = 10; + sliderText.setLayoutData(gd); + sendData = slider.getSelection(); + slider.addSelectionListener(new SelectionListener() { + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + @Override + public void widgetSelected(SelectionEvent e) { + sendData = slider.getSelection(); + sliderText.setText(Integer.toString(sendData)); + sendLevelMessage(sendData); + } + }); + + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } + } + + private boolean checkDeviceConnectedAlready() { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + public void sendLevelMessage(int level) { + TestSensorMessage msg = new TestSensorMessage(level); + try { + // sensorSocket.send(levelNumber + msg.getMessage()); + injectorSocket.sendSensor(levelNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + +// @Override + public void connect() { + // TODO Auto-generated method stub + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + } + +// @Override + public void disconnect() { + // TODO Auto-generated method stub + } + + @Override + protected void finalize() throws Throwable { + ConnectionPlugin.getDefault().removeSelectionListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + if( selectedEntry == null) + { + disconnect(); + return; + } + else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) + return; + + if(currentDevice == null && selectedEntry.getName() != null) + connect(); + else if(currentDevice == null && selectedEntry.getName() == null) + return; + else if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect(); + connect(); + } + sendLevelMessage(sendData); + } +} diff --git a/org.tizen.device/src/org/tizen/device/usb/Usb.java b/org.tizen.device/src/org/tizen/device/usb/Usb.java new file mode 100644 index 0000000..a84881a --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/usb/Usb.java @@ -0,0 +1,40 @@ +/* + * org.tizen.device.usb + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.usb; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.device.usb.page.UsbPage; + +public class Usb extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new UsbPage(this, "Usb")); + + } + +} diff --git a/org.tizen.device/src/org/tizen/device/usb/page/UsbConstants.java b/org.tizen.device/src/org/tizen/device/usb/page/UsbConstants.java new file mode 100644 index 0000000..da0d6fb --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/usb/page/UsbConstants.java @@ -0,0 +1,32 @@ +/* + * org.tizen.device.usb + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.usb.page; + +public class UsbConstants { + public static final String inject = "Connect"; + public static final String remove = "Disconnect"; +} diff --git a/org.tizen.device/src/org/tizen/device/usb/page/UsbPage.java b/org.tizen.device/src/org/tizen/device/usb/page/UsbPage.java new file mode 100644 index 0000000..2869dc7 --- /dev/null +++ b/org.tizen.device/src/org/tizen/device/usb/page/UsbPage.java @@ -0,0 +1,170 @@ +/* + * org.tizen.device.usb + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.device.usb.page; + +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.SWT; + + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; + +public class UsbPage extends AbstractInjectorPage implements ISelectionListener { + + private Button radioButton[]; + private final String sensorNumber = "10\n"; + private boolean sensorOn; + private IDevice currentDevice; + + public UsbPage(AbstractInjectorItem item, String name) { + super(item, name); + // TODO Auto-generated constructor stub + } + + @Override + protected void createContents() { + ConnectionPlugin.getDefault().addSelectionListener(this); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + sensorOn = false; + + Composite mainComposite = formUtil.createComposite(parent, 5); + radioButton = new Button[2]; + radioButton[0] = formUtil.createButton(mainComposite, UsbConstants.inject, SWT.RADIO); + radioButton[1] = formUtil.createButton(mainComposite, UsbConstants.remove, SWT.RADIO); + radioButton[1].setSelection(true); + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) // On + sensorOn = true; + else // Off + sensorOn = false; + } + } + + radioButton[0].addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + for( int i = 0 ; i < radioButton.length ; i++ ) { + if(radioButton[i].getSelection()) { + if( i == 0 ) { // On + sensorOn = true; + } + else { // Off + sensorOn = false; + } + } + super.widgetSelected(e); + if( sensorOn ) { // On + sendMessage(1); + } + else { // Off + sendMessage(0); + } + } + } + }); + + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } + } + + private boolean checkDeviceConnectedAlready() { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + + public void sendMessage(int status) { + TestSensorMessage msg = new TestSensorMessage(status); + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + +// @Override + public void connect() { + // TODO Auto-generated method stub + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + } + +// @Override + public void disconnect() { + // TODO Auto-generated method stub + } + + @Override + protected void finalize() throws Throwable { + ConnectionPlugin.getDefault().removeSelectionListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + if( selectedEntry == null) + { + disconnect(); + return; + } + else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) + return; + + if(currentDevice == null && selectedEntry.getName() != null) + connect(); + else if(currentDevice == null && selectedEntry.getName() == null) + return; + else if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect(); + connect(); + } + if( sensorOn ) // On + sendMessage(1); + else // Off + sendMessage(0); + } +} diff --git a/org.tizen.eventinjector.feature/.project b/org.tizen.eventinjector.feature/.project new file mode 100644 index 0000000..bbf55d3 --- /dev/null +++ b/org.tizen.eventinjector.feature/.project @@ -0,0 +1,17 @@ + + + org.tizen.eventinjector.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/org.tizen.eventinjector.feature/build.properties b/org.tizen.eventinjector.feature/build.properties new file mode 100644 index 0000000..b3a611b --- /dev/null +++ b/org.tizen.eventinjector.feature/build.properties @@ -0,0 +1,2 @@ +bin.includes = feature.xml,\ + feature.properties diff --git a/org.tizen.eventinjector.feature/feature.properties b/org.tizen.eventinjector.feature/feature.properties new file mode 100644 index 0000000..cc442a1 --- /dev/null +++ b/org.tizen.eventinjector.feature/feature.properties @@ -0,0 +1,52 @@ +############################################################################### +# Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# S-Core Co., Ltd +############################################################################### +# feature.properties +# contains externalized strings for feature.xml +# "%foo" in feature.xml corresponds to the key "foo" in this file +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file should be translated. + +# "featureName" property - name of the feature +featureName=Tizen Event Injector + +# "providerName" property - name of the company that provides the feature +providerName=Tizen + +# "updateSiteName" property - label for the update site +updateSiteName=Tizen Event Injector Updates + +# "description" property - description of the feature +description=Tizen SDK's Event Injector. + +# "copyright" property +copyrightURL=https://developer.tizen.org +copyright=Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd.\n\ +All rights reserved.\n + +# "licenseURL" property - URL of the "Feature License" +# do not translate value - just change to point to a locale-specific HTML page +licenseURL=license.html + +# "license" property - text of the "Feature Update License" +# should be plain text version of license agreement pointed to be "licenseURL" +license=\ +Tizen SDK\n\ +\n\ +Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.\n\ + \n\ +The licenses governing the Open Source Software are available at: http://developer.tizen.org/download/tizen_sdk_opensource_license.html\n\ + \n\ +Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: http://developer.tizen.org/download/samsung_sdk_license.html\n\ + \n\ +You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz\n\ + \n\ +BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THE OPEN SOURCE SOFTWARE LICENSE TERMS OR THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, YOU MAY NOT DOWNLOAD OR USE TIZEN SDK.\n +########### end of license property ########################################## diff --git a/org.tizen.eventinjector.feature/feature.xml b/org.tizen.eventinjector.feature/feature.xml new file mode 100644 index 0000000..c375214 --- /dev/null +++ b/org.tizen.eventinjector.feature/feature.xml @@ -0,0 +1,99 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.tizen.injector/.classpath b/org.tizen.injector/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.injector/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.injector/.project b/org.tizen.injector/.project new file mode 100644 index 0000000..f5cae62 --- /dev/null +++ b/org.tizen.injector/.project @@ -0,0 +1,28 @@ + + + org.tizen.injector + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.injector/.settings/org.eclipse.core.resources.prefs b/org.tizen.injector/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..1319378 --- /dev/null +++ b/org.tizen.injector/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Dec 01 09:07:09 CET 2010 +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.tizen.injector/.settings/org.eclipse.core.runtime.prefs b/org.tizen.injector/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000..25618a5 --- /dev/null +++ b/org.tizen.injector/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Tue Dec 14 16:28:54 CET 2010 +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.tizen.injector/META-INF/MANIFEST.MF b/org.tizen.injector/META-INF/MANIFEST.MF new file mode 100644 index 0000000..1d2a129 --- /dev/null +++ b/org.tizen.injector/META-INF/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Injector +Bundle-SymbolicName: org.tizen.injector;singleton:=true +Bundle-Version: 1.3.20.qualifier +Bundle-Vendor: Tizen +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.ui.ide, + org.eclipse.core.resources, + org.eclipse.core.filesystem, + org.tizen.common, + org.eclipse.ui.forms;bundle-version="3.3.103" +Bundle-ActivationPolicy: lazy +Bundle-Activator: org.tizen.injector.Injector +Export-Package: org.tizen.injector.protocol, + org.tizen.injector.protocol.sensor, + org.tizen.injector.provider, + org.tizen.injector.receiver, + org.tizen.injector.socket, + org.tizen.injector.util, + org.tizen.injector.view +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: org.tizen.common.connection, + org.tizen.common.util diff --git a/org.tizen.injector/OSGI-INF/l10n/bundle.properties b/org.tizen.injector/OSGI-INF/l10n/bundle.properties new file mode 100644 index 0000000..f51d150 --- /dev/null +++ b/org.tizen.injector/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,5 @@ +#Properties file for org.tizen.injector +view.name = Event Injector +extension-point.name = InjectorItemProvider +Bundle-Vendor = Tizen +Bundle-Name = Tizen SDK Injector \ No newline at end of file diff --git a/org.tizen.injector/build.properties b/org.tizen.injector/build.properties new file mode 100644 index 0000000..4fc24ed --- /dev/null +++ b/org.tizen.injector/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + OSGI-INF/l10n/bundle.properties +javacSource = 1.6 +javacTarget = 1.6 diff --git a/org.tizen.injector/icons/connect.png b/org.tizen.injector/icons/connect.png new file mode 100644 index 0000000000000000000000000000000000000000..629a33842b6d51d774db040b26dc3d6ce1904dfe GIT binary patch literal 829 zcmV-D1H$}?P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;vq?ljRCwBAtg5PFKnG@KX8-^G{mTHuzkmN``19uv z!<{>K7}3=N1P}`{$J*NZKS-gxygb9dfB(Q5fBg8t@csLDhHu}#G04iwg5{q-e-1YY zAb?nqHG?!VF)_h0$aYp%R)+uo|1)BR~Lw4FEX{2Hf1-z_evb zBg1cIHirNI7#ZqUoMmW?FlJCtP+&N8=nz;Q0+K7}%J8!JQ8?03d)^Km;h7KrR4*AOATRJ~8kyyk`<* z_{q-B!2A{BEv|px7=Hg}Wq^elENuV;5ZC}v=z>BP?8hI>41eCUF#LMT#_;Pi8w1Ab?mv$x}u~=07ZSLEz^c9|no2Eezk8I2eF| z#K8CK6T^}eey|)Uz(JbdzkkmlAtAvC5I`)jKmmmVBO@b2dU`t8h6M|J7^aSg*DSAl4lpJBEGT@6mk009Kg3!tD literal 0 HcmV?d00001 diff --git a/org.tizen.injector/icons/disconnect.png b/org.tizen.injector/icons/disconnect.png new file mode 100644 index 0000000000000000000000000000000000000000..c75f909f285660c492c5a01e38baf22dea8f91d3 GIT binary patch literal 762 zcmVz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;a7jc#RCwBAtg5PFKnIqVmjD0${mTHufByUd;~O__ zFrupk2p|?@j-8#|e~?01Sy_gE|NenB{rK?%jK6*R#-N~}0G5C9frGl+ zO9Ru37A;~pdh{rm4GJ3&00b@?P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-vq?ljRCwBS$FU6nFbo1gyt^mxx?qS>q|7&`uO#U1 z*ak`LE+papb7l&kjsRk8ZEgLpt*y<#%*+fH02u%>=*N#A3}3!{Vfg&{GsE4xcNu2P zn1R(0fB<3v*#OdPX=w=-0P#VF{QC8a;pfkv44XD>0=onk00@HCK?VQ;!~#r6jHRWe|3Q96#vpL_>1&4X z%$#7n=fqo}A*>jI2oOMwuxP{vKz`=7%VYS=z{~KBk&EH~mOQZdnKNhL&HxA?yas@P ziHQkT1u#PZ0*Igi_zVOY0uVqX8-Q*IKmdWGjT~%jZ2TWY0|XcV_tH%tLNO)^00000 LNkvXXu0mjf2QAxr literal 0 HcmV?d00001 diff --git a/org.tizen.injector/plugin.xml b/org.tizen.injector/plugin.xml new file mode 100644 index 0000000..2f36167 --- /dev/null +++ b/org.tizen.injector/plugin.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.tizen.injector/schema/injectorItemProvider.exsd b/org.tizen.injector/schema/injectorItemProvider.exsd new file mode 100644 index 0000000..bc5bc72 --- /dev/null +++ b/org.tizen.injector/schema/injectorItemProvider.exsd @@ -0,0 +1,115 @@ + + + + + + + + + An extension point to provide category item to Function View. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.tizen.injector/src/org/tizen/injector/DebugLog.java b/org.tizen.injector/src/org/tizen/injector/DebugLog.java new file mode 100644 index 0000000..3356c77 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/DebugLog.java @@ -0,0 +1,35 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector; + +public class DebugLog { + + public static void log(Object msg) { + System.out.println("[INJECTOR] " + msg); + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/Injector.java b/org.tizen.injector/src/org/tizen/injector/Injector.java new file mode 100644 index 0000000..c3b0497 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/Injector.java @@ -0,0 +1,80 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Injector extends AbstractUIPlugin { + // The plug-in ID + public static final String PLUGIN_ID = "org.tizen.injector"; //$NON-NLS-1$ + + // The shared instance + private static Injector plugin; + + /** + * The constructor + */ + public Injector() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Injector getDefault() { + return plugin; + } + + public ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/AbstractGA.java b/org.tizen.injector/src/org/tizen/injector/protocol/AbstractGA.java new file mode 100644 index 0000000..1105db5 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/AbstractGA.java @@ -0,0 +1,202 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol; + +import java.nio.ByteBuffer; + +import org.tizen.injector.util.ByteUtil; +import org.tizen.injector.util.StringUtil; + +abstract public class AbstractGA { + + private static final int SINGLE_ROW_INDEX = 0; + + private int groupId; + private int actionId; + private int length = 0; + private StructureGA header; + private StructureGA body; + + public AbstractGA(int groupId, int actionId) { + this.groupId = groupId; + this.actionId = actionId; + } + + abstract protected void makeBody(); + + abstract protected void makeHeader(); + + public void intialize() { + header = new StructureGA(); + makeHeader(); + body = new StructureGA(); + makeBody(); + } + + public void intialize(byte[] packet) { + ByteBuffer byteBuffer = ByteUtil.getByteBuffer(packet); + AbstractItem item = null; + length = packet.length; + + header = new StructureGA(); + makeHeader(); + for (int j = 0; j < header.getItemCount(); j++) { + item = header.getItem(j); + putBufferToItem(item, SINGLE_ROW_INDEX, byteBuffer); + } + + body = new StructureGA(); + makeBody(); + + int loopCount = getLoopCount(); + body.setLoopCount(loopCount); + + for (int i = 0; i < loopCount; i++) { + for (int j = 0; j < body.getItemCount(); j++) { + item = body.getItem(j); + putBufferToItem(item, i, byteBuffer); + } + } + } + + private int getLoopCount() { + return (int) Math.ceil((double) (length - header.getByteLength()) + / body.getByteLength()); + } + + public byte[] makeStarterPacket() { + int byteLength = getSendLength(); + + ByteBuffer buffer = ByteUtil.getByteBuffer(4); + + buffer.putShort((short) byteLength); + buffer.put(((Integer) groupId).byteValue()); + buffer.put(((Integer) actionId).byteValue()); + return buffer.array(); + } + + public byte[] makePacket() { + int byteLength = getSendLength(); + + ByteBuffer buffer = ByteUtil.getByteBuffer(byteLength); + + AbstractItem item = null; + for (int j = 0; j < header.getItemCount(); j++) { + item = header.getItem(j); + putItemToBuffer(item, SINGLE_ROW_INDEX, buffer); + } + + for (int i = 0; i < body.getLoopCount(); i++) { + for (int j = 0; j < body.getItemCount(); j++) { + item = body.getItem(j); + putItemToBuffer(item, i, buffer); + } + } + + return buffer.array(); + } + + private void putItemToBuffer(AbstractItem item, int idx, ByteBuffer buffer) { + ItemType type = item.getType(); + if (type == ItemType.BYTE) { + buffer.put(getIntValue(item, idx).byteValue()); + } else if (type == ItemType.SHORT) { + buffer.putShort(getIntValue(item, idx).shortValue()); + } else if (type == ItemType.INT) { + buffer.putInt(getIntValue(item, idx)); + } else if (type == ItemType.ByteArray) { + byte[] buf = ((ByteArrayItem) item).getValue(idx); + int length = item.getByteLength(); + int pos = buffer.position(); + + if (buf.length > length) { + buffer.put(buf, 0, length); + } else { + buffer.put(buf); + } + + buffer.position(pos + length); + } + } + + private Integer getIntValue(AbstractItem item, int idx) { + return ((IntItem) item).getValue(idx); + } + + private void putBufferToItem(AbstractItem item, int idx, ByteBuffer buffer) { + ItemType type = item.getType(); + try{ + if (type == ItemType.BYTE) { + ((IntItem) item).setValue(idx, buffer.get() & 0xff); + } else if (type == ItemType.SHORT) { + ((IntItem) item).setValue(idx, buffer.getShort()); + } else if (type == ItemType.INT) { + ((IntItem) item).setValue(idx, buffer.getInt()); + } else if (type == ItemType.ByteArray) { + int length = item.getByteLength(); + int remain = buffer.remaining(); + + byte[] buf = null; + if (length > remain) { + buf = new byte[remain]; + } else { + if(item.getName() == "CALL_NUMBER") + buf = new byte[remain]; + else + buf = new byte[length]; + } + + buffer.get(buf, 0, buf.length); + ((ByteArrayItem) item).setValue(idx, buf); + } + } catch(Exception e){ + e.printStackTrace(); + } + } + + public String getKey() { + return StringUtil.makeKey(groupId, actionId); + } + + public int getSendLength() { + return header.getByteLength() + body.getByteLength() + * body.getLoopCount(); + } + + public int getReceiveLength() { + return this.length; + } + + public StructureGA getBody() { + return body; + } + + public StructureGA getHeader() { + return header; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/AbstractItem.java b/org.tizen.injector/src/org/tizen/injector/protocol/AbstractItem.java new file mode 100644 index 0000000..961a5e5 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/AbstractItem.java @@ -0,0 +1,55 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol; + +public class AbstractItem { + private ItemType type; + private int length; + private String name; + + + public AbstractItem(ItemType type, String name, int length){ +// if(this.type!=ItemType.CHAR) +// throw new InvalidTypeException("CHAR type should be created by the constructor, IntItem(ItemType type, String name, int length)"); + this.type = type; + this.name = name; + this.length = length; + } + + public ItemType getType() { + return type; + } + + public int getByteLength() { + return length; + } + + public String getName() { + return name; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/ByteArrayItem.java b/org.tizen.injector/src/org/tizen/injector/protocol/ByteArrayItem.java new file mode 100644 index 0000000..7a402c0 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/ByteArrayItem.java @@ -0,0 +1,47 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol; + +import java.util.ArrayList; + +public class ByteArrayItem extends AbstractItem { + private ArrayList value; + + public ByteArrayItem(ItemType type, String name, int length) { + super(type, name, length); + this.value = new ArrayList(); + } + + public void setValue(int idx, byte[] value) { + this.value.add(value); + } + + public byte[] getValue(int idx) { + return this.value.get(idx); + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/IntItem.java b/org.tizen.injector/src/org/tizen/injector/protocol/IntItem.java new file mode 100644 index 0000000..348b1a4 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/IntItem.java @@ -0,0 +1,47 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol; + +import java.util.ArrayList; + +public class IntItem extends AbstractItem { + private ArrayList value; + + public IntItem(ItemType type, String name, int length) { + super(type, name, length); + this.value = new ArrayList(); + } + + public void setValue(int idx, int value) { + this.value.add(value); + } + + public int getValue(int idx) { + return this.value.get(idx); + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/InvalidTypeException.java b/org.tizen.injector/src/org/tizen/injector/protocol/InvalidTypeException.java new file mode 100644 index 0000000..5d22abf --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/InvalidTypeException.java @@ -0,0 +1,37 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol; + +@SuppressWarnings("serial") +public class InvalidTypeException extends Exception { + + public InvalidTypeException(String message) { + super(message); + } + +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/ItemType.java b/org.tizen.injector/src/org/tizen/injector/protocol/ItemType.java new file mode 100644 index 0000000..af9c7e9 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/ItemType.java @@ -0,0 +1,32 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol; + +public enum ItemType { + BYTE, SHORT, INT, ByteArray +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/StructureGA.java b/org.tizen.injector/src/org/tizen/injector/protocol/StructureGA.java new file mode 100644 index 0000000..1944f87 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/StructureGA.java @@ -0,0 +1,150 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol; + +import java.util.ArrayList; + +import org.tizen.injector.util.ByteUtil; + +public class StructureGA { + + public static final int SINGLE_ROW_INDEX = 0; + + private int loopCount = 1; + private ArrayList list; + + public StructureGA(){ + list = new ArrayList(); + } + + public void addShortItem(String name) { + list.add(new IntItem(ItemType.SHORT, name, ByteUtil.SHORT_LENGTH)); + } + + public void addByteItem(String name) { + list.add(new IntItem(ItemType.BYTE, name, ByteUtil.BYTE_LENGTH)); + } + + public void addIntItem(String name) { + list.add(new IntItem(ItemType.INT, name, ByteUtil.INT_LENGTH)); + } + + public void addByteArrayItem(String name, int length) { + list.add(new ByteArrayItem(ItemType.ByteArray, name, length)); + } + + public int getByteLength(){ + int sum = 0; + for(int i=0; i + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol.sensor; + +public abstract class AbstractSenserMessage { + public String getMessage() { + return "TEST"; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/protocol/sensor/TestSensorMessage.java b/org.tizen.injector/src/org/tizen/injector/protocol/sensor/TestSensorMessage.java new file mode 100644 index 0000000..5a502b4 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/protocol/sensor/TestSensorMessage.java @@ -0,0 +1,73 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.protocol.sensor; + +public class TestSensorMessage extends AbstractSenserMessage { + private double param[]; + private int paramCount; + + public TestSensorMessage(double x, double y, double z, double a, double b, double c, double d){ + param = new double[7]; + param[0] = x; + param[1] = y; + param[2] = z; + param[3] = a; + param[4] = b; + param[5] = c; + param[6] = d; + paramCount = 7; + + } + public TestSensorMessage(double x, double y, double z) { + param = new double[3]; + param[0] = x; + param[1] = y; + param[2] = z; + paramCount = 3; + } + public TestSensorMessage(int level) { + param = new double[1]; + param[0] = level; + paramCount = 1; + } + public TestSensorMessage(int level, int charger) { + param = new double[2]; + param[0] = level; + param[1] = charger; + paramCount = 2; + } + + public String getMessage() { + String message; + message = paramCount + "\n"; + for( int i = 0 ; i < param.length ; i++) { + message += (Double.toString(param[i]) + "\n"); + } + return message; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorItem.java b/org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorItem.java new file mode 100644 index 0000000..9f1af32 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorItem.java @@ -0,0 +1,86 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.provider; + +import java.util.ArrayList; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; + +import org.tizen.injector.util.FormPageUtil; +import org.tizen.injector.view.InjectorView; + +public abstract class AbstractInjectorItem { + private InjectorView view; + + private ArrayList pageList = new ArrayList(); + + public void createContents(Composite parent, FormPageUtil formUtil){ + addPages(); + + TabFolder tabFolder = new TabFolder(parent, SWT.BORDER); + tabFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + tabFolder.addListener(SWT.MouseWheel, new Listener() { + @Override + public void handleEvent(Event event) { + event.doit = false; + } + }); + + for(int i = 0; i < pageList.size(); i++){ + Composite composite = formUtil.createComposite(tabFolder); + composite.setData(new GridData(GridData.FILL_HORIZONTAL));//new GridData(GridData.FILL, GridData.FILL, true, true)); + AbstractInjectorPage page = pageList.get(i); + page.initialize(composite, formUtil); + page.create(); + + TabItem tab = new TabItem(tabFolder, SWT.NULL); + tab.setText(page.getName()); + tab.setControl(composite); + } + } + + protected void addPage(AbstractInjectorPage page){ + pageList.add(page); + } + + public void setView(InjectorView view) { + this.view = view; + } + + public ArrayList getCategoryItems(String category) { + return view.getCategoryCompositeList(category); + } + + abstract protected void addPages(); +} diff --git a/org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorPage.java b/org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorPage.java new file mode 100644 index 0000000..d0b685a --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorPage.java @@ -0,0 +1,83 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.provider; + +import java.util.ArrayList; + +import org.eclipse.swt.widgets.Composite; + +import org.tizen.injector.receiver.AbstractInjectorReceiver; +//import org.tizen.injector.socket.SensorTCPSocket; +import org.tizen.injector.socket.SensorUDPSocket; +import org.tizen.injector.socket.TelephonySocket; +import org.tizen.injector.util.FormPageUtil; + +public abstract class AbstractInjectorPage { + + public AbstractInjectorPage(AbstractInjectorItem item, String name) { + this.item = item; + this.name = name; + } + + private String name; + private AbstractInjectorItem item; + protected FormPageUtil formUtil; + protected Composite parent; + protected TelephonySocket injectorSocket = TelephonySocket.getInstance(); + protected SensorUDPSocket sensorSocket = SensorUDPSocket.getInstance(); +// protected SensorTCPSocket sensorSocket = SensorTCPSocket.getInstance(); + + private ArrayList receiverList = new ArrayList(); + + public void initialize(Composite parent, FormPageUtil formUtil) { + this.parent = parent; + this.formUtil = formUtil; + } + + public void create() { + createContents(); + registerReceivers(); + this.injectorSocket.addInjectorReceiver(receiverList); + } + + public String getName() { + return this.name; + } + + public AbstractInjectorItem getParent() { + return this.item; + } + + protected void registerReceiver(AbstractInjectorReceiver receiver) { + receiverList.add(receiver); + } + + protected abstract void createContents(); + + protected abstract void registerReceivers(); +} diff --git a/org.tizen.injector/src/org/tizen/injector/receiver/AbstractInjectorReceiver.java b/org.tizen.injector/src/org/tizen/injector/receiver/AbstractInjectorReceiver.java new file mode 100644 index 0000000..fa486ff --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/receiver/AbstractInjectorReceiver.java @@ -0,0 +1,61 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.receiver; + +import org.tizen.injector.protocol.AbstractGA; + +abstract public class AbstractInjectorReceiver { + + private AbstractGA aga; + + public void analyzePacket(byte[] packet){ + this.aga = createTransferObject(); + this.aga.intialize(packet); + } + + public void analyzePacket(){ + this.aga = createTransferObject(); + this.aga.intialize(); + this.aga.getHeader().setLoopCount(0); + this.aga.getBody().setLoopCount(0); + } + + public String getKey(){ + if(this.aga==null) + return createTransferObject().getKey(); + else + return this.aga.getKey(); + } + + public AbstractGA getTransferObject(){ + return this.aga; + } + + abstract public AbstractGA createTransferObject(); + abstract public void run(AbstractGA aga); +} diff --git a/org.tizen.injector/src/org/tizen/injector/socket/LocationSocket.java b/org.tizen.injector/src/org/tizen/injector/socket/LocationSocket.java new file mode 100644 index 0000000..031fe66 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/socket/LocationSocket.java @@ -0,0 +1,110 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.socket; + +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetSocketAddress; + +//import org.tizen.injector.DebugLog; + +public class LocationSocket { + private static LocationSocket locationSocket; + + private static final int port = 3579; + private static final String ip = "127.0.0.1"; + + private DatagramSocket socket; + private boolean isConnected = false; + + public static LocationSocket getInstance() { + if (locationSocket == null) + locationSocket = new LocationSocket(); + + return locationSocket; + } + + public void connect() throws Exception { + if (isConnected()) + return; + else + disconnect(); + + socket = new DatagramSocket(); + + try { + socket.connect(new InetSocketAddress(ip, port)); + + isConnected = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + + } + + private boolean isConnected() { + return isConnected && socket != null && !socket.isClosed() + && socket.isConnected(); + } + + public void disconnect() { + if (!isConnected) + return; + + isConnected = false; + + if (socket != null) { + socket.close(); + } + } + + public void sendDispose() throws Exception { + if (!isConnected()) + return; + } + + public boolean send(String sentence) throws Exception { + if (!isConnected()) + connect(); + + boolean result = false; + try { + byte[] bytes = sentence.getBytes(); + DatagramPacket packet = new DatagramPacket(bytes, bytes.length); + socket.send(packet); +// DebugLog.log(bytes); + result = true; + } catch (Exception e) { + disconnect(); + throw e; + } + return result; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/socket/SensorTCPSocket.java b/org.tizen.injector/src/org/tizen/injector/socket/SensorTCPSocket.java new file mode 100644 index 0000000..5dfef23 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/socket/SensorTCPSocket.java @@ -0,0 +1,137 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.socket; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; + +//import org.tizen.injector.DebugLog; +import org.tizen.injector.protocol.sensor.AbstractSenserMessage; + +public class SensorTCPSocket { + private static SensorTCPSocket sensorSocket; + + private static final int port = 3580; + private static final String ip = "127.0.0.1"; + + private Socket socket; + private BufferedOutputStream output; + private BufferedInputStream input; + private boolean isConnected = false; + + public static SensorTCPSocket getInstance() { + if (sensorSocket == null) + sensorSocket = new SensorTCPSocket(); + + return sensorSocket; + } + + public void connect() throws Exception { + if (isConnected()) + return; + else + disconnect(); + + socket = new Socket(); + + try { + socket.setKeepAlive(true); + socket.connect(new InetSocketAddress(ip, port), 1000); + + this.output = new BufferedOutputStream(socket.getOutputStream()); + this.input = new BufferedInputStream(socket.getInputStream()); + + isConnected = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + + } + + private boolean isConnected() { + return isConnected && socket != null && !socket.isClosed() + && socket.isConnected(); + } + + public void disconnect() { + if (!isConnected) + return; + + try { + if (output != null) + output.close(); + if (input != null) + input.close(); + + isConnected = false; + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (socket != null) { + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + public void sendDispose() throws Exception { + if (!isConnected()) + return; + } + + public boolean send(AbstractSenserMessage sendObj) throws Exception { + boolean result = false; + + if (!isConnected()) + return result; + + try { + String msg = sendObj.getMessage(); + byte[] bytes = msg.getBytes(); + +// DebugLog.log(msg); + output.write(bytes); + + output.flush(); + result = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + return result; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/socket/SensorUDPSocket.java b/org.tizen.injector/src/org/tizen/injector/socket/SensorUDPSocket.java new file mode 100644 index 0000000..bdbf697 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/socket/SensorUDPSocket.java @@ -0,0 +1,111 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.socket; + +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetSocketAddress; + +//import org.tizen.injector.DebugLog; + +public class SensorUDPSocket { + private static SensorUDPSocket locationSocket; + + private static final int port = 3580; + private static final String ip = "127.0.0.1"; + + private DatagramSocket socket; + private boolean isConnected = false; + + public static SensorUDPSocket getInstance() { + if (locationSocket == null) + locationSocket = new SensorUDPSocket(); + + return locationSocket; + } + + public void connect() throws Exception { + if (isConnected()) + return; + else + disconnect(); + + socket = new DatagramSocket(); + + try { + socket.connect(new InetSocketAddress(ip, port)); + + isConnected = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + } + + private boolean isConnected() { + return isConnected && socket != null && !socket.isClosed() + && socket.isConnected(); + } + + public void disconnect() { + if (!isConnected) + return; + + isConnected = false; + + if (socket != null) { + socket.close(); + } + } + + public void sendDispose() throws Exception { + if (!isConnected()) + return; + } + + public boolean send(String sentence) throws Exception { + if (!isConnected()) { + connect(); + } + + boolean result = false; + + try { + byte[] bytes = sentence.getBytes(); + DatagramPacket packet = new DatagramPacket(bytes, bytes.length); + socket.send(packet); +// DebugLog.log(sentence); + result = true; + } catch (Exception e) { + disconnect(); + result = false; + } + return result; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/socket/TelephonySocket.java b/org.tizen.injector/src/org/tizen/injector/socket/TelephonySocket.java new file mode 100644 index 0000000..08fba2e --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/socket/TelephonySocket.java @@ -0,0 +1,417 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.socket; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.sdblib.*; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.ui.progress.UIJob; + +import org.tizen.injector.protocol.AbstractGA; +import org.tizen.injector.receiver.AbstractInjectorReceiver; +import org.tizen.injector.util.ByteUtil; +import org.tizen.injector.util.StringUtil; +import org.tizen.injector.view.InjectorView; + +public class TelephonySocket { + private static TelephonySocket telephonySocket; + + public static int port = 26103; // default port but it will be changed when connection start + private static final String ip = "127.0.0.1"; //$NON-NLS-1$ + +// private static HashMap receiverMap = new HashMap(); + private HashMap receiverMap = new HashMap(); + + private Socket socket; + private BufferedOutputStream output; + private BufferedInputStream input; + private boolean isConnected = false; + private Receiver receiverThread; + public boolean callWaiting = false; + private IDevice currentDevice = null; + + public void addInjectorReceiver(ArrayList list) { + if (list == null) + return; + for (int i = 0; i < list.size(); i++) { + AbstractInjectorReceiver receiver = list.get(i); + receiverMap.put(receiver.getKey(), receiver); + } + } + + public void removeInjectorReceiver() { + receiverMap.clear(); + } + + public static TelephonySocket getInstance() { + if (telephonySocket == null) + telephonySocket = new TelephonySocket(); + return telephonySocket; + } + + public void connect() throws Exception { + if (isConnected() && InjectorView.activated == true) + return; + else + disconnect(); + + socket = new Socket(); + + try { + socket.setKeepAlive(true); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + if(currentDevice == null) + return; + String str_localport = currentDevice.getSerialNumber(); + port = Integer.parseInt(str_localport.substring(9, str_localport.length())) + 3; + socket.connect(new InetSocketAddress(ip, port), 1000); + + this.output = new BufferedOutputStream(socket.getOutputStream()); + this.input = new BufferedInputStream(socket.getInputStream()); + + receiverThread = new Receiver(); + receiverThread.start(); + + sendInitialize(); + isConnected = true; + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + + private boolean isConnected() { + return isConnected && socket != null && !socket.isClosed() + && socket.isConnected(); + } + + public void disconnect() { + if (!isConnected) + return; + + try { + if (receiverThread != null) + receiverThread.shutdown(); + if (output != null) + output.close(); + if (input != null) + input.close(); + isConnected = false; + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (socket != null) { + try { + socket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } +// try { +// connect(); +// } catch (Exception e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + } + + private void sendInitialize() throws IOException { + String str = "telephony\n"; + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + byte[] abuf = { 0x04, 0x00, 0x40, 0x41 }; + output.write(abuf); + output.flush(); + + byte[] bbuf = { 0x16, 0x00, 0x00, 0x00 }; + output.write(bbuf); + output.flush(); + + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + byte[] cbuf = { 0x00, 0x00, 0x40, 0x47 }; + output.write(cbuf); + output.flush(); + + byte[] dbuf = { 0x00, 0x00, 0x40, 0x42 }; + output.write(dbuf); + output.flush(); + } + + public void sendAskData() throws Exception { + if (!isConnected()) + connect(); + + String str = "telephony\n"; + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + byte[] buf = { 0x00, 0x00, 0x11, 0x5b }; + output.write(buf); + output.flush(); + } + + public void sendDispose() throws Exception { + if (!isConnected()) + return; + + String str = "telephony\n"; + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + byte[] abuf = { 0x00, 0x00, 0x10, 0x01 }; + output.write(abuf); + output.flush(); + + byte[] bbuf = { 0x00, 0x00, 0x10, 0x02 }; + output.write(bbuf); + output.flush(); + } + + public boolean send(AbstractGA sendObj) throws Exception { + if (!isConnected()) + connect(); + + boolean result = false; + try { + String str = "telephony\n"; + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + byte[] starter = sendObj.makeStarterPacket(); +// ByteUtil.printHex(starter, "send head"); + output.write(starter, 0, starter.length); + output.flush(); + + byte[] main = sendObj.makePacket(); + if (main.length > 0) { +// ByteUtil.printHex(main, "send body"); + output.write(main, 0, main.length); + } + output.flush(); + result = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + return result; + } + + public boolean sendSensor(String sensorMsg) throws Exception { + if (!isConnected()) + connect(); + + boolean result = false; + try { + String str = "sensor\n\n\n\n"; + if(output != null) + output.flush(); + else + return false; + + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + byte[] next_packet_length = { (byte)sensorMsg.getBytes().length, 0x00, 0x00, 0x00 }; + output.write(next_packet_length); + output.flush(); + + byte[] main = sensorMsg.getBytes(); + if (main.length > 0) { +// ByteUtil.printHex(main, "send body"); + output.write(main, 0, main.length); + } + output.flush(); + result = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + return result; + } + + public boolean sendLocation(String locationMsg) throws Exception { + if (!isConnected()) + return false; + + boolean result = false; + try { + String str = "location\n\n"; + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + byte[] next_packet_length = { (byte)locationMsg.getBytes().length, 0x00, 0x00, 0x00 }; + output.write(next_packet_length); + output.flush(); + + byte[] main = locationMsg.getBytes(); + if (main.length > 0) { +// ByteUtil.printHex(main, "send body"); + output.write(main, 0, main.length); + } + output.flush(); + result = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + return result; + } + + public boolean sendNfc(String nfcMsg) throws Exception { + if (!isConnected()) + connect(); + + boolean result = false; + try { + String str = "nfc\n\n\n\n\n\n\n"; + output.write(str.getBytes(), 0, str.length()); + output.flush(); + + String msgLen = Integer.toString(nfcMsg.getBytes().length); + while(msgLen.length() < 5) + { + msgLen = msgLen + "\n"; + } + output.write(msgLen.getBytes(), 0 , msgLen.length()); + output.flush(); + + byte[] main = nfcMsg.getBytes(); + if (main.length > 0) + { +// ByteUtil.printHex(main, "send body"); + output.write(main, 0, main.length); + } + output.flush(); + result = true; + } catch (Exception e) { + e.printStackTrace(); + disconnect(); + throw e; + } + return result; + } + + private class Receiver extends Thread { + private boolean hasActiveReceiver = true; + + public void run() { + try { + byte[] buf = null; + ByteBuffer byteBuffer = null; + int length; + int groupId; + int actionId; + while (hasActiveReceiver) { + buf = new byte[4]; + input.read(buf, 0, buf.length); +// ByteUtil.printHex(buf, "receive head"); + byteBuffer = ByteUtil.getByteBuffer(buf); + length = byteBuffer.getShort(); + groupId = byteBuffer.get() & 0xff; + actionId = byteBuffer.get() & 0xff; + + if (length != 0) { + buf = new byte[length]; + input.read(buf, 0, buf.length); +// ByteUtil.printHex(buf, "receive body"); + } + + // groupid 3: GSM_SUPS, actionid 73: GSM_SUPS_SET_CW_REQ + if(groupId == 3 && actionId == 73) + { + for(int i = 0; i < buf.length; i++) + { + if(buf[i] == -1) // -1: class id 255 + { + if(buf[i + 4] == 3) // 3: cw on + callWaiting = true; + else if(buf[i + 4] == 4) // 4: cw off + callWaiting = false; + } + } + } + + final AbstractInjectorReceiver receiver = getTelephonyReceiver( + groupId, actionId); + + if (receiver == null) { + continue; + } + + if (length == 0) + receiver.analyzePacket(); + else + receiver.analyzePacket(buf); + + UIJob job = new UIJob("Receive packet about [" + groupId + + ":" + actionId + "]") { //$NON-NLS-1$ //$NON-NLS-2$ + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + receiver.run(receiver.getTransferObject()); + return Status.OK_STATUS; + } + }; + job.schedule(); + } + } catch (SocketException e) { + return; + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void shutdown() { + this.hasActiveReceiver = false; + } + + private AbstractInjectorReceiver getTelephonyReceiver(int groupId, + int actionId) { + return receiverMap.get(StringUtil.makeKey(groupId, actionId)); + } + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/sourceProvider/InjectorStateProvider.java b/org.tizen.injector/src/org/tizen/injector/sourceProvider/InjectorStateProvider.java new file mode 100644 index 0000000..8c32707 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/sourceProvider/InjectorStateProvider.java @@ -0,0 +1,96 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.sourceProvider; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.ui.AbstractSourceProvider; +import org.eclipse.ui.ISources; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.services.ISourceProviderService; + +public class InjectorStateProvider extends AbstractSourceProvider { + + public final static String STATE_ID = "org.tizen.injector.sourceProvider.InjectorState"; //$NON-NLS-1$ + public final static String STATE_ON = "ON"; //$NON-NLS-1$ + public final static String STATE_OFF = "OFF"; //$NON-NLS-1$ + private static String state = STATE_OFF; + + @Override + public void dispose() { + + } + + @Override + public Map getCurrentState() { + Map stateMap = new HashMap(); + stateMap.put(STATE_ID, state); + return stateMap; + } + + @Override + public String[] getProvidedSourceNames() { + return new String[]{STATE_ID}; + } + + public void setState(String newState){ + if(state.equals(newState)) + return; + else + state = newState; + + fireSourceChanged(ISources.WORKBENCH, STATE_ID, newState); + } + +/* public static boolean isConnected = false; + + private void setConnectionStatus(boolean isConnected){ + InjectorStateProvider.isConnected = isConnected; + }*/ + + public static void changeSyslogState(String state){ + try { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + // In case of closing Eclipse + if (window == null) { + return; + } + + ISourceProviderService service = (ISourceProviderService)window.getService(ISourceProviderService.class); + InjectorStateProvider provider = (InjectorStateProvider)service.getSourceProvider(InjectorStateProvider.STATE_ID); + provider.setState(state); +// provider.setConnectionStatus(state.equals("ON")?true:false); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/org.tizen.injector/src/org/tizen/injector/util/ByteUtil.java b/org.tizen.injector/src/org/tizen/injector/util/ByteUtil.java new file mode 100644 index 0000000..61f6499 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/util/ByteUtil.java @@ -0,0 +1,136 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.util; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +public class ByteUtil { + private static final ByteOrder BYTE_ORDER = ByteOrder.LITTLE_ENDIAN; + public static final int BYTE_LENGTH = 1; + public static final int SHORT_LENGTH = 2; + public static final int INT_LENGTH = 4; + + public static ByteBuffer getByteBuffer(byte[] buf) { + ByteBuffer byteBuffer = ByteBuffer.allocate(buf.length); + byteBuffer.order(BYTE_ORDER); + byteBuffer.put(buf); + byteBuffer.rewind(); + + return byteBuffer; + } + + public static ByteBuffer getByteBuffer(int length) { + ByteBuffer byteBuffer = ByteBuffer.allocate(length); + byteBuffer.order(BYTE_ORDER); + + return byteBuffer; + } + + public static byte[] short2byte(short s) { + byte dest[] = new byte[2]; + dest[1] = (byte) (s & 0xff); + dest[0] = (byte) (s >>> 8 & 0xff); + return dest; + } + + public static byte[] int2byte(int i) { + byte dest[] = new byte[4]; + dest[3] = (byte) (i & 0xff); + dest[2] = (byte) (i >>> 8 & 0xff); + dest[1] = (byte) (i >>> 16 & 0xff); + dest[0] = (byte) (i >>> 24 & 0xff); + return dest; + } + + public static byte[] long2byte(long l) { + byte dest[] = new byte[8]; + dest[7] = (byte) (int) (l & 255L); + dest[6] = (byte) (int) (l >>> 8 & 255L); + dest[5] = (byte) (int) (l >>> 16 & 255L); + dest[4] = (byte) (int) (l >>> 24 & 255L); + dest[3] = (byte) (int) (l >>> 32 & 255L); + dest[2] = (byte) (int) (l >>> 40 & 255L); + dest[1] = (byte) (int) (l >>> 48 & 255L); + dest[0] = (byte) (int) (l >>> 56 & 255L); + return dest; + } + + public static short byte2short(byte src[]) { + return (short) ((src[0] & 0xff) << 8 | src[1] & 0xff); + } + + public static int byte2int(byte src[]) { + return (src[0] & 0xff) << 24 | (src[1] & 0xff) << 16 + | (src[2] & 0xff) << 8 | src[3] & 0xff; + } + + public static int byte2int(byte src[], int offset) { + return (src[offset] & 0xff) << 24 | (src[offset + 1] & 0xff) << 16 + | (src[offset + 2] & 0xff) << 8 | src[offset + 3] & 0xff; + } + + public static long byte2long(byte src[]) { + return (long) byte2int(src) << 32 | (long) byte2int(src, 4) + & 0xffffffffL; + } + + public static String byte2hex(byte[] src) { + if (src == null) + return null; + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < src.length; i++) { + sb.append(Integer.toHexString(src[i] & 0xff)); + } + return sb.toString(); + } + + public static byte[] hex2byte(String src) { + if (src == null) + return null; + + if (src.length() % 2 != 0) + src = "0" + src; //$NON-NLS-1$ + + byte[] result = new byte[src.length() / 2]; + for (int i = 0; i < result.length; i++) { + result[i] = (byte) Integer.parseInt( + src.substring(2 * i, 2 * i + 2), 16); + } + return result; + } + + // will be removed + public static void printHex(byte[] buf, String flag) { + System.out.print("\n### " + flag + " : "); //$NON-NLS-1$ //$NON-NLS-2$ + for (int i = 0; i < buf.length; i++) { + System.out.format("%02X ", buf[i]); //$NON-NLS-1$ + } + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java b/org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java new file mode 100644 index 0000000..b387fa7 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java @@ -0,0 +1,378 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.util; + +import java.awt.TextArea; + +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.browser.Browser; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Slider; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.forms.events.ExpansionAdapter; +import org.eclipse.ui.forms.events.ExpansionEvent; +import org.eclipse.ui.forms.widgets.ExpandableComposite; +import org.eclipse.ui.forms.widgets.FormToolkit; +import org.eclipse.ui.forms.widgets.ScrolledForm; +import org.eclipse.ui.forms.widgets.Section; + +public class FormPageUtil { + + private ScrolledForm form; + private FormToolkit toolkit; + + private final int TEXT_LIMIT = 200; + + public FormPageUtil(Composite parent) { + initialize(parent); + } + + public void initialize(Composite parent) { + toolkit = new FormToolkit(parent.getDisplay()); + form = toolkit.createScrolledForm(parent); + form.getBody().setLayout(new GridLayout()); + } + + public void setColspan(Control control, int colspan) { + GridData gd = (GridData) control.getLayoutData(); + if (gd == null) { + gd = new GridData(); + gd.horizontalSpan = colspan; + control.setLayoutData(gd); + } else { + gd.horizontalSpan = colspan; + } + } + + public void setWidth(Control control, int width) { + GridData gd = (GridData) control.getLayoutData(); + if (gd == null) { + gd = new GridData(); + gd.widthHint = width; + control.setLayoutData(gd); + } else { + gd.widthHint = width; + } + gd.widthHint = width; + } + + private Composite setLayout(Composite composite, int numColumns) { + GridLayout gl = new GridLayout(numColumns, false); + gl.marginWidth = 2; + gl.marginHeight = 2; + composite.setLayout(gl); + return composite; + } + + public Combo createCombo(Composite parent) { + Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY); + combo.addListener(SWT.MouseWheel, new Listener() { + @Override + public void handleEvent(Event event) { + event.doit = false; + } + }); + GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false); + combo.setLayoutData(gd); + return combo; + } + + public Combo createEditableCombo(Composite parent) { + Combo combo = new Combo(parent, SWT.DROP_DOWN); + combo.addListener(SWT.MouseWheel, new Listener() { + @Override + public void handleEvent(Event event) { + event.doit = false; + } + }); + GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false); + combo.setLayoutData(gd); + return combo; + } + + public Combo createCombo(Composite parent, int colspan) { + Combo combo = createCombo(parent); + setColspan(combo, colspan); + return combo; + } + + public Combo createEditableCombo(Composite parent, int colspan) { + Combo combo = createEditableCombo(parent); + setColspan(combo, colspan); + return combo; + } + + public Label createLabel(Composite parent, String title) { + Label label = toolkit.createLabel(parent, title, SWT.NONE); + return label; + } + + public Label createLabel(Composite parent, String title, int colspan) { + Label label = createLabel(parent, title); + setColspan(label, colspan); + return label; + } + + public Text createText(Composite parent, String title) { + Text text = toolkit.createText(parent, title, SWT.BORDER); + text.setTextLimit(TEXT_LIMIT); + GridData gd = new GridData(GridData.FILL, GridData.CENTER, true, false); + text.setLayoutData(gd); + return text; + } + + public Text createTextArea(Composite parent, String title) { + Text text = toolkit.createText(parent, title, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.Expand | SWT.SCROLL_LINE); + GridData gd = new GridData(GridData.FILL, GridData.FILL, true, true); + text.setLayoutData(gd); + return text; + } + + public Text createText(Composite parent, String title, int colspan) { + Text text = createText(parent, title); + setColspan(text, colspan); + return text; + } + + public Button createButton(Composite parent, String title, int style) { + return toolkit.createButton(parent, title, style); + } + + public Button createButton(Composite parent, String title, int style, + int colspan) { + Button button = toolkit.createButton(parent, title, style); + setColspan(button, colspan); + return button; + } + + public Composite createSection(Composite parent, String title) { + Section section = toolkit.createSection(parent, Section.TWISTIE + | Section.EXPANDED); + section.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); + section.setText(title); + section.addExpansionListener(new ExpansionAdapter() { + public void expansionStateChanged(ExpansionEvent e) { + form.reflow(false); + } + }); + toolkit.createCompositeSeparator(section); + + Composite client = toolkit.createComposite(section); + client.setLayout(new GridLayout()); + section.setClient(client); + return client; + } + + public Composite createComposite(Composite parent) { + Composite composite = toolkit.createComposite(parent); + composite.setLayout(new GridLayout()); + composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); + return composite; + } + + public Composite createComposite(Composite parent, int numColumns) { + return setLayout(createComposite(parent), numColumns); + } + + public Composite createCategory(String title) { + Section section = toolkit.createSection(form.getBody(), Section.TWISTIE + | Section.TITLE_BAR); + section.setText(title); + section.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); + section.addExpansionListener(new ExpansionAdapter() { + public void expansionStateChanged(ExpansionEvent e) { + form.reflow(false); + } + }); + + Composite client = toolkit.createComposite(section); + client.setLayout(new GridLayout()); + section.setClient(client); + return client; + } + + public Composite createExpandable(Composite parent, String title) { + ExpandableComposite expandable = toolkit.createExpandableComposite( + parent, ExpandableComposite.TREE_NODE + | ExpandableComposite.EXPANDED + | ExpandableComposite.CLIENT_INDENT); + expandable.setText(title); + expandable.addExpansionListener(new ExpansionAdapter() { + public void expansionStateChanged(ExpansionEvent e) { + form.reflow(true); + } + }); + Composite client = toolkit.createComposite(expandable); + client.setLayout(new GridLayout()); + + expandable.setClient(client); + return client; + } + + public Composite createExpandable(Composite parent, String title, + int numColumns) { + return setLayout(createExpandable(parent, title), numColumns); + } + + public void addComboItem(Combo combo, Object[] items) { + if (items == null || items.length == 0) + return; + + for (int i = 0; i < items.length; i++) + combo.add(items[i].toString()); + + combo.select(0); + } + + public void addComboItem(Combo combo, Object[] items, Object selection) { + if (items == null || items.length == 0) + return; + + int idx = 0; + for (int i = 0; i < items.length; i++) { + combo.add(items[i].toString()); + if (items[i].equals(selection)) + idx = i; + } + + combo.select(idx); + } + + public void selectCombo(Combo combo, String selectedItem) { + String[] itemNames = combo.getItems(); + for (int i = 0; i < itemNames.length; i++) { + if (itemNames[i].equals(selectedItem)) { + combo.select(i); + return; + } + } + } + + public void selectButton(Button[] buttons, String[] options) { + for (int i = 0; i < buttons.length; i++) { + boolean checked = false; + String text = buttons[i].getText(); + if (options != null) { + for (int j = 0; j < options.length; j++) { + if (text.equals(options[j])) + checked = true; + } + } + buttons[i].setSelection(checked); + } + } + + public void selectButton(Button[] buttons, String option, boolean isChecked) { + for (int i = 0; i < buttons.length; i++) { + if (buttons[i].getText().contains(option)) { + buttons[i].setSelection(isChecked); + break; + } + } + } + + public ScrolledForm getForm() { + return form; + } + + + public TableViewer createTableViewer(Composite parent, String[] columnNames) { + return createTableViewer(parent, columnNames, 1); + } + + public TableViewer createTableViewer(Composite parent, + String[] columnNames, int colspan) { + return createTableViewer(parent, columnNames, 1, SWT.BORDER | SWT.H_SCROLL + | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); + } + + public TableViewer createTableViewer(Composite parent, String[] columnNames, int colspan, int style) { + TableViewer viewer = new TableViewer(parent, style); + + Table table = viewer.getTable(); + table.setHeaderVisible(true); + table.setLinesVisible(true); + + GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false); + gd.heightHint = 120; + gd.horizontalSpan = colspan; + viewer.getTable().setLayoutData(gd); + + TableColumn column = null; + for (int i = 0; i < columnNames.length; i++) { + column = new TableColumn(table, SWT.NONE); + column.setText(columnNames[i]); + column.setWidth(100); + } + return viewer; + } + + public Browser createBrowser(Composite parent) { + return createBrowser(parent, 1); + } + + public Browser createBrowser(Composite parent, int colsapn) { + Browser browser = new Browser(parent, SWT.NONE); + + GridData gd = new GridData(GridData.FILL, GridData.FILL, true, true); + gd.minimumHeight = 200; + gd.minimumWidth = 250; + browser.setLayoutData(gd); + + return browser; + } + + public Slider createSlider(Composite parent) { + return createSlider(parent, SWT.HORIZONTAL); + } + + public Slider createSlider(Composite parent, int style) { + Slider slider = new Slider(parent, style); + + GridData gd; + if ((style & SWT.VERTICAL) == SWT.VERTICAL) { + gd = new GridData(GridData.CENTER, GridData.FILL, true, true); + } else { + gd = new GridData(GridData.FILL, GridData.CENTER, true, true); + } + slider.setLayoutData(gd); + + return slider; + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/util/StringUtil.java b/org.tizen.injector/src/org/tizen/injector/util/StringUtil.java new file mode 100644 index 0000000..e84eaf3 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/util/StringUtil.java @@ -0,0 +1,58 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.util; + +public class StringUtil { + public static String lpad(String strSource, int totalLength, String pad) { + if(totalLength <= strSource.length()) + return strSource; + + StringBuilder sb = new StringBuilder(strSource); + for (int i = 0; i < totalLength-sb.length(); i++) { + sb.insert(0, pad); + } + + return sb.toString(); + } + + public static String rpad(String strSource, int totalLength, String pad) { + if(totalLength <= strSource.length()) + return strSource; + + StringBuilder sb = new StringBuilder(strSource); + for (int i = 0; i < totalLength-sb.length(); i++) { + sb.append(pad); + } + + return sb.toString(); + } + + public static String makeKey(int groupId, int actionId) { + return groupId + ":" + actionId; //$NON-NLS-1$ + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/view/InjectorView.java b/org.tizen.injector/src/org/tizen/injector/view/InjectorView.java new file mode 100644 index 0000000..5e3dd17 --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/view/InjectorView.java @@ -0,0 +1,390 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.view; + +import java.util.ArrayList; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtension; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.TabFolder; +import org.eclipse.swt.widgets.TabItem; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.forms.widgets.Section; +import org.eclipse.ui.part.ViewPart; +import org.eclipse.ui.progress.UIJob; + +import org.tizen.injector.Injector; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.socket.LocationSocket; +import org.tizen.injector.socket.SensorUDPSocket; +import org.tizen.injector.socket.TelephonySocket; +import org.tizen.injector.sourceProvider.InjectorStateProvider; +import org.tizen.injector.util.FormPageUtil; +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.common.util.DialogUtil; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; + +public class InjectorView extends ViewPart implements +ISelectionListener { + + private final static String EXTENSION_POINT_INJECTOR_ITEM_PROVIDER = "injectorItemProvider"; + private final static String TAG_ITEM_TYPE = "itemType"; + private final static String ATTR_ID = "name"; + private final static String ATTR_CATEGORY = "category"; + private final static String ATTR_CLASS = "class"; + private IDevice currentDevice = null; + static public boolean desposing = false; + static public boolean activated = false; + static public boolean disconnect_finished = true; + + public final static String VIEW_ID = "org.tizen.injector.view.InjectorView"; + + private String errorMessage = Messages.InjectorView_6 + + System.getProperty("line.separator") //$NON-NLS-1$ + + Messages.InjectorView_8; + + private ArrayList categoryList = new ArrayList(); + private ArrayList formUtilList = new ArrayList(); + private ArrayList> compositeArrayList = new ArrayList>(); + + @Override + public void createPartControl(Composite parent) { + getCategories(); + + TabFolder tabFolder = createTabFolder(parent); + + for (int i = 0; i < categoryList.size(); i++) { + compositeArrayList.add(new ArrayList()); + TabItem tabItem = createTabItem(tabFolder, categoryList.get(i)); + formUtilList + .add(new FormPageUtil((Composite) tabItem.getControl())); + getItems(i); + } + + initialize(); + } + + private TabFolder createTabFolder(Composite parent) { + TabFolder tabFolder = new TabFolder(parent, SWT.NONE); + tabFolder.setLayout(new FillLayout()); + + return tabFolder; + } + + private TabItem createTabItem(TabFolder parent, String text) { + TabItem tabItem = new TabItem(parent, SWT.NONE); + tabItem.setText(text); + tabItem.setControl(createTabItemComposite(parent)); + + return tabItem; + } + + private Composite createTabItemComposite(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + composite.setLayout(new FillLayout()); + + return composite; + } + + private void initialize() { + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + ConnectionPlugin.getDefault().addSelectionListener(this); + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } +// TargetConnectionControl.addTargetConnectionListener(this); +// TargetConnectionControl.addSimulatorStatusListener(this); +// connect(); + } + + private boolean checkDeviceConnectedAlready() { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + public void dispose() { + desposing = true; + disconnect(); + + ConnectionPlugin.getDefault().removeSelectionListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); +// TargetConnectionControl.removeSimulatorStatusListener(this); + super.dispose(); + } + + private void getCategories() { + IExtensionPoint extensionPoint = Platform.getExtensionRegistry() + .getExtensionPoint(Injector.PLUGIN_ID, + EXTENSION_POINT_INJECTOR_ITEM_PROVIDER); + + if (extensionPoint != null) { + IExtension[] extensions = extensionPoint.getExtensions(); + for (IExtension ex : extensions) { + IConfigurationElement[] configElements = ex + .getConfigurationElements(); + for (int i = 0; i < configElements.length; i++) { + if (configElements[i].getName().equals(TAG_ITEM_TYPE)) { + String category = configElements[i].getAttribute(ATTR_CATEGORY); + if (!categoryList.contains(category)) { + categoryList.add(category); + } + } + } + } + } + } + + private void getItems(int index) { + IExtensionPoint extensionPoint = Platform.getExtensionRegistry() + .getExtensionPoint(Injector.PLUGIN_ID, + EXTENSION_POINT_INJECTOR_ITEM_PROVIDER); + + String name = null; + AbstractInjectorItem executor = null; + if (extensionPoint != null) { + IExtension[] extensions = extensionPoint.getExtensions(); + for (IExtension ex : extensions) { + IConfigurationElement[] configElements = ex + .getConfigurationElements(); + for (int i = 0; i < configElements.length; i++) { + if (configElements[i].getName().equals(TAG_ITEM_TYPE)) { + if (configElements[i].getAttribute(ATTR_CATEGORY) + .equals(categoryList.get(index))) { + + name = configElements[i].getAttribute(ATTR_ID); + Composite client = formUtilList.get(index) + .createCategory(name); + client.getParent().setEnabled(false); + compositeArrayList.get(index).add(client); + try { + executor = (AbstractInjectorItem) (configElements[i] + .createExecutableExtension(ATTR_CLASS)); + executor.createContents(client, formUtilList + .get(index)); + executor.setView(this); + } catch (CoreException e) { + e.printStackTrace(); + } + } + } + } + } + } + } + + public void activate() { + for (int i = 0; i < compositeArrayList.size(); i++) { + for (int j = 0; j < compositeArrayList.get(i).size(); j++) { + Composite client = compositeArrayList.get(i).get(j); + client.getParent().setEnabled(true); + } + } + activated = true; + } + + public void inactivateUI() { + for (int i = 0; i < compositeArrayList.size(); i++) { + for (int j = 0; j < compositeArrayList.get(i).size(); j++) { + Composite client = compositeArrayList.get(i).get(j); + Section section = (Section) client.getParent(); + section.setExpanded(false); + section.setEnabled(false); + } + } + activated = false; + } + + @Override + public void setFocus() { + } + + private void initSocket() { + UIJob job = new UIJob("Connect Vmodem") { + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + try { + TelephonySocket.getInstance().connect(); + TelephonySocket.getInstance().sendAskData(); + +// SensorTCPSocket.getInstance().connect(); +// SensorUDPSocket.getInstance().connect(); +// LocationSocket.getInstance().connect(); + + InjectorStateProvider + .changeSyslogState(InjectorStateProvider.STATE_ON); + + InjectorView view = (InjectorView) PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage().findView( + InjectorView.VIEW_ID); + if (view != null && currentDevice != null) + view.activate(); + } catch (Exception e) { + //initSocket(); + //DialogUtil.openErrorDialog(errorMessage); + e.printStackTrace(); + } + return Status.OK_STATUS; + } + }; + job.schedule(); + } + +// @Override + public void connect() { + /* createForward is executed by emulator */ +/* String EMdPort = "3577"; + try { + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + String str_localport = currentDevice.getSerialNumber(); + int localport = Integer.parseInt(str_localport.substring(9, str_localport.length())) + 3; + TelephonySocket.port = localport; + currentDevice.createForward(TelephonySocket.port, Integer.parseInt(EMdPort)); + } catch (Exception e) { + e.printStackTrace(); + } +*/ + initSocket(); + } + +// @Override + public void disconnect() { + try { + TelephonySocket.getInstance().disconnect(); +// SensorUDPSocket.getInstance().disconnect(); +// SensorTCPSocket.getInstance().disconnect(); +// LocationSocket.getInstance().disconnect(); + } catch (Exception e) { + e.printStackTrace(); + } + + InjectorStateProvider.changeSyslogState(InjectorStateProvider.STATE_OFF); + if(PlatformUI.getWorkbench() == null || PlatformUI.getWorkbench() + .getActiveWorkbenchWindow() == null || PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage() == null) + return; + + InjectorView view = (InjectorView) PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage().findView( + InjectorView.VIEW_ID); + if (view != null) + view.inactivateUI(); +/* + UIJob job = new UIJob("Connect Vmodem") { + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + InjectorStateProvider + .changeSyslogState(InjectorStateProvider.STATE_OFF); + InjectorView view = (InjectorView) PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getActivePage().findView( + InjectorView.VIEW_ID); + if (view != null) + view.inactivateUI(); + + return Status.OK_STATUS; + } + }; + if (desposing != true) { + job.schedule(); + } + */ + } + + public ArrayList getCategoryList() { + return this.categoryList; + } + + public ArrayList getCategoryCompositeList(String category) { + int i = categoryList.indexOf(category); + + if(i > -1) { + return compositeArrayList.get(i); + } + + return null; + } + + // 1000 -> 1초 + public void MatrixTime(int delayTime) + { + long saveTime = System.currentTimeMillis(); + long currTime = 0; + + while( currTime - saveTime < delayTime) + { + currTime = System.currentTimeMillis(); + } + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + if( selectedEntry == null) + { + currentDevice = null; + disconnect(); + return; + } + else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) + return; + + if(currentDevice == null && selectedEntry.getName() != null) + { + connect(); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + return; + } + + if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect_finished = false; + disconnect(); + connect(); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + return; + } + else if(activated == false) + { + connect(); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + return; + } + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/view/Messages.java b/org.tizen.injector/src/org/tizen/injector/view/Messages.java new file mode 100644 index 0000000..2a276ce --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/view/Messages.java @@ -0,0 +1,43 @@ +/* + * org.tizen.injector + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.injector.view; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.injector.view.messages"; //$NON-NLS-1$ + public static String InjectorView_6; + public static String InjectorView_8; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.injector/src/org/tizen/injector/view/messages.properties b/org.tizen.injector/src/org/tizen/injector/view/messages.properties new file mode 100644 index 0000000..69b248e --- /dev/null +++ b/org.tizen.injector/src/org/tizen/injector/view/messages.properties @@ -0,0 +1,2 @@ +InjectorView_6=To connect vmodem for emulator to interact it is failed. +InjectorView_8=please retry after checking the status of simulator diff --git a/org.tizen.location.core/.classpath b/org.tizen.location.core/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.location.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.location.core/.project b/org.tizen.location.core/.project new file mode 100644 index 0000000..dc06ccd --- /dev/null +++ b/org.tizen.location.core/.project @@ -0,0 +1,28 @@ + + + org.tizen.location.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.location.core/.settings/org.eclipse.core.resources.prefs b/org.tizen.location.core/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..4ba9b9e --- /dev/null +++ b/org.tizen.location.core/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Dec 01 09:07:15 CET 2010 +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.tizen.location.core/.settings/org.eclipse.core.runtime.prefs b/org.tizen.location.core/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000..cef9197 --- /dev/null +++ b/org.tizen.location.core/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Tue Dec 14 16:29:26 CET 2010 +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.tizen.location.core/.settings/org.eclipse.jdt.core.prefs b/org.tizen.location.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..556f96e --- /dev/null +++ b/org.tizen.location.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Oct 27 11:19:26 KST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.location.core/META-INF/MANIFEST.MF b/org.tizen.location.core/META-INF/MANIFEST.MF new file mode 100644 index 0000000..7d977c9 --- /dev/null +++ b/org.tizen.location.core/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Location Core +Bundle-SymbolicName: org.tizen.location.core;singleton:=true +Bundle-Version: 1.3.20.qualifier +Bundle-Vendor: Tizen +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Export-Package: org.tizen.location.core.injector, + org.tizen.location.core.model, + org.tizen.location.core.protocol +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.tizen.common, + org.tizen.injector, + org.tizen.common.connection +Import-Package: org.tizen.common.model diff --git a/org.tizen.location.core/OSGI-INF/l10n/bundle.properties b/org.tizen.location.core/OSGI-INF/l10n/bundle.properties new file mode 100644 index 0000000..73c8421 --- /dev/null +++ b/org.tizen.location.core/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,4 @@ +#Properties file for org.tizen.location.core +extension-point.name = Location Injector +Bundle-Vendor = Tizen +Bundle-Name = Tizen SDK Location Core diff --git a/org.tizen.location.core/build.properties b/org.tizen.location.core/build.properties new file mode 100644 index 0000000..b40fadf --- /dev/null +++ b/org.tizen.location.core/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/l10n/bundle.properties +javacSource = 1.6 +javacTarget = 1.6 diff --git a/org.tizen.location.core/src/org/tizen/location/core/injector/DebugLog.java b/org.tizen.location.core/src/org/tizen/location/core/injector/DebugLog.java new file mode 100644 index 0000000..de076b8 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/injector/DebugLog.java @@ -0,0 +1,34 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.injector; + +public class DebugLog { + public static void log(Object msg) { + System.out.println(msg); + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java b/org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java new file mode 100644 index 0000000..189b35b --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java @@ -0,0 +1,222 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.injector; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.common.model.ITableVO; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.sdblib.SyncService; +import org.tizen.sdblib.SyncService.SyncResult; +//import org.tizen.location.core.injector.DebugLog; +import org.tizen.location.core.model.GeoLocationVO; +import org.tizen.location.core.protocol.GeoLocation; + +public class LocationInjector implements ISelectionListener { + private IProgressMonitor monitor; + + private final String remoteFilePath = "/opt/data/gps-manager/replay/nmea_replay.log"; + private final String setStopMode = "vconftool set -t int db/location/replay/ReplayMode 0"; // STOP MODE + private final String setLogMode = "vconftool set -t int db/location/replay/ReplayMode 1"; // NMEA MODE(LOG MODE) + private final String setManualMode = "vconftool set -t int db/location/replay/ReplayMode 2"; // MANUAL MODE + + public LocationInjector() { + ConnectionPlugin.getDefault().addSelectionListener(this); +// TargetConnectionControl.addTargetConnectionListener(this); + } + + private void setStopMode() throws IOException { + IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + currentDevice.executeShellCommand(setStopMode); + } + + private void setLogMode() throws IOException { + IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + currentDevice.executeShellCommand(setLogMode); + } + + private void setManualMode() throws IOException { + IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + currentDevice.executeShellCommand(setManualMode); + } + + private boolean injectLocation(double latitude, double longitude) throws IOException { + IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + String latitudeCmd = String.format("vconftool set -t double db/location/replay/ManualLatitude %f", latitude); + String longitudeCmd = String.format("vconftool set -t double db/location/replay/ManualLongitude %f", longitude); + + currentDevice.executeShellCommand(latitudeCmd); + currentDevice.executeShellCommand(longitudeCmd); + + return true; + } + + public boolean inject(final File filename, IProgressMonitor monitor) throws IOException { + if (monitor == null) { + monitor = new NullProgressMonitor(); + } + + setMonitor(monitor); + + // PUSH FILE TO EMULATOR + SyncService sync = ConnectionPlugin.getDefault().getCurrentDevice().getSyncService(); + if (sync != null) { + SyncResult result = sync.pushFile(filename.getPath(), remoteFilePath, SyncService.getNullProgressMonitor()); + if (result.getCode() != SyncService.RESULT_OK) { + // TODO + return false; + } + } + + // SET LOG MODE + setLogMode(); + + while(true) { + synchronized (monitor) { + try { + monitor.wait(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + if (monitor.isCanceled()) { +// DebugLog.log("[Injector] Canceled"); + // SET STOP MODE + setStopMode(); + return true; + } + } + } + + public void inject(GeoLocation location, IProgressMonitor monitor) throws IOException { + if (monitor == null) { + monitor = new NullProgressMonitor(); + } + + setMonitor(monitor); + + // SET MANUAL MODE + setManualMode(); + + if (!injectLocation(location.getLatitude(), location.getLongitude())) { + monitor.setCanceled(true); + return ; + } + + while(true) { + synchronized (monitor) { + try { + monitor.wait(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + if (monitor.isCanceled()) { +// DebugLog.log("[Injector] Canceled"); + // SET STOP MODE + setStopMode(); + return; + } + } + } + + public boolean inject(ITableVO[] locations, IProgressMonitor monitor) throws IOException { + if (monitor == null) { + monitor = new NullProgressMonitor(); + } + + setMonitor(monitor); + + // SET MANUAL MODE + setManualMode(); + + while(true) { + for (int i = 0; i < locations.length; i++) { + GeoLocationVO location = (GeoLocationVO) locations[i]; + if (!injectLocation(location.getLocation().getLatitude(), location.getLocation().getLongitude())) { + monitor.setCanceled(true); + return false; + } + + synchronized (monitor) { + try { + monitor.wait(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + if (monitor.isCanceled()) { +// DebugLog.log("[Injector] Canceled"); + // SET STOP MODE + setStopMode(); + return true; + } + } + } + } + + public void setCancel(boolean canceled) { + this.monitor.setCanceled(canceled); + } + + public void setMonitor(IProgressMonitor monitor) { + this.monitor = monitor; + } + + //@Override + public void connect() { + } + +// @Override + public void disconnect() { + setCancel(true); + } + + @Override + protected void finalize() throws Throwable { + ConnectionPlugin.getDefault().removeSelectionListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + // TODO Auto-generated method stub + + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java b/org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java new file mode 100644 index 0000000..713c0bf --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java @@ -0,0 +1,89 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.model; + +import org.tizen.common.model.AbstractTableVO; +import org.tizen.location.core.protocol.GeoLocation; + +public class GeoLocationVO extends AbstractTableVO { + private int seq; + private GeoLocation location; + + public int getSeq() { + return this.seq; + } + + public void setSeq(int seq) { + this.seq = seq; + } + + public GeoLocation getLocation() { + return this.location; + } + + public void setLocation(GeoLocation location) { + this.location = location; + } + + private String getLatitudeString() { + return getLocation().getNorthSouth() + "," + Double.toString(Math.abs(getLocation().getLatitude())); //$NON-NLS-1$ + } + + private String getLongitudeString() { + return getLocation().getEastWest() + "," + Double.toString(Math.abs(getLocation().getLongitude())); //$NON-NLS-1$ + } + + @Override + public String[] getColumnNames() { + return null; + } + + @Override + public Object getColumnValue(int index) { + Object obj = null; + switch(index) { + case 0: + obj = getSeq(); + break; + case 1: + obj = getLatitudeString(); + break; + case 2: + obj = getLongitudeString(); + break; + default: + break; + } + + return obj; + } + + @Override + public void setColumnValue(int index, Object value) { + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/AbstractNMEA0183.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/AbstractNMEA0183.java new file mode 100644 index 0000000..7cc9b57 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/AbstractNMEA0183.java @@ -0,0 +1,96 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +import java.util.ArrayList; +import java.util.Formatter; +import java.util.List; +import java.util.Locale; + +public abstract class AbstractNMEA0183 { + private static String PREFIX = "$"; //$NON-NLS-1$ + private static String DELIMITER = ","; //$NON-NLS-1$ + private static String CHECKSUM_PREFIX = "*"; //$NON-NLS-1$ + + private String sentenceID; + private List body; + private String fullSentence; + private int checksum = 0; + + protected static String NULL = ""; //$NON-NLS-1$ + + public AbstractNMEA0183(String sentenceID) { + this.sentenceID = sentenceID; + } + + public String getSentence() { + StringBuilder sb = new StringBuilder(); + Formatter hexFormatter = new Formatter(sb, Locale.US); + hexFormatter.format("%02x", checksum); //$NON-NLS-1$ + + String sentence = PREFIX.concat(fullSentence); + + sentence += CHECKSUM_PREFIX; + sentence += sb.toString().toUpperCase(); + + return sentence; + } + + protected List getBody() { + return body; + } + + + protected void createSentence() { + body = new ArrayList(); + createBody(); + createChecksum(); + } + + private void createChecksum() { + fullSentence = sentenceID; + + for (int i = 0; i < body.size(); i++) { + fullSentence += DELIMITER; + fullSentence += body.get(i); + } + + for (int i = 0; i < fullSentence.length(); i++) { + checksum = checksum ^ fullSentence.charAt(i); + } + } + + abstract protected void createBody(); + abstract protected boolean validate(); + +// public enum Directions { +// NORTH, SOUTH, EAST, WEST +// } +} + + diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/GeoLocation.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/GeoLocation.java new file mode 100644 index 0000000..0daab6b --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/GeoLocation.java @@ -0,0 +1,115 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +public class GeoLocation { + + public enum Directions { + NORTH, SOUTH, EAST, WEST + } + + private double latitude; + private double NMEAlatitude; + private Directions northSouth; + private double longitude; + private double NMEAlongitude; + private Directions eastWest; + + public GeoLocation(double latitude, double longitude) { + setLatitude(latitude); + setLongitude(longitude); + } + + public double getLatitude() { + return this.latitude; + } + + public double getLongitude() { + return this.longitude; + } + + public String getNorthSouth() { + return northSouth == Directions.NORTH ? "N" : "S"; //$NON-NLS-1$ //$NON-NLS-2$ + } + + public String getEastWest() { + return eastWest == Directions.EAST ? "E" : "W"; //$NON-NLS-1$ //$NON-NLS-2$ + } + + public double getNMEAlatitude() { + return NMEAlatitude; + } + + public double getNMEAlongitude() { + return NMEAlongitude; + } + + public void setLatitude(double latitude) { + this.latitude = latitude; + + if (latitude < 0) { + setNorthSouth(Directions.SOUTH); + } else { + setNorthSouth(Directions.NORTH); + } + setNMEAlatitude(Math.abs(latitude)); + } + + public void setLongitude(double longitude) { + this.longitude = longitude; + + if (longitude < 0) { + setEastWest(Directions.WEST); + } else { + setEastWest(Directions.EAST); + } + setNMEAlongitude(Math.abs(longitude)); + } + + private void setNorthSouth(Directions northSouth) { + this.northSouth = northSouth; + } + + private void setEastWest(Directions eastWest) { + this.eastWest = eastWest; + } + + private void setNMEAlatitude(double latitude) { + int degree = (int) latitude; + double minutes = (double) ((latitude - degree) * 60); + + this.NMEAlatitude = (double) ((degree * 100) + minutes); + } + + private void setNMEAlongitude(double longitude) { + int degree = (int) longitude; + double minutes = (double) ((longitude - degree) * 60); + + this.NMEAlongitude = (double) ((degree * 100) + minutes); + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/IdentifiersConstants.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/IdentifiersConstants.java new file mode 100644 index 0000000..c2f99f2 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/IdentifiersConstants.java @@ -0,0 +1,121 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +public class IdentifiersConstants { + + // 1 2 3 4 5 6 7 cn + // | | | | | | | | + // $--GSV,x,x,x,x,x,x,x,...*hh + // 1) total number of messages + // 2) message number + // 3) satellites in view + // 4) satellite number + // 5) elevation in degrees + // 6) azimuth in degrees to true + // 7) SNR in dB + // more satellite infos like 4)-7) + // n) Checksum + public static String SATELITES_IN_VIEW = "GPGSV"; //$NON-NLS-1$ + + // 11 + // 1 2 3 4 5 6 7 8 9 10 | 12 13 14 15 + // | | | | | | | | | | | | | | | + // $--GGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh + // 1) Time (UTC) + // 2) Latitude + // 3) N or S (North or South) + // 4) Longitude + // 5) E or W (East or West) + // 6) GPS Quality Indicator, + // 0 - fix not available, + // 1 - GPS fix, + // 2 - Differential GPS fix + // 7) Number of satellites in view, 00 - 12 + // 8) Horizontal Dilution of precision + // 9) Antenna Altitude above/below mean-sea-level (geoid) + // 10) Units of antenna altitude, meters + // 11) Geoidal separation, the difference between the WGS-84 earth + // ellipsoid and mean-sea-level (geoid), "-" means mean-sea-level below ellipsoid + // 12) Units of geoidal separation, meters + // 13) Age of differential GPS data, time in seconds since last SC104 + // type 1 or 9 update, null field when DGPS is not used + // 14) Differential reference station ID, 0000-1023 + // 15) Checksum + public static String GPS_FIX_DATA_TIME_POSITION_AND_FIX_RELATED_DATA = "GPGGA"; //$NON-NLS-1$ + + // 14 + // 1 2 3 4 5 6 7 8 9 10 11 12 13| + // | | | | | | | | | | | | | | + // $--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A*hh + // 1) Status, V = Navigation receiver warning + // 2) Cross Track error - nautical miles + // 3) Direction to Steer, Left or Right + // 4) TO Waypoint ID + // 5) FROM Waypoint ID + // 6) Destination Waypoint Latitude + // 7) N or S + // 8) Destination Waypoint Longitude + // 9) E or W + // 10) Range to destination in nautical miles + // 11) Bearing to destination in degrees True + // 12) Destination closing velocity in knots + // 13) Arrival Status, A = Arrival Circle Entered + // 14) Checksum + public static String RECOMMENDED_MINIMUM_NAVIGATION_INFORMATION = "GPRMC"; //$NON-NLS-1$ + + // 1 2 3 14 15 16 17 18 + // | | | | | | | | + // $--GSA,a,a,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x.x,x.x,x.x*hh + // 1) Selection mode + // 2) Mode + // 3) ID of 1st satellite used for fix + // 4) ID of 2nd satellite used for fix + // ... + // 14) ID of 12th satellite used for fix + // 15) PDOP in meters + // 16) HDOP in meters + // 17) VDOP in meters + // 18) Checksum + public static String GPS_DOP_AND_ACTIVE_SATELITES = "GPGSA"; //$NON-NLS-1$ + + + // 1 2 3 4 5 6 7 8 9 + // | | | | | | | | | + // $--VTG,x.x,T,x.x,M,x.x,N,x.x,K*hh + // 1) Track Degrees + // 2) T = True + // 3) Track Degrees + // 4) M = Magnetic + // 5) Speed Knots + // 6) N = Knots + // 7) Speed Kilometers Per Hour + // 8) K = Kilometres Per Hour + // 9) Checksum + public static String TRACK_MODE_GOOD_AND_GROUND_SPEED = "GPVGT"; //$NON-NLS-1$ +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/Messages.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/Messages.java new file mode 100644 index 0000000..fad01d8 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/Messages.java @@ -0,0 +1,42 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.location.core.protocol.messages"; //$NON-NLS-1$ + public static String SatelliteInfo_0; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGGA.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGGA.java new file mode 100644 index 0000000..707cf70 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGGA.java @@ -0,0 +1,114 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class NMEA0183_GPGGA extends AbstractNMEA0183 { + + // 11 + // 1 2 3 4 5 6 7 8 9 10 | 12 13 14 15 + // | | | | | | | | | | | | | | | + // $--GGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh + // 1) Time (UTC) + // 2) Latitude + // 3) N or S (North or South) + // 4) Longitude + // 5) E or W (East or West) + // 6) GPS Quality Indicator, + // 0 - fix not available, + // 1 - GPS fix, + // 2 - Differential GPS fix + // 7) Number of satellites in view, 00 - 12 + // 8) Horizontal Dilution of precision + // 9) Antenna Altitude above/below mean-sea-level (geoid) + // 10) Units of antenna altitude, meters + // 11) Geoidal separation, the difference between the WGS-84 earth + // ellipsoid and mean-sea-level (geoid), "-" means mean-sea-level below ellipsoid + // 12) Units of geoidal separation, meters + // 13) Age of differential GPS data, time in seconds since last SC104 + // type 1 or 9 update, null field when DGPS is not used + // 14) Differential reference station ID, 0000-1023 + // 15) Checksum + private Date currentDate; + + private String date; + private GeoLocation location; + private String qualityIndicator = "1"; //$NON-NLS-1$ + private int numOfSatellites = 5; + private double hdop = 0.0; + private double altitude = 0.0; + private String altitudeUnit = "M"; //$NON-NLS-1$ + + public NMEA0183_GPGGA() { + this(0.0, 0.0); + } + + public NMEA0183_GPGGA(double latitude, double longitude) { + super("GPGGA"); //$NON-NLS-1$ + + currentDate = new Date(); + SimpleDateFormat format = new SimpleDateFormat("HHmmss.0"); //$NON-NLS-1$ + date = format.format(currentDate); + + location = new GeoLocation(latitude, longitude); + + createSentence(); + } + + @Override + protected void createBody() { + DecimalFormat latitudeFormat = new DecimalFormat("0000.000000"); //$NON-NLS-1$ + DecimalFormat longitudeFormat = new DecimalFormat("00000.000000"); //$NON-NLS-1$ + DecimalFormat numOfSatellitesFormat = new DecimalFormat("00"); //$NON-NLS-1$ + DecimalFormat hdopFormat = new DecimalFormat("0.0"); //$NON-NLS-1$ + DecimalFormat altitudeFormat = new DecimalFormat("###0.0"); //$NON-NLS-1$ + + getBody().add(date); + getBody().add(latitudeFormat.format(location.getNMEAlatitude())); + getBody().add(location.getNorthSouth()); + getBody().add(longitudeFormat.format(location.getNMEAlongitude())); + getBody().add(location.getEastWest()); + getBody().add(qualityIndicator); + getBody().add(numOfSatellitesFormat.format(numOfSatellites)); + getBody().add(hdopFormat.format(hdop)); + getBody().add(altitudeFormat.format(altitude)); + getBody().add(altitudeUnit); + getBody().add(NULL); + getBody().add(NULL); + getBody().add(NULL); + getBody().add(NULL); + } + + @Override + protected boolean validate() { + return true; + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSA.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSA.java new file mode 100644 index 0000000..8e49930 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSA.java @@ -0,0 +1,83 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +import java.text.DecimalFormat; + +public class NMEA0183_GPGSA extends AbstractNMEA0183 { + + // 1 2 3 14 15 16 17 18 + // | | | | | | | | + // $--GSA,a,a,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x.x,x.x,x.x*hh + // 1) Selection mode + // 2) Mode + // 3) ID of 1st satellite used for fix + // 4) ID of 2nd satellite used for fix + // ... + // 14) ID of 12th satellite used for fix + // 15) PDOP in meters + // 16) HDOP in meters + // 17) VDOP in meters + // 18) Checksum + private static String selectionMode = "A"; //$NON-NLS-1$ + private static String mode = "3"; //$NON-NLS-1$ + private int[] satellteIDs = { 1, 2, 3, 4, 5 }; + private double pdop = 0.0; + private double hdop = 0.0; + private double vdop = 0.0; + + public NMEA0183_GPGSA() { + super("GPGSA"); //$NON-NLS-1$ + + createSentence(); + } + + @Override + protected void createBody() { + DecimalFormat setelliteIDFormat = new DecimalFormat("00"); //$NON-NLS-1$ + DecimalFormat dopFormat = new DecimalFormat("0.0"); //$NON-NLS-1$ + + getBody().add(selectionMode); + getBody().add(mode); + for(int i = 0; i < 12; i++) { + if (i >= satellteIDs.length) { + getBody().add(NULL); + } else { + getBody().add(setelliteIDFormat.format(satellteIDs[i])); + } + } + getBody().add(dopFormat.format(pdop)); + getBody().add(dopFormat.format(hdop)); + getBody().add(dopFormat.format(vdop)); + } + + @Override + protected boolean validate() { + return true; + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSV.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSV.java new file mode 100644 index 0000000..d3a8896 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSV.java @@ -0,0 +1,107 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.List; + +public class NMEA0183_GPGSV extends AbstractNMEA0183 { + + // 1 2 3 4 5 6 7 cn + // | | | | | | | | + // $--GSV,x,x,x,x,x,x,x,...*hh + // 1) total number of messages + // 2) message number + // 3) satellites in view + // 4) satellite number + // 5) elevation in degrees + // 6) azimuth in degrees to true + // 7) SNR in dB + // more satellite infos like 4)-7) + // n) Checksum + private int numTotalMessage = 3; + private int seq; + private int satellitesInView = 10; + private SatelliteInfo[] satellites; + + public NMEA0183_GPGSV(int seq) { + this(seq, createDefaultSatellites(seq)); + } + + public NMEA0183_GPGSV(int seq, SatelliteInfo[] satellites) { + super("GPGSV"); //$NON-NLS-1$ + + this.seq = seq; + this.satellites = satellites; + + createSentence(); + } + + @Override + protected void createBody() { + DecimalFormat numberFormat = new DecimalFormat("##0"); //$NON-NLS-1$ + DecimalFormat satellitesIDFormat = new DecimalFormat("00"); //$NON-NLS-1$ + + getBody().add(numberFormat.format(numTotalMessage)); + getBody().add(numberFormat.format(seq)); + getBody().add(numberFormat.format(satellitesInView)); + + // TODO: limitation "number of satellites" + for (int i = 0; i < satellites.length; i++) { + getBody().add(satellitesIDFormat.format(satellites[i].getId())); + getBody().add(numberFormat.format(satellites[i].getElevation())); + getBody().add(numberFormat.format(satellites[i].getAzimuth())); + if (satellites[i].getSnr() == 0) { + getBody().add(NULL); + } else { + getBody().add(numberFormat.format(satellites[i].getSnr())); + } + } + } + + @Override + protected boolean validate() { + return true; + } + + private static SatelliteInfo[] createDefaultSatellites(int seq) { + List satellites = new ArrayList(); + int numOfSatellites = 4; + + if (seq == 3) { + numOfSatellites = 2; + } + + for (int i = 1; i <= numOfSatellites; i++) { + satellites.add(new SatelliteInfo(((4 * (seq - 1)) + i), 45, 300, 0)); + } + + return satellites.toArray(new SatelliteInfo[satellites.size()]); + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPRMC.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPRMC.java new file mode 100644 index 0000000..14fd88c --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPRMC.java @@ -0,0 +1,106 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class NMEA0183_GPRMC extends AbstractNMEA0183 { + + // 12 + // 1 2 3 4 5 6 7 8 9 10 11| + // | | | | | | | | | | | | + // $--RMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,xxxx,x.x,a*hh + // 1) Time (UTC) + // 2) Status, V = Navigation receiver warning + // 3) Latitude + // 4) N or S + // 5) Longitude + // 6) E or W + // 7) Speed over ground, knots + // 8) Track made good, degrees true + // 9) Date, ddmmyy + // 10) Magnetic Variation, degrees + // 11) E or W + // 12) Checksum + private Date currentDate; + + private String time; + private String status = "A"; //$NON-NLS-1$ + private GeoLocation location; + private double speed = 0.0; + private double track = 0.0; + private String date; +// private double magneticVariation = 0.0; + private String magenticDirection = "A"; //$NON-NLS-1$ + + public NMEA0183_GPRMC() { + this(0.0, 0.0); + } + + public NMEA0183_GPRMC(double latitude, double longitude) { + super("GPRMC"); //$NON-NLS-1$ + + currentDate = new Date(); + + SimpleDateFormat timeFormat = new SimpleDateFormat("HHmmss.0"); //$NON-NLS-1$ + time = timeFormat.format(currentDate); + location = new GeoLocation(latitude, longitude); + SimpleDateFormat dateFormat = new SimpleDateFormat("ddMMyy"); //$NON-NLS-1$ + date = dateFormat.format(currentDate); + + createSentence(); + } + + @Override + protected void createBody() { + DecimalFormat latitudeFormat = new DecimalFormat("0000.000000"); //$NON-NLS-1$ + DecimalFormat longitudeFormat = new DecimalFormat("00000.000000"); //$NON-NLS-1$ + DecimalFormat doubleFormat = new DecimalFormat("000.0"); //$NON-NLS-1$ + + getBody().add(time); + getBody().add(status); + getBody().add(latitudeFormat.format(location.getNMEAlatitude())); + getBody().add(location.getNorthSouth()); + getBody().add(longitudeFormat.format(location.getNMEAlongitude())); + getBody().add(location.getEastWest()); + getBody().add(doubleFormat.format(speed)); + getBody().add(doubleFormat.format(track)); + getBody().add(date); +// getBody().add(doubleFormat.format(magneticVariation)); + getBody().add(NULL); + getBody().add(NULL); + getBody().add(magenticDirection); + } + + @Override + protected boolean validate() { + return true; + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/SatelliteInfo.java b/org.tizen.location.core/src/org/tizen/location/core/protocol/SatelliteInfo.java new file mode 100644 index 0000000..61d0bb2 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/SatelliteInfo.java @@ -0,0 +1,100 @@ +/* + * org.tizen.location.core + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.core.protocol; + +import javax.management.RuntimeErrorException; + +public class SatelliteInfo { + private int id; + private int elevation; + private int azimuth; + private int snr; + + public SatelliteInfo(int id, int elevation, int azimuth, int snr) { + this.setId(id); + this.setElevation(elevation); + this.setAzimuth(azimuth); + this.setSnr(snr); + + if (!validate()) { + throw new RuntimeErrorException(null, Messages.SatelliteInfo_0); + } + } + + private boolean validate() { + if (id < 1 || id > 32) { + return false; + } + + if (elevation < 0 || elevation > 90) { + return false; + } + + if (azimuth < 0 || id > 359) { + return false; + } + + if (snr < 0 || id > 99) { + return false; + } + + return true; + } + + public void setId(int id) { + this.id = id; + } + + public int getId() { + return id; + } + + public void setElevation(int elevation) { + this.elevation = elevation; + } + + public int getElevation() { + return elevation; + } + + public void setAzimuth(int azimuth) { + this.azimuth = azimuth; + } + + public int getAzimuth() { + return azimuth; + } + + public void setSnr(int snr) { + this.snr = snr; + } + + public int getSnr() { + return snr; + } +} diff --git a/org.tizen.location.core/src/org/tizen/location/core/protocol/messages.properties b/org.tizen.location.core/src/org/tizen/location/core/protocol/messages.properties new file mode 100644 index 0000000..f525d05 --- /dev/null +++ b/org.tizen.location.core/src/org/tizen/location/core/protocol/messages.properties @@ -0,0 +1 @@ +SatelliteInfo_0=Invalid Satellite Info diff --git a/org.tizen.location.log/.classpath b/org.tizen.location.log/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.location.log/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.location.log/.project b/org.tizen.location.log/.project new file mode 100644 index 0000000..e673a10 --- /dev/null +++ b/org.tizen.location.log/.project @@ -0,0 +1,28 @@ + + + org.tizen.location.log + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.location.log/.settings/org.eclipse.core.resources.prefs b/org.tizen.location.log/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..9bf4202 --- /dev/null +++ b/org.tizen.location.log/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Dec 01 09:07:37 CET 2010 +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.tizen.location.log/.settings/org.eclipse.core.runtime.prefs b/org.tizen.location.log/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000..6d81787 --- /dev/null +++ b/org.tizen.location.log/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Tue Dec 14 16:29:37 CET 2010 +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.tizen.location.log/META-INF/MANIFEST.MF b/org.tizen.location.log/META-INF/MANIFEST.MF new file mode 100644 index 0000000..956ee4e --- /dev/null +++ b/org.tizen.location.log/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Location Log +Bundle-SymbolicName: org.tizen.location.log;singleton:=true +Bundle-Version: 1.3.20.qualifier +Bundle-Vendor: Tizen +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.ui.forms;bundle-version="3.3.103", + org.tizen.common, + org.tizen.injector;bundle-version="1.3.13", + org.tizen.location.core;bundle-version="1.0.0" +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/org.tizen.location.log/OSGI-INF/l10n/bundle.properties b/org.tizen.location.log/OSGI-INF/l10n/bundle.properties new file mode 100644 index 0000000..c8f3cb8 --- /dev/null +++ b/org.tizen.location.log/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,4 @@ +#Properties file for org.tizen.location.log +Bundle-Vendor = Tizen +Bundle-Name = Tizen SDK Location Log +Log = Log \ No newline at end of file diff --git a/org.tizen.location.log/build.properties b/org.tizen.location.log/build.properties new file mode 100644 index 0000000..f9eefdc --- /dev/null +++ b/org.tizen.location.log/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + OSGI-INF/l10n/bundle.properties +javacSource = 1.6 +javacTarget = 1.6 diff --git a/org.tizen.location.log/plugin.xml b/org.tizen.location.log/plugin.xml new file mode 100644 index 0000000..1e04e25 --- /dev/null +++ b/org.tizen.location.log/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/org.tizen.location.log/src/org/tizen/location/log/Log.java b/org.tizen.location.log/src/org/tizen/location/log/Log.java new file mode 100644 index 0000000..b8eb426 --- /dev/null +++ b/org.tizen.location.log/src/org/tizen/location/log/Log.java @@ -0,0 +1,58 @@ +/* + * org.tizen.location.log + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.log; + +import java.util.ArrayList; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.forms.widgets.Section; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.location.log.page.LogFile; + +public class Log extends AbstractInjectorItem { + private static String LABEL = Messages.Log_0; + + @Override + protected void addPages() { + addPage(new LogFile(this, Messages.Log_1)); + } + + public void setSiblingsEnabled(boolean enabled) { + ArrayList list = getCategoryItems("Location"); //$NON-NLS-1$ + for (int i = 0; i < list.size(); i++) { + Section parent = (Section) list.get(i).getParent(); + if (!parent.getText().equals(LABEL)) { + if(!enabled) { + parent.setExpanded(enabled); + } + parent.setEnabled(enabled); + } + } + } +} diff --git a/org.tizen.location.log/src/org/tizen/location/log/Messages.java b/org.tizen.location.log/src/org/tizen/location/log/Messages.java new file mode 100644 index 0000000..b826d39 --- /dev/null +++ b/org.tizen.location.log/src/org/tizen/location/log/Messages.java @@ -0,0 +1,43 @@ +/* + * org.tizen.location.log + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.log; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.location.log.messages"; //$NON-NLS-1$ + public static String Log_0; + public static String Log_1; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.location.log/src/org/tizen/location/log/messages.properties b/org.tizen.location.log/src/org/tizen/location/log/messages.properties new file mode 100644 index 0000000..6ee4eeb --- /dev/null +++ b/org.tizen.location.log/src/org/tizen/location/log/messages.properties @@ -0,0 +1,2 @@ +Log_0=Log +Log_1=Log File diff --git a/org.tizen.location.log/src/org/tizen/location/log/page/LogFile.java b/org.tizen.location.log/src/org/tizen/location/log/page/LogFile.java new file mode 100644 index 0000000..f5db233 --- /dev/null +++ b/org.tizen.location.log/src/org/tizen/location/log/page/LogFile.java @@ -0,0 +1,208 @@ +/* + * org.tizen.location.log + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.log.page; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.IJobChangeEvent; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.jobs.JobChangeAdapter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +//import org.eclipse.ui.IWorkbenchWindow; +//import org.eclipse.ui.PlatformUI; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; +//import org.tizen.location.core.injector.AbstractLocationInjector; +import org.tizen.location.core.injector.LocationInjector; +import org.tizen.location.log.Log; + +public class LogFile extends AbstractInjectorPage { + + private static String FILE_CHECK_VALUE = "$GP"; //$NON-NLS-1$ + + private Text filenameText; + private Button injectButton; + private Button cancelButton; + + private LocationInjector injector; + + public LogFile(AbstractInjectorItem item, String name) { + super(item, name); + } + + @Override + protected void createContents() { + createLogFileInjectComposite(); + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + + private Control createLogFileInjectComposite() { + Composite mainPage = formUtil.createComposite(parent, 2); + + filenameText = formUtil.createText(mainPage, ""); //$NON-NLS-1$ + + Button browserButton = formUtil.createButton(mainPage, Messages.LogFile_2, SWT.PUSH); + browserButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + String filename = ""; //$NON-NLS-1$ + FileDialog dialog = new FileDialog(new Shell()); + filename = dialog.open(); + + if(filename == null) + return; + + filenameText.setText(filename); + injectButton.setEnabled(validateFile()); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + + } + }); + + Composite buttonComposite = formUtil.createComposite(mainPage, 2); + + injectButton = formUtil.createButton(buttonComposite, Messages.LogFile_4, SWT.PUSH); + injectButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + final File file = new File(filenameText.getText()); + + if (file.exists()) { + Job injectJob = new Job("Inject Job") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + injector = new LocationInjector(); + boolean ret = injector.inject(file, monitor); + if(ret == false) + { + injector.setCancel(true); + monitor.setCanceled(true); + } + + if(monitor.isCanceled()) { + return Status.CANCEL_STATUS; + } + } catch (IOException e) { + return Status.CANCEL_STATUS; + } + return Status.OK_STATUS; + } + }; + + injectJob.addJobChangeListener(new JobChangeAdapter() { + + @Override + public void scheduled(IJobChangeEvent event) { + injectButton.setEnabled(false); + cancelButton.setEnabled(true); + ((Log) getParent()).setSiblingsEnabled(false); + } + }); + injectJob.schedule(); + } else { + // Exception Error + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + + } + }); + injectButton.setEnabled(false); + + cancelButton = formUtil.createButton(buttonComposite, Messages.LogFile_6, SWT.PUSH); + cancelButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + injector.setCancel(true); + injectButton.setEnabled(true); + cancelButton.setEnabled(false); + ((Log) getParent()).setSiblingsEnabled(true); + } + }); + cancelButton.setEnabled(false); + + return mainPage; + } + + private boolean validateFile() { + File file = new File(filenameText.getText()); + + if (!file.exists()) { + return false; + } + + BufferedReader br; + + try { + br = new BufferedReader(new FileReader(file)); + + String firstLine = br.readLine(); + if (!firstLine.startsWith(FILE_CHECK_VALUE)) { + return false; + } + + br.close(); + } catch (IOException e) { + return false; + } + + return true; + } +} diff --git a/org.tizen.location.log/src/org/tizen/location/log/page/Messages.java b/org.tizen.location.log/src/org/tizen/location/log/page/Messages.java new file mode 100644 index 0000000..bf28aaf --- /dev/null +++ b/org.tizen.location.log/src/org/tizen/location/log/page/Messages.java @@ -0,0 +1,44 @@ +/* + * org.tizen.location.log + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.log.page; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.location.log.page.messages"; //$NON-NLS-1$ + public static String LogFile_2; + public static String LogFile_4; + public static String LogFile_6; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.location.log/src/org/tizen/location/log/page/messages.properties b/org.tizen.location.log/src/org/tizen/location/log/page/messages.properties new file mode 100644 index 0000000..b0849f0 --- /dev/null +++ b/org.tizen.location.log/src/org/tizen/location/log/page/messages.properties @@ -0,0 +1,3 @@ +LogFile_2=Browse +LogFile_4=Inject Log +LogFile_6=Cancel diff --git a/org.tizen.location.manual/.classpath b/org.tizen.location.manual/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.location.manual/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.location.manual/.project b/org.tizen.location.manual/.project new file mode 100644 index 0000000..cbb210f --- /dev/null +++ b/org.tizen.location.manual/.project @@ -0,0 +1,28 @@ + + + org.tizen.location.manual + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.location.manual/.settings/org.eclipse.core.resources.prefs b/org.tizen.location.manual/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..0f39f29 --- /dev/null +++ b/org.tizen.location.manual/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Dec 01 09:07:42 CET 2010 +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.tizen.location.manual/.settings/org.eclipse.core.runtime.prefs b/org.tizen.location.manual/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000..713b4d0 --- /dev/null +++ b/org.tizen.location.manual/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Tue Dec 14 16:29:47 CET 2010 +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.tizen.location.manual/META-INF/MANIFEST.MF b/org.tizen.location.manual/META-INF/MANIFEST.MF new file mode 100644 index 0000000..39be509 --- /dev/null +++ b/org.tizen.location.manual/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Location Manual +Bundle-SymbolicName: org.tizen.location.manual;singleton:=true +Bundle-Version: 1.3.20.qualifier +Bundle-Vendor: Tizen +Require-Bundle: org.eclipse.ui, + org.eclipse.ui.forms, + org.eclipse.core.runtime, + org.tizen.common, + org.tizen.injector, + org.tizen.location.core +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/org.tizen.location.manual/OSGI-INF/l10n/bundle.properties b/org.tizen.location.manual/OSGI-INF/l10n/bundle.properties new file mode 100644 index 0000000..ba59d98 --- /dev/null +++ b/org.tizen.location.manual/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,4 @@ +#Properties file for org.tizen.location.manual +Bundle-Vendor = Tizen +Bundle-Name = Tizen SDK Location Manual +Manual = Manual \ No newline at end of file diff --git a/org.tizen.location.manual/build.properties b/org.tizen.location.manual/build.properties new file mode 100644 index 0000000..3605e25 --- /dev/null +++ b/org.tizen.location.manual/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + build.properties,\ + OSGI-INF/l10n/bundle.properties +javacSource = 1.6 +javacTarget = 1.6 diff --git a/org.tizen.location.manual/plugin.xml b/org.tizen.location.manual/plugin.xml new file mode 100644 index 0000000..b795162 --- /dev/null +++ b/org.tizen.location.manual/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/org.tizen.location.manual/src/org/tizen/location/manual/Manual.java b/org.tizen.location.manual/src/org/tizen/location/manual/Manual.java new file mode 100644 index 0000000..268a7ca --- /dev/null +++ b/org.tizen.location.manual/src/org/tizen/location/manual/Manual.java @@ -0,0 +1,58 @@ +/* + * org.tizen.location.manual + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.manual; + +import java.util.ArrayList; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.forms.widgets.Section; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.location.manual.page.Coordinate; + +public class Manual extends AbstractInjectorItem { + private static String LABEL = Messages.Manual_0; + + @Override + protected void addPages() { + addPage(new Coordinate(this, Messages.Manual_1)); + } + + public void setSiblingsEnabled(boolean enabled) { + ArrayList list = getCategoryItems("Location"); //$NON-NLS-1$ + for (int i = 0; i < list.size(); i++) { + Section parent = (Section) list.get(i).getParent(); + if (!parent.getText().equals(LABEL)) { + if(!enabled) { + parent.setExpanded(enabled); + } + parent.setEnabled(enabled); + } + } + } +} diff --git a/org.tizen.location.manual/src/org/tizen/location/manual/Messages.java b/org.tizen.location.manual/src/org/tizen/location/manual/Messages.java new file mode 100644 index 0000000..556383f --- /dev/null +++ b/org.tizen.location.manual/src/org/tizen/location/manual/Messages.java @@ -0,0 +1,43 @@ +/* + * org.tizen.location.manual + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.manual; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.location.manual.messages"; //$NON-NLS-1$ + public static String Manual_0; + public static String Manual_1; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.location.manual/src/org/tizen/location/manual/messages.properties b/org.tizen.location.manual/src/org/tizen/location/manual/messages.properties new file mode 100644 index 0000000..0a748ca --- /dev/null +++ b/org.tizen.location.manual/src/org/tizen/location/manual/messages.properties @@ -0,0 +1,2 @@ +Manual_0=Manual +Manual_1=Coordinate diff --git a/org.tizen.location.manual/src/org/tizen/location/manual/page/Coordinate.java b/org.tizen.location.manual/src/org/tizen/location/manual/page/Coordinate.java new file mode 100644 index 0000000..6576406 --- /dev/null +++ b/org.tizen.location.manual/src/org/tizen/location/manual/page/Coordinate.java @@ -0,0 +1,203 @@ +/* + * org.tizen.location.manual + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.manual.page; + +import java.io.IOException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.IJobChangeEvent; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.jobs.JobChangeAdapter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +//import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +//import org.eclipse.ui.IWorkbenchWindow; +//import org.eclipse.ui.PlatformUI; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; +//import org.tizen.location.core.injector.AbstractLocationInjector; +import org.tizen.location.core.injector.LocationInjector; +import org.tizen.location.core.protocol.GeoLocation; +//import org.tizen.location.core.protocol.AbstractNMEA0183; +//import org.tizen.location.core.protocol.NMEA0183_GPGGA; +//import org.tizen.location.core.protocol.NMEA0183_GPGSA; +//import org.tizen.location.core.protocol.NMEA0183_GPGSV; +//import org.tizen.location.core.protocol.NMEA0183_GPRMC; +import org.tizen.location.manual.Manual; + +public class Coordinate extends AbstractInjectorPage { + + private Text latitudeText; + private Text longitudeText; + private Button injectButton; + private Button cancelButton; + + private LocationInjector injector; + + public Coordinate(AbstractInjectorItem item, String name) { + super(item, name); + } + + @Override + protected void createContents() { + createCooridinateInputComposite(); + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + + private Control createCooridinateInputComposite() { + Composite mainPage = formUtil.createComposite(parent, 2); + + formUtil.createLabel(mainPage, Messages.Coordinate_0); + latitudeText = formUtil.createText(mainPage, ""); //$NON-NLS-1$ + latitudeText.addModifyListener(new ModifyListener() { + + @Override + public void modifyText(ModifyEvent e) { + injectButton.setEnabled(validateValues()); + } + }); + + formUtil.createLabel(mainPage, Messages.Coordinate_2); + longitudeText = formUtil.createText(mainPage, ""); //$NON-NLS-1$ + longitudeText.addModifyListener(new ModifyListener() { + + @Override + public void modifyText(ModifyEvent e) { + injectButton.setEnabled(validateValues()); + } + }); + + injectButton = formUtil.createButton(mainPage, Messages.Coordinate_4, SWT.PUSH); + injectButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if(injector != null) + injector.setCancel(true); + Double latitude = Double.parseDouble(latitudeText.getText().trim()); + Double longitude = Double.parseDouble(longitudeText.getText().trim()); + final GeoLocation location = new GeoLocation(latitude, longitude); +// final List NMEASentences = new ArrayList(); + +// NMEASentences.add(new NMEA0183_GPGSV(1)); +// NMEASentences.add(new NMEA0183_GPGSV(2)); +// NMEASentences.add(new NMEA0183_GPGSV(3)); +// NMEASentences.add(new NMEA0183_GPGGA(Double.parseDouble(latitudeText.getText().trim()), Double.parseDouble(longitudeText.getText().trim()))); +// NMEASentences.add(new NMEA0183_GPRMC(Double.parseDouble(latitudeText.getText().trim()), Double.parseDouble(longitudeText.getText().trim()))); +// NMEASentences.add(new NMEA0183_GPGSA()); + + Job injectJob = new Job("Inject Job") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + injector = new LocationInjector(); +// injector.inject(NMEASentences.toArray(new AbstractNMEA0183[NMEASentences.size()]), monitor); + injector.inject(location, monitor); + if(monitor.isCanceled()) { + return Status.CANCEL_STATUS; + } + } catch (IOException e) { + return Status.CANCEL_STATUS; + } + return Status.OK_STATUS; + } + }; + + injectJob.addJobChangeListener(new JobChangeAdapter() { + + @Override + public void scheduled(IJobChangeEvent event) { + injectButton.setEnabled(false); + cancelButton.setEnabled(true); + ((Manual) getParent()).setSiblingsEnabled(false); + } + }); + + injectJob.schedule(); + } + }); + + injectButton.setEnabled(false); + + cancelButton = formUtil.createButton(mainPage, Messages.Coordinate_6, SWT.PUSH); + cancelButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + injector.setCancel(true); + injectButton.setEnabled(validateValues()); + cancelButton.setEnabled(false); + ((Manual) getParent()).setSiblingsEnabled(true); + } + }); + cancelButton.setEnabled(false); + + return mainPage; + } + + boolean validateValues() { + double value; + + if (!latitudeText.getText().matches("[+|-]*[0-9]*[.]?[0-9]+")) { //$NON-NLS-1$ + injectButton.setEnabled(false); + return false; + } + + value = Double.parseDouble(latitudeText.getText()); + + if (value >= 90 || value <= -90) { + return false; + } + + if (!longitudeText.getText().matches("[+|-]*[0-9]*[.]?[0-9]+")) { //$NON-NLS-1$ + return false; + } + + value = Double.parseDouble(longitudeText.getText()); + + if (value >= 180 || value <= -180) { + return false; + } + + return true; + } +} diff --git a/org.tizen.location.manual/src/org/tizen/location/manual/page/Messages.java b/org.tizen.location.manual/src/org/tizen/location/manual/page/Messages.java new file mode 100644 index 0000000..e6bd631 --- /dev/null +++ b/org.tizen.location.manual/src/org/tizen/location/manual/page/Messages.java @@ -0,0 +1,45 @@ +/* + * org.tizen.location.manual + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.manual.page; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.location.manual.page.messages"; //$NON-NLS-1$ + public static String Coordinate_0; + public static String Coordinate_2; + public static String Coordinate_4; + public static String Coordinate_6; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.location.manual/src/org/tizen/location/manual/page/messages.properties b/org.tizen.location.manual/src/org/tizen/location/manual/page/messages.properties new file mode 100644 index 0000000..004598d --- /dev/null +++ b/org.tizen.location.manual/src/org/tizen/location/manual/page/messages.properties @@ -0,0 +1,4 @@ +Coordinate_0=Latitude\u02DA +Coordinate_2=Longitude\u02DA +Coordinate_4=Inject Location +Coordinate_6=Cancel diff --git a/org.tizen.location.map/.classpath b/org.tizen.location.map/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.location.map/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.location.map/.project b/org.tizen.location.map/.project new file mode 100644 index 0000000..51cdcb9 --- /dev/null +++ b/org.tizen.location.map/.project @@ -0,0 +1,28 @@ + + + org.tizen.location.map + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.location.map/.settings/org.eclipse.core.resources.prefs b/org.tizen.location.map/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..0f1b4c1 --- /dev/null +++ b/org.tizen.location.map/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Dec 01 09:07:51 CET 2010 +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.tizen.location.map/.settings/org.eclipse.core.runtime.prefs b/org.tizen.location.map/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000..cfb63fa --- /dev/null +++ b/org.tizen.location.map/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Tue Dec 14 16:29:57 CET 2010 +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.tizen.location.map/META-INF/MANIFEST.MF b/org.tizen.location.map/META-INF/MANIFEST.MF new file mode 100644 index 0000000..fcdb10a --- /dev/null +++ b/org.tizen.location.map/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Location Map +Bundle-SymbolicName: org.tizen.location.map;singleton:=true +Bundle-Version: 1.3.20.qualifier +Bundle-Vendor: Tizen +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.core.net;bundle-version="1.2.1", + org.eclipse.ui.forms;bundle-version="3.3.103", + org.tizen.common, + org.tizen.injector, + org.tizen.location.core +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/org.tizen.location.map/OSGI-INF/l10n/bundle.properties b/org.tizen.location.map/OSGI-INF/l10n/bundle.properties new file mode 100644 index 0000000..90b89c9 --- /dev/null +++ b/org.tizen.location.map/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,4 @@ +#Properties file for org.tizen.location.map +Bundle-Vendor = Tizen +Bundle-Name = Tizen SDK Location Map +Map = Map \ No newline at end of file diff --git a/org.tizen.location.map/build.properties b/org.tizen.location.map/build.properties new file mode 100644 index 0000000..f9eefdc --- /dev/null +++ b/org.tizen.location.map/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + OSGI-INF/l10n/bundle.properties +javacSource = 1.6 +javacTarget = 1.6 diff --git a/org.tizen.location.map/html/googleMap.html b/org.tizen.location.map/html/googleMap.html new file mode 100644 index 0000000..f15dcd6 --- /dev/null +++ b/org.tizen.location.map/html/googleMap.html @@ -0,0 +1 @@ +

diff --git a/org.tizen.location.map/plugin.xml b/org.tizen.location.map/plugin.xml new file mode 100644 index 0000000..b52fd04 --- /dev/null +++ b/org.tizen.location.map/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/org.tizen.location.map/src/org/tizen/location/map/Map.java b/org.tizen.location.map/src/org/tizen/location/map/Map.java new file mode 100644 index 0000000..82d88a2 --- /dev/null +++ b/org.tizen.location.map/src/org/tizen/location/map/Map.java @@ -0,0 +1,111 @@ +/* + * org.tizen.location.map + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.map; + +import java.util.ArrayList; + +import org.eclipse.core.internal.net.ProxyManager; +import org.eclipse.core.net.proxy.IProxyData; +import org.eclipse.core.net.proxy.IProxyService; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.forms.widgets.Section; + +import org.tizen.common.model.DefaultTableModel; +import org.tizen.injector.provider.AbstractInjectorItem; +//import org.tizen.location.core.injector.DebugLog; +import org.tizen.location.core.model.GeoLocationVO; +import org.tizen.location.map.page.MapImage; + +@SuppressWarnings("restriction") +public class Map extends AbstractInjectorItem { + private static String LABEL = Messages.Map_0; + + private DefaultTableModel model = new DefaultTableModel(new GeoLocationVO()); + private ArrayList viewerList = new ArrayList(); + public static String host = null; + public static int port = -1; + @Override + protected void addPages() { + init(); + addPage(new MapImage(this, Messages.Map_1, model)); + } + + private void init() { + // Get Preferences - General - Network Connections + IProxyService proxyManager = ProxyManager.getProxyManager(); + + if (proxyManager.isProxiesEnabled()) { + IProxyData proxyData = proxyManager.getProxyData(IProxyData.HTTP_PROXY_TYPE); + host = proxyData.getHost(); + port = proxyData.getPort(); + + if (host == null) { // no user-defined proxy + if (proxyManager.hasSystemProxies() && proxyManager.isSystemProxiesEnabled()) { + // get system-wide proxy + host = System.getProperty("http.proxyHost"); //$NON-NLS-1$ + String portStr = System.getProperty("http.proxyPort"); //$NON-NLS-1$ + port = ((portStr != null) ? Integer.parseInt(portStr) : -1); + } + } + + if (host != null) { + System.setProperty("network.proxy_host", host); //$NON-NLS-1$ + if (port != -1) { + System.setProperty("network.proxy_port", "" + port); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + } + +// DebugLog.log("[Activator] proxy initiate...." + System.getProperty("network.proxy_host") + " : " + //$NON-NLS-3$ +// System.getProperty("network.proxy_port")); //$NON-NLS-1$ + } + + public void addViewer(TableViewer viewer){ + viewerList.add(viewer); + } + + public void refreshViewers() { + for (int i = 0; i < viewerList.size(); i++){ + viewerList.get(i).refresh(); + } + } + + public void setSiblingsEnabled(boolean enabled) { + ArrayList list = getCategoryItems("Location"); //$NON-NLS-1$ + for (int i = 0; i < list.size(); i++) { + Section parent = (Section) list.get(i).getParent(); + if (!parent.getText().equals(LABEL)) { + if(!enabled) { + parent.setExpanded(enabled); + } + parent.setEnabled(enabled); + } + } + } +} diff --git a/org.tizen.location.map/src/org/tizen/location/map/Messages.java b/org.tizen.location.map/src/org/tizen/location/map/Messages.java new file mode 100644 index 0000000..4b80c56 --- /dev/null +++ b/org.tizen.location.map/src/org/tizen/location/map/Messages.java @@ -0,0 +1,43 @@ +/* + * org.tizen.location.map + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.map; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.location.map.messages"; //$NON-NLS-1$ + public static String Map_0; + public static String Map_1; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.location.map/src/org/tizen/location/map/messages.properties b/org.tizen.location.map/src/org/tizen/location/map/messages.properties new file mode 100644 index 0000000..ecc07c8 --- /dev/null +++ b/org.tizen.location.map/src/org/tizen/location/map/messages.properties @@ -0,0 +1,2 @@ +Map_0=Map +Map_1=Map Image diff --git a/org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java b/org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java new file mode 100644 index 0000000..fa9328b --- /dev/null +++ b/org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java @@ -0,0 +1,400 @@ +/* + * org.tizen.location.map + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.map.page; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.UnknownHostException; +//import java.util.ArrayList; +//import java.util.List; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.IJobChangeEvent; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.jobs.JobChangeAdapter; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.SWTException; +import org.eclipse.swt.browser.Browser; +import org.eclipse.swt.browser.ProgressEvent; +import org.eclipse.swt.browser.ProgressListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +import org.tizen.common.control.TableViewContentProvider; +import org.tizen.common.control.TableViewLabelProvider; +import org.tizen.common.model.DefaultTableModel; +import org.tizen.common.model.ITableVO; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; +//import org.tizen.location.core.injector.AbstractLocationInjector; +import org.tizen.location.core.injector.DebugLog; +import org.tizen.location.core.injector.LocationInjector; +import org.tizen.location.core.model.GeoLocationVO; +import org.tizen.location.core.protocol.GeoLocation; +//import org.tizen.location.core.protocol.AbstractNMEA0183; +//import org.tizen.location.core.protocol.NMEA0183_GPGGA; +//import org.tizen.location.core.protocol.NMEA0183_GPGSA; +//import org.tizen.location.core.protocol.NMEA0183_GPGSV; +//import org.tizen.location.core.protocol.NMEA0183_GPRMC; +import org.tizen.location.map.Map; + +public class MapImage extends AbstractInjectorPage { + + private Browser browser; + private String googleMapScript; + private TableViewer viewer; + private DefaultTableModel model; + private Button injectButton; + private Button resetButton; + private Button cancelButton; + + private LocationInjector injector; + + public MapImage(AbstractInjectorItem item, String name, + DefaultTableModel model) { + super(item, name); + this.model = model; + this.model.clear(); + } + + @Override + protected void createContents() { + createGoogleMapScript(); + createMapComposite(); + ((Map) getParent()).addViewer(viewer); + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + + private void createGoogleMapScript() { + if(Map.host == null && Map.port == -1) + { + try { + //make a URL to a known source + URL url = new URL("http://www.google.com"); + + //open a connection to that source + HttpURLConnection urlConnect = (HttpURLConnection)url.openConnection(); + + //trying to retrieve data from the source. If there + //is no connection, this line will fail + Object objData = urlConnect.getContent(); + urlConnect.disconnect(); + } catch (UnknownHostException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + this.googleMapScript = "



Can't connect to network.
"; + return; + } + catch (IOException e) { + // TODO Auto-generated catch block + //e.printStackTrace(); + } + } + + this.googleMapScript = "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "" //$NON-NLS-1$ + + "
" //$NON-NLS-1$ + + "" + ""; //$NON-NLS-1$ //$NON-NLS-2$ + + } + + private Control createMapComposite() { + Composite mainPage = formUtil.createComposite(parent, 1); + + browser = formUtil.createBrowser(mainPage); + browser.setJavascriptEnabled(true); + browser.addProgressListener(new ProgressListener() { + + @Override + public void completed(ProgressEvent event) { +// DebugLog.log("[Map] Map Loading: Compelete"); + } + + @Override + public void changed(ProgressEvent event) { +// DebugLog.log("[Map] Map Changed"); + } + }); + browser.setText(googleMapScript); + browser.addMouseListener(new MouseAdapter() { + @Override + public void mouseDoubleClick(MouseEvent e) { + Job markerJob = new Job("Add a Marker") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + IWorkbenchWindow window = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI + .getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + + shell.getDisplay().asyncExec(new Runnable() { + + @Override + public void run() { + try { + int markersCount = ((Double) browser.evaluate("return markersArray.length;")).intValue(); + + // Number of markers is not changed + if (model.size() == markersCount) { + return; + // Number of markers is increased properly + } else if (model.size() == markersCount - 1) { + int lastIndex = markersCount - 1; + Double latitude = ((Double) browser.evaluate("return markersArray[" + lastIndex + "].getPosition().lat();")).doubleValue(); + Double longitude = ((Double) browser.evaluate("return markersArray[" + lastIndex + "].getPosition().lng();")).doubleValue(); + + GeoLocationVO locationVO = new GeoLocationVO(); + + GeoLocation location = new GeoLocation(latitude, longitude); + locationVO.setSeq(markersCount); + locationVO.setLocation(location); + + model.add(locationVO); + ((Map) getParent()).refreshViewers(); + // Number of markers is increased improperly + } else { + model.clear(); + + for (int i = 0; i < markersCount; i++) { + Double latitude = ((Double) browser.evaluate("return markersArray[" + i + "].getPosition().lat();")).doubleValue(); + Double longitude = ((Double) browser.evaluate("return markersArray[" + i+ "].getPosition().lng();")).doubleValue(); + + GeoLocationVO locationVO = new GeoLocationVO(); + + GeoLocation location = new GeoLocation(latitude, longitude); + locationVO.setSeq(i + 1); + locationVO.setLocation(location); + + model.add(locationVO); + } + ((Map) getParent()).refreshViewers(); + } + injectButton.setEnabled(validate()); + resetButton.setEnabled(validate()); + } catch (SWTException ex) { + return; + } + } + }); + + return Status.OK_STATUS; + } + }; + + markerJob.schedule(100); + } + }); + + Composite section = formUtil + .createSection(mainPage, Messages.MapImage_62); + + String[] columnNames = { Messages.MapImage_0, Messages.MapImage_1, Messages.MapImage_2 }; + + viewer = formUtil.createTableViewer(section, columnNames, 1, SWT.BORDER | SWT.H_SCROLL + | SWT.V_SCROLL); + viewer.setContentProvider(new TableViewContentProvider()); + viewer.setLabelProvider(new TableViewLabelProvider(viewer)); + viewer.setInput(model); + + Composite buttonComposite = formUtil.createComposite(mainPage, 3); + + injectButton = formUtil.createButton(buttonComposite, Messages.MapImage_66, + SWT.PUSH); + injectButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { +// final List NMEASentences = new ArrayList(); + final ITableVO[] dataList = (ITableVO[]) model.getDatas(); + +// for (int i = 0; i < dataList.length; i++) { +// GeoLocationVO locationVO = (GeoLocationVO) dataList[i]; +// NMEASentences.add(new NMEA0183_GPGSV(1)); +// NMEASentences.add(new NMEA0183_GPGSV(2)); +// NMEASentences.add(new NMEA0183_GPGSV(3)); +// NMEASentences.add(new NMEA0183_GPGGA(locationVO.getLocation().getLatitude(), locationVO.getLocation().getLongitude())); +// NMEASentences.add(new NMEA0183_GPRMC(locationVO.getLocation().getLatitude(), locationVO.getLocation().getLongitude())); +// NMEASentences.add(new NMEA0183_GPGSA()); +// } + + Job injectJob = new Job("Inject Job") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + try { + injector = new LocationInjector(); + boolean ret = injector.inject(dataList, monitor); + if(ret == false) + this.cancel(); + + if(monitor.isCanceled()) { + return Status.CANCEL_STATUS; + } + } catch (IOException e) { + return Status.CANCEL_STATUS; + } + return Status.OK_STATUS; + } + }; + + injectJob.addJobChangeListener(new JobChangeAdapter() { + + @Override + public void scheduled(IJobChangeEvent event) { + injectButton.setEnabled(false); + browser.setEnabled(false); + cancelButton.setEnabled(true); + resetButton.setEnabled(false); + ((Map) getParent()).setSiblingsEnabled(false); + } + }); + + injectJob.schedule(); + } + }); + injectButton.setEnabled(validate()); + + + resetButton = formUtil.createButton(buttonComposite, Messages.MapImage_68, SWT.PUSH); + resetButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent event) { + if (browser != null) { + try { + // Reload Google Map + browser.refresh(); + boolean bResult = browser.setText(googleMapScript); + + model.clear(); + ((Map) getParent()).refreshViewers(); + injectButton.setEnabled(validate()); + resetButton.setEnabled(validate()); + DebugLog.log("[Map] Browser reload : " + + (bResult ? "Success" : "Fail")); + } catch (SWTException e) { + e.printStackTrace(); + } + } else { + DebugLog.log("Browser not created."); + } + } + }); + resetButton.setEnabled(validate()); + + cancelButton = formUtil.createButton(buttonComposite, Messages.MapImage_73, SWT.PUSH); + cancelButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + injector.setCancel(true); + injectButton.setEnabled(true); + browser.setEnabled(true); + resetButton.setEnabled(true); + cancelButton.setEnabled(false); + ((Map) getParent()).setSiblingsEnabled(true); + } + }); + cancelButton.setEnabled(false); + + return mainPage; + } + + private boolean validate() { + if (model.size() <= 0) { + return false; + } + + return true; + } +} diff --git a/org.tizen.location.map/src/org/tizen/location/map/page/Messages.java b/org.tizen.location.map/src/org/tizen/location/map/page/Messages.java new file mode 100644 index 0000000..0d1c499 --- /dev/null +++ b/org.tizen.location.map/src/org/tizen/location/map/page/Messages.java @@ -0,0 +1,48 @@ +/* + * org.tizen.location.map + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.location.map.page; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.tizen.location.map.page.messages"; //$NON-NLS-1$ + public static String MapImage_0; + public static String MapImage_1; + public static String MapImage_2; + public static String MapImage_62; + public static String MapImage_66; + public static String MapImage_68; + public static String MapImage_73; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/org.tizen.location.map/src/org/tizen/location/map/page/messages.properties b/org.tizen.location.map/src/org/tizen/location/map/page/messages.properties new file mode 100644 index 0000000..6119859 --- /dev/null +++ b/org.tizen.location.map/src/org/tizen/location/map/page/messages.properties @@ -0,0 +1,7 @@ +MapImage_0=Seq +MapImage_1=Latitude +MapImage_2=Longitude +MapImage_62=Location Markers +MapImage_66=Inject Markers +MapImage_68=Reset Markers +MapImage_73=Cancel diff --git a/org.tizen.nfc/.classpath b/org.tizen.nfc/.classpath new file mode 100644 index 0000000..121e527 --- /dev/null +++ b/org.tizen.nfc/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.nfc/.project b/org.tizen.nfc/.project new file mode 100644 index 0000000..af6f26a --- /dev/null +++ b/org.tizen.nfc/.project @@ -0,0 +1,28 @@ + + + org.tizen.nfc + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.nfc/.settings/org.eclipse.jdt.core.prefs b/org.tizen.nfc/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..71c4657 --- /dev/null +++ b/org.tizen.nfc/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Tue Oct 04 17:29:44 KST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.nfc/META-INF/MANIFEST.MF b/org.tizen.nfc/META-INF/MANIFEST.MF new file mode 100644 index 0000000..1a440bc --- /dev/null +++ b/org.tizen.nfc/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Nfc +Bundle-SymbolicName: org.tizen.nfc;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Tizen +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.tizen.injector, + org.eclipse.swt;bundle-version="3.6.2", + org.tizen.common;bundle-version="1.3.20", + org.tizen.common.connection;bundle-version="1.0.0", + org.eclipse.core.runtime;bundle-version="3.7.0" +Import-Package: org.tizen.sdblib, + org.eclipse.ui.plugin diff --git a/org.tizen.nfc/build.properties b/org.tizen.nfc/build.properties new file mode 100644 index 0000000..e9863e2 --- /dev/null +++ b/org.tizen.nfc/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.tizen.nfc/plugin.xml b/org.tizen.nfc/plugin.xml new file mode 100644 index 0000000..2b0e9c3 --- /dev/null +++ b/org.tizen.nfc/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/org.tizen.nfc/src/org/tizen/nfc/Nfc.java b/org.tizen.nfc/src/org/tizen/nfc/Nfc.java new file mode 100644 index 0000000..64b7975 --- /dev/null +++ b/org.tizen.nfc/src/org/tizen/nfc/Nfc.java @@ -0,0 +1,33 @@ +/* + * org.tizen.nfc.tag + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * DongKyun Yun + * Jihye kim + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.nfc; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.nfc.page.NfcPage; + +public class Nfc extends AbstractInjectorItem +{ + @Override + protected void addPages() + { + addPage(new NfcPage(this, "NFC")); + } +} diff --git a/org.tizen.nfc/src/org/tizen/nfc/page/NDEFRecord.java b/org.tizen.nfc/src/org/tizen/nfc/page/NDEFRecord.java new file mode 100644 index 0000000..29ee521 --- /dev/null +++ b/org.tizen.nfc/src/org/tizen/nfc/page/NDEFRecord.java @@ -0,0 +1,61 @@ +package org.tizen.nfc.page; + +public class NDEFRecord +{ + private int format = 0; + private String typename = null; + private String id = null; + private String payload = null; + + public NDEFRecord() + { + } + + public NDEFRecord(int f, String n, String i, String p) + { + setFormat(f); + setTypeName(n); + setId(i); + setPayload(p); + } + + public int getFormat() + { + return format; + } + + public void setFormat(int format) + { + this.format = format; + } + + public String getTypeName() + { + return typename; + } + + public void setTypeName(String name) + { + this.typename = name; + } + + public String getId() + { + return id; + } + + public void setId(String id) + { + this.id = id; + } + + public String getPayload() + { + return payload; + } + + public void setPayload(String payload) + { + this.payload = payload; + } +} \ No newline at end of file diff --git a/org.tizen.nfc/src/org/tizen/nfc/page/NfcCommand.java b/org.tizen.nfc/src/org/tizen/nfc/page/NfcCommand.java new file mode 100644 index 0000000..56226a3 --- /dev/null +++ b/org.tizen.nfc/src/org/tizen/nfc/page/NfcCommand.java @@ -0,0 +1,10 @@ +package org.tizen.nfc.page; + +public class NfcCommand +{ + public static final Integer NFC_TAG_DISCOVERED = 100; + public static final Integer NFC_TAG_DETACHED = 101; + public static final Integer NFC_P2P_DISCOVERED = 102; + public static final Integer NFC_P2P_DETACHED = 103; + public static final Integer NFC_P2P_SEND = 104; +} diff --git a/org.tizen.nfc/src/org/tizen/nfc/page/NfcDialog.java b/org.tizen.nfc/src/org/tizen/nfc/page/NfcDialog.java new file mode 100644 index 0000000..5bfc9e8 --- /dev/null +++ b/org.tizen.nfc/src/org/tizen/nfc/page/NfcDialog.java @@ -0,0 +1,72 @@ +package org.tizen.nfc.page; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Shell; + +public abstract class NfcDialog +{ + public static void openInfoDialog(String message) { + openInfoDialog(new Shell(), message); + } + + public static void openInfoDialog(final Shell shell, final String message) { + Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + openInfoDialog(s, "Info", message); + } + + public static void openInfoDialog(final Shell shell, final String title, final String message) { + final Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + + Display.getDefault().syncExec(new Runnable() { + public void run() { + MessageBox dialog = new MessageBox(s, SWT.OK | SWT.MODELESS | SWT.ICON_INFORMATION); + dialog.setText(title); + dialog.setMessage(message); + dialog.open(); + } + }); + } + + public static void openErrorDialog(String message) { + openErrorDialog(new Shell(), message); + } + + public static void openErrorDialog(final Shell shell, final String message) { + Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + openErrorDialog(s, "Error", message); + } + + public static void openErrorDialog(final Shell shell, final String title, final String message) { + final Shell s; + if (shell == null) { + s = new Shell(); + } else { + s = shell; + } + Display.getDefault().syncExec(new Runnable() { + public void run() { + MessageBox dialog = new MessageBox(s, SWT.OK | SWT.MODELESS | SWT.ICON_ERROR); + dialog.setText(title); + dialog.setMessage(message); + dialog.open(); + } + }); + } +} diff --git a/org.tizen.nfc/src/org/tizen/nfc/page/NfcMimeType.java b/org.tizen.nfc/src/org/tizen/nfc/page/NfcMimeType.java new file mode 100644 index 0000000..06f8ce4 --- /dev/null +++ b/org.tizen.nfc/src/org/tizen/nfc/page/NfcMimeType.java @@ -0,0 +1,81 @@ +package org.tizen.nfc.page; + +import java.util.ArrayList; + +class MimeTypeList +{ + private static MimeTypeList typelist = new MimeTypeList(); + private ArrayList list; + + public static MimeTypeList getInstance() + { + return typelist; + } + + private MimeTypeList() + { + list = new ArrayList(); + list.add(new NfcMimeType("vcf", "application/vcard")); + list.add(new NfcMimeType("jpeg", "image/jpeg")); + list.add(new NfcMimeType("mpeg", "image/mpeg")); + list.add(new NfcMimeType("png", "image/png")); + list.add(new NfcMimeType("gif", "image/gif")); + list.add(new NfcMimeType("bmp", "image/bmp")); + list.add(new NfcMimeType("jpg", "image/jpeg")); + list.add(new NfcMimeType("jpe", "image/jpeg")); + list.add(new NfcMimeType("mp3", "audio/mpeg")); + list.add(new NfcMimeType("mid", "audio/midi")); + list.add(new NfcMimeType("wav", "audio/x-wav")); + list.add(new NfcMimeType("mp4", "video/mp4")); + list.add(new NfcMimeType("mpe", "video/mpeg")); + list.add(new NfcMimeType("mpg", "video/mpeg")); + list.add(new NfcMimeType("mov", "video/quicktime")); + list.add(new NfcMimeType("flv", "video/x-flv")); + list.add(new NfcMimeType("asf", "video/x-ms-asf")); + list.add(new NfcMimeType("avi", "video/x-msvideo")); + } + + public String findMimeType(String ex) + { + + for (NfcMimeType mimetype : list) { + if (mimetype.getExtension().equals(ex)) { + return mimetype.getMimetype(); + } + } + + return null; + } +} + +class NfcMimeType +{ + private String extension; + private String mimetype; + + public NfcMimeType(String ex, String type) + { + setExtension(ex); + setMimetype(type); + } + + public String getExtension() + { + return extension; + } + + public void setExtension(String extension) + { + this.extension = extension; + } + + public String getMimetype() + { + return mimetype; + } + + public void setMimetype(String mimetype) + { + this.mimetype = mimetype; + } +} diff --git a/org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java b/org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java new file mode 100644 index 0000000..4598a65 --- /dev/null +++ b/org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java @@ -0,0 +1,954 @@ +/* + * org.tizen.nfc.tag.page + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Jihye kim + * Sungmin Ha + * DongKyun Yun + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.nfc.page; + +import java.io.IOException; +import java.util.ArrayList; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.common.connection.ui.TizenRemoteFileDialog; +import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.sdblib.MultiLineReceiver; +import org.tizen.sdblib.SdbCommandRejectedException; +import org.tizen.sdblib.ShellCommandUnresponsiveException; +import org.tizen.sdblib.TimeoutException; + +public class NfcPage extends AbstractInjectorPage implements ISelectionListener +{ + // add NDEFMessage + private String[] RecordFormatList = RecordFormat.getInstance().getList(); + private String[] TypeNameList = TypeName.getInstance().getList(); + private Combo cmbRecordFormat; + private Combo cmbRecordTypeName; + private Text txtRecordTypeName; + private Text txtRecordID; + private Text txtRecordPayload; + private Button butSelectMediaFile; + + // check invalid characters + private NDEFRecord oldRecord = new NDEFRecord(0, "", "", ""); + private boolean bCheckTypeNameText = true; + private boolean bCheckIDText = true; + private boolean bCheckPayloadText = true; + + private Button butRecordAdd; + private Button butRecordEdit; + private Button butRecordRemove; + + private Label lblRecords; + private int nTotalLength = 0; + private final int nMaxNDFEMessageLength = 4096; + private Combo cmbRecordList; + private ArrayList RecordList = new ArrayList(); + + // add Tag + private String[] TagTypeList = TagType.getInstance().getList(); + private Combo cmbTagTypeList; + private Button butTagAttach; + private Button butTagDetach; + + // add P2P + private Button butP2PDiscover; + private Button butP2PSend; + private Button butP2PDetach; + + private IDevice currentDevice; + private Shell shell = null; + + public NfcPage(AbstractInjectorItem item, String name) + { + super(item, name); + } + + @Override + protected void createContents() + { + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + ConnectionPlugin.getDefault().addSelectionListener(this); + + shell = parent.getShell(); + + createNDEFMessageSection(); + createTagSection(); + createP2PSection(); + + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } + } + + private void createNDEFMessageSection() + { + Composite client = formUtil.createSection(parent, "NDEF Message"); + Composite messageComposite = formUtil.createComposite(client); + + createRecordComposite(messageComposite); + + Composite buttonComposite = formUtil.createComposite(messageComposite, + 3); + butRecordAdd = formUtil.createButton(buttonComposite, "Add", SWT.PUSH); + butRecordEdit = formUtil + .createButton(buttonComposite, "Edit", SWT.PUSH); + butRecordRemove = formUtil.createButton(buttonComposite, "Remove", + SWT.PUSH); + + GridData gd1 = new GridData(); + gd1.widthHint = 110; + butRecordAdd.setLayoutData(gd1); + butRecordEdit.setLayoutData(gd1); + butRecordRemove.setLayoutData(gd1); + + butRecordAdd.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + addRecord(); + } + }); + butRecordEdit.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + editRecord(); + } + }); + butRecordRemove.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + removeRecord(); + } + }); + + Composite RecordComposite = formUtil.createComposite(messageComposite, 2); + GridData gd2 = new GridData(); + gd2.widthHint = 160; + lblRecords = formUtil.createLabel(RecordComposite, String.format("Records [0/%d] ", nMaxNDFEMessageLength)); + lblRecords.setLayoutData(gd2); + + cmbRecordList = formUtil.createCombo(RecordComposite); + cmbRecordList.setLayoutData(gd2); + cmbRecordList.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + selectRecord(); + } + }); + } + + private void createRecordComposite(Composite parent) + { + GridData gd1 = new GridData(); + gd1.widthHint = 200; + + Composite messageComposite = formUtil.createComposite(parent, 2); + + formUtil.createLabel(messageComposite, "Type Name Format "); + cmbRecordFormat = formUtil.createCombo(messageComposite); + cmbRecordFormat.setLayoutData(gd1); + formUtil.addComboItem(cmbRecordFormat, RecordFormatList); + cmbRecordFormat.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + Selected(e); + } + + public void widgetDefaultSelected(SelectionEvent e) { + Selected(e); + } + + private void Selected(SelectionEvent e) { + int i = cmbRecordFormat.getSelectionIndex(); + if (i != -1) { + checkRecordFormat(i); + txtRecordTypeName.setText(""); + cmbRecordTypeName.select(0); + txtRecordID.setText(""); + txtRecordPayload.setText(""); + } + } + }); + + formUtil.createLabel(messageComposite, "Type Name "); + txtRecordTypeName = formUtil.createText(messageComposite, ""); + txtRecordTypeName.setEnabled(false); + txtRecordTypeName.setLayoutData(gd1); + txtRecordTypeName.setTextLimit(250); + txtRecordTypeName.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + if (bCheckTypeNameText == false) { + bCheckTypeNameText = true; + return; + } + if (checkInvalidCharaters(txtRecordTypeName.getText()) == false) { + txtRecordTypeName.setText(oldRecord.getTypeName()); + return; + } + oldRecord.setTypeName(txtRecordTypeName.getText()); + } + }); + + formUtil.createLabel(messageComposite, ""); + cmbRecordTypeName = formUtil.createCombo(messageComposite); + formUtil.addComboItem(cmbRecordTypeName, TypeNameList); + cmbRecordTypeName.setEnabled(false); + cmbRecordTypeName.setLayoutData(gd1); + + formUtil.createLabel(messageComposite, "ID "); + txtRecordID = formUtil.createText(messageComposite, ""); + txtRecordID.setEnabled(false); + txtRecordID.setLayoutData(gd1); + txtRecordID.setTextLimit(250); + txtRecordID.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + if (bCheckIDText == false) { + bCheckIDText = true; + return; + } + if (checkInvalidCharaters(txtRecordID.getText()) == false) { + txtRecordID.setText(oldRecord.getId()); + return; + } + oldRecord.setId(txtRecordID.getText()); + } + }); + + formUtil.createLabel(messageComposite, "Payload "); + txtRecordPayload = formUtil.createText(messageComposite, ""); + txtRecordPayload.setEnabled(false); + txtRecordPayload.setLayoutData(gd1); + txtRecordPayload.setTextLimit(1024); + txtRecordPayload.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + if (bCheckPayloadText == false) { + bCheckPayloadText = true; + return; + } + if (checkInvalidCharaters(txtRecordPayload.getText()) == false) { + txtRecordPayload.setText(oldRecord.getPayload()); + return; + } + oldRecord.setPayload(txtRecordPayload.getText()); + } + }); + + formUtil.createLabel(messageComposite, ""); + butSelectMediaFile = formUtil.createButton(messageComposite, + "Select Media File", SWT.PUSH); + butSelectMediaFile.setEnabled(false); + butSelectMediaFile.setLayoutData(new GridData(GridData.END, + GridData.END, false, false)); + butSelectMediaFile.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + selectMediaFile(); + } + }); + } + + private void createTagSection() + { + Composite client = formUtil.createSection(parent, "NFC Tag"); + Composite mainComposite = formUtil.createComposite(client, 3); + + formUtil.createLabel(mainComposite, "Tag Type "); + cmbTagTypeList = formUtil.createCombo(mainComposite); + GridData gd1 = new GridData(); + gd1.widthHint = 180; + cmbTagTypeList.setLayoutData(gd1); + formUtil.addComboItem(cmbTagTypeList, TagTypeList, TagTypeList[0]); + + GridData gd2 = new GridData(); + gd2.widthHint = 100; + + butTagAttach = formUtil.createButton(mainComposite, "Tag Attach", SWT.PUSH); + butTagAttach.setLayoutData(gd2); + + formUtil.createLabel(mainComposite, ""); + formUtil.createLabel(mainComposite, ""); + butTagDetach = formUtil.createButton(mainComposite, "Tag Detach", SWT.PUSH); + butTagDetach.setLayoutData(gd2); + butTagDetach.setEnabled(false); + + butTagAttach.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + clickTagDiscovered(); + } + }); + + butTagDetach.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + clickTagDetached(); + } + }); + } + + private void createP2PSection() + { + Composite client = formUtil.createSection(parent, "Peer to Peer"); + Composite mainComposite = formUtil.createComposite(client, 2); + + butP2PDiscover = formUtil.createButton(mainComposite, "P2P Discovered", SWT.PUSH); + butP2PDetach = formUtil.createButton(mainComposite, "P2P Detached", SWT.PUSH); + butP2PSend = formUtil.createButton(mainComposite, "P2PSend", SWT.PUSH); + + // TODO + butP2PDiscover.setEnabled(true); + butP2PDetach.setEnabled(false); + butP2PSend.setEnabled(false); + // + + GridData gd = new GridData(); + gd.widthHint = 170; + butP2PDiscover.setLayoutData(gd); + butP2PDetach.setLayoutData(gd); + butP2PSend.setLayoutData(gd); + + butP2PDiscover.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) + { + clickP2PDiscovered(); + } + }); + + butP2PDetach.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) + { + clickP2PDetached(); + } + }); + + butP2PSend.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) + { + clickP2PSend(); + } + }); + } + + private void selectRecord() { + int i = cmbRecordList.getSelectionIndex(); + if (i != -1) { + NDEFRecord record = RecordList.get(i); + checkRecordFormat(record.getFormat()); + cmbRecordFormat.select(record.getFormat()); + + if (record.getFormat() == 1) { + if (record.getTypeName().compareTo("U") == 0) + cmbRecordTypeName.select(0); + else + cmbRecordTypeName.select(1); + txtRecordTypeName.setText(""); + } else { + cmbRecordTypeName.select(0); + txtRecordTypeName.setText(record.getTypeName()); + } + + txtRecordID.setText(record.getId()); + txtRecordPayload.setText(record.getPayload()); + } + } + + private boolean checkInvalidCharaters(String text) + { + char[] textArray = new char[1000]; + text.getChars(0, text.length(), textArray, 0); + + for (int i = 0; i < text.length(); i++) { + char c = textArray[i]; + if (c == '\n') { + NfcDialog.openInfoDialog(shell, "Can not enter a newline character."); + return false; + } + + if (c == ',') { + NfcDialog.openInfoDialog(shell, "Can not enter ',' character.\nThis character is used separater character."); + return false; + } + + if (c >= 0x80) { + NfcDialog.openInfoDialog(shell, "Invalid characters are entered.\nOnly ASCII characters can be entered.\n"); + return false; + } + } + return true; + } + + private void clickTagDiscovered() { + String msg = makeSendMessage(NfcCommand.NFC_TAG_DISCOVERED); + if (msg != null) { + sendMessage(msg); + { + cmbRecordFormat.setEnabled(false); + checkRecordFormat(0); + + cmbRecordList.setEnabled(false); + butRecordAdd.setEnabled(false); + butRecordEdit.setEnabled(false); + butRecordRemove.setEnabled(false); + + cmbTagTypeList.setEnabled(false); + butTagAttach.setEnabled(false); + butTagDetach.setEnabled(true); + + butP2PDiscover.setEnabled(false); + butP2PDetach.setEnabled(false); + butP2PSend.setEnabled(false); + } + } + } + + private void clickTagDetached() { + String msg = makeSendMessage(NfcCommand.NFC_TAG_DETACHED); + if (msg != null) { + sendMessage(msg); + { + cmbRecordFormat.setEnabled(true); + + checkRecordFormat(cmbRecordFormat.getSelectionIndex()); + txtRecordTypeName.setText(""); + cmbRecordTypeName.select(0); + txtRecordID.setText(""); + txtRecordPayload.setText(""); + + cmbRecordList.setEnabled(true); + butRecordAdd.setEnabled(true); + butRecordEdit.setEnabled(true); + butRecordRemove.setEnabled(true); + + cmbTagTypeList.setEnabled(true); + butTagAttach.setEnabled(true); + butTagDetach.setEnabled(false); + + butP2PDiscover.setEnabled(true); + butP2PDetach.setEnabled(false); + butP2PSend.setEnabled(false); + } + } + } + + private void clickP2PDiscovered() { + String msg = makeSendMessage(NfcCommand.NFC_P2P_DISCOVERED); + if (msg != null) { + sendMessage(msg); + { + cmbTagTypeList.setEnabled(false); + butTagAttach.setEnabled(false); + butTagDetach.setEnabled(false); + + butP2PDiscover.setEnabled(false); + butP2PDetach.setEnabled(true); + butP2PSend.setEnabled(true); + } + } + + } + + private void clickP2PDetached() { + String msg = makeSendMessage(NfcCommand.NFC_P2P_DETACHED); + if (msg != null) { + sendMessage(msg); + { + cmbRecordFormat.setEnabled(true); + + checkRecordFormat(cmbRecordFormat.getSelectionIndex()); + txtRecordTypeName.setText(""); + cmbRecordTypeName.select(0); + txtRecordID.setText(""); + txtRecordPayload.setText(""); + + cmbRecordList.setEnabled(true); + butRecordAdd.setEnabled(true); + butRecordEdit.setEnabled(true); + butRecordRemove.setEnabled(true); + + cmbTagTypeList.setEnabled(true); + butTagAttach.setEnabled(true); + butTagDetach.setEnabled(false); + + butP2PDiscover.setEnabled(true); + butP2PDetach.setEnabled(false); + butP2PSend.setEnabled(false); + } + } + } + + private void clickP2PSend() { + String msg = makeSendMessage(NfcCommand.NFC_P2P_SEND); + if (msg != null) { + sendMessage(msg); + cmbRecordFormat.setEnabled(false); + checkRecordFormat(0); + + cmbRecordList.setEnabled(false); + butRecordAdd.setEnabled(false); + butRecordEdit.setEnabled(false); + butRecordRemove.setEnabled(false); + + cmbTagTypeList.setEnabled(false); + butTagAttach.setEnabled(false); + butTagDetach.setEnabled(false); + + butP2PDiscover.setEnabled(false); + butP2PDetach.setEnabled(true); + butP2PSend.setEnabled(false); + } + } + + private void checkRecordFormat(int format) + { + switch (format) { + case 0: // NDEF_TNF_EMPTY + cmbRecordTypeName.setEnabled(false); + txtRecordTypeName.setEnabled(false); + txtRecordID.setEnabled(false); + txtRecordPayload.setEnabled(false); + butSelectMediaFile.setEnabled(false); + break; + case 1: // NDEF_TNF_WELL_KNOWN + cmbRecordTypeName.setEnabled(true); + cmbRecordTypeName.select(0); + txtRecordTypeName.setEnabled(false); + txtRecordID.setEnabled(true); + txtRecordPayload.setEnabled(true); + txtRecordPayload.setEditable(true); + butSelectMediaFile.setEnabled(false); + break; + case 2: // NDEF_TNF_MIME_MEDIA + cmbRecordTypeName.setEnabled(false); + txtRecordTypeName.setEnabled(true); + txtRecordTypeName.setEditable(false); + txtRecordID.setEnabled(true); + txtRecordPayload.setEnabled(true); + txtRecordPayload.setEditable(false); + butSelectMediaFile.setEnabled(true); + break; + case 3: // NDEF_TNF_ABSOLUTE_URI + case 4: // NDEF_TNF_EXTERNAL + cmbRecordTypeName.setEnabled(false); + txtRecordTypeName.setEnabled(true); + txtRecordTypeName.setEditable(true); + txtRecordID.setEnabled(true); + txtRecordPayload.setEnabled(true); + txtRecordPayload.setEditable(true); + butSelectMediaFile.setEnabled(false); + break; + case 5: // NDEF_TNF_UNKNOWN + cmbRecordTypeName.setEnabled(false); + txtRecordTypeName.setEnabled(false); + txtRecordID.setEnabled(true); + txtRecordPayload.setEnabled(true); + txtRecordPayload.setEditable(true); + butSelectMediaFile.setEnabled(false); + break; + } + bCheckTypeNameText = false; + bCheckIDText = false; + bCheckPayloadText = false; + } + + private void addRecord() + { + if (RecordList.size() >= 5) { + NfcDialog.openInfoDialog(shell, "The number of NDEF records has reached the maximum limit of 5.\n"); + return; + } + + NDEFRecord record = new NDEFRecord(); + + /* + // check duplicate id !! + if (cmbRecordFormat.getSelectionIndex() != 0) { + if (!checkRecordID(txtRecordID.getText() != null ? txtRecordID.getText() : "Null")) { + return; + } + } + */ + + setRecordValue(record); + RecordList.add(record); + if (!checkRecordlistMaxLength()) { + RecordList.remove(record); + return; + } + + lblRecords.setText(String.format("Records [%4d/%d] ", nTotalLength, nMaxNDFEMessageLength)); + cmbRecordList.add("record item" + RecordList.indexOf(record)); + cmbRecordList.clearSelection(); + } + + private void editRecord() + { + int i = cmbRecordList.getSelectionIndex(); + if (i != -1) { + NDEFRecord record = RecordList.get(i); + /* + // check duplicate id !! + if (record.getFormat() != 0) { + if (!checkRecordID(txtRecordID.getText() != null ? txtRecordID.getText() : "Null", i)) { + return; + } + } + */ + + NDEFRecord copyRecord = record; + setRecordValue(record); + + if (!checkRecordlistMaxLength()) { + record = copyRecord; + return; + } + + lblRecords.setText(String.format("Records [%4d/%d] ", nTotalLength, nMaxNDFEMessageLength)); + // cmbRecordFormat.select(record.getFormat()); + // checkFormat(record.getFormat()); + } + } + + private void removeRecord() + { + int index = cmbRecordList.getSelectionIndex(); + if (index != -1) { + RecordList.remove(index); + cmbRecordList.removeAll(); + for (int i = 0; i < RecordList.size(); i++) { + cmbRecordList.add("record item" + i); + } + cmbRecordList.clearSelection(); + } + + checkRecordlistMaxLength(); + lblRecords.setText(String.format("Records [%4d/%d] ", nTotalLength, nMaxNDFEMessageLength)); + txtRecordTypeName.setText(""); + cmbRecordTypeName.select(0); + txtRecordID.setText(""); + txtRecordPayload.setText(""); + } + + private void setRecordValue(NDEFRecord record) + { + record.setFormat(cmbRecordFormat.getSelectionIndex()); + + if (cmbRecordFormat.getSelectionIndex() == 1) { + record.setTypeName(TypeNameList[cmbRecordTypeName.getSelectionIndex()]); + } else { + if (txtRecordTypeName.getText().isEmpty() == true) + record.setTypeName("Null"); + else + record.setTypeName(txtRecordTypeName.getText()); + } + + if (txtRecordID.getText().isEmpty() == true) + record.setId("Null"); + else + record.setId(txtRecordID.getText()); + + if (txtRecordPayload.getText().isEmpty() == true) + record.setPayload("Null"); + else + record.setPayload(txtRecordPayload.getText()); + } + +/* + private boolean checkRecordID(String id) + { + for (NDEFRecord record : RecordList) { + if (id.equals(record.getId())) { + NfcDialog.openInfoDialog(shell, "Duplicate ID is not allowed.\n"); + return false; + } + } + + return true; + } + + private boolean checkRecordID(String id, int except) + { + NDEFRecord record; + for (int i = 0; i < RecordList.size(); i++) { + if (i == except) + continue; + + record = RecordList.get(i); + if (id.equals(record.getId())) { + NfcDialog.openInfoDialog(shell, "Duplicate ID is not allowed.\n"); + return false; + } + } + + return true; + + } +*/ + + private boolean checkRecordlistMaxLength() + { + int lenList = 0; + + for (NDEFRecord record : RecordList) { + lenList += 1 + record.getTypeName().length() + + record.getId().length() + record.getPayload().length() + 4; + } + + if (lenList > nMaxNDFEMessageLength) { + NfcDialog.openInfoDialog(shell, String.format("The length of the NDEF message has reached the maxium limit of %d bytes\n", nMaxNDFEMessageLength)); + return false; + } + + nTotalLength = lenList; + + return true; + } + + private static String MediaFilePath = null; + private String shellCmd = null; + private String shellResult = null; + + private void selectMediaFile() + { + MediaFilePath = null; + if (shell != null) { + shell.getDisplay().syncExec(new Runnable() { + public void run() { + TizenRemoteFileDialog dlg = new TizenRemoteFileDialog( + shell, "Select a media file", currentDevice, false, + "/opt/nfc"); + if (dlg.open() == TizenRemoteFileDialogResult.OK) { + FileEntry fileEntry = dlg.getSelectedFileEntry(); + MediaFilePath = fileEntry.getFullPath(); + } + } + }); + } else { + NfcDialog.openErrorDialog("Can not open emulator's file dialog.\n"); + } + + if (MediaFilePath == null) { + NfcDialog.openErrorDialog(shell, "Please choose media file.\n"); + } else { + String type = null; + type = checkFileType(MediaFilePath); + if (type == null) { + NfcDialog.openErrorDialog(shell, "Type of selected file is not mime media type.\n"); + return; + } + if (checkFileSize(MediaFilePath) == false) { + NfcDialog.openErrorDialog(shell, "Size of selected file is too big. Available file size is under of 10.\n"); + return; + } + txtRecordTypeName.setEnabled(true); + txtRecordTypeName.setEditable(false); + txtRecordPayload.setEnabled(true); + txtRecordPayload.setEditable(false); + txtRecordTypeName.setText(type); + txtRecordPayload.setText(MediaFilePath); + } + } + + private String checkFileType(String filePath) { + int index = filePath.lastIndexOf('.'); + String type = null; + if (index != -1) { + String ex = filePath.substring(index + 1); + MimeTypeList typelist = MimeTypeList.getInstance(); + + type = typelist.findMimeType(ex); + } + return type; + } + + private boolean checkFileSize(String filePath) { + boolean result = false; + shellCmd = "du " + filePath; + try { + currentDevice.executeShellCommand(shellCmd, new MultiLineReceiver() { + @Override + public void processNewLines(String[] lines) { + shellResult = lines[0]; + } + + }); + } catch (TimeoutException e) { + errorSelectMediaFile(e); + return result; + } catch (SdbCommandRejectedException e) { + errorSelectMediaFile(e); + return result; + } catch (ShellCommandUnresponsiveException e) { + errorSelectMediaFile(e); + return result; + } catch (IOException e) { + errorSelectMediaFile(e); + return result; + } + + if (shellResult != null) { + int index = shellResult.indexOf('\t'); + if (index != -1) { + shellResult = shellResult.substring(0, index); + + if (Integer.valueOf(shellResult) <= 10) { + result = true; + } + } + } + return result; + } + + private void errorSelectMediaFile(Exception e) { + NfcDialog.openErrorDialog(shell, String.format("Throw exception while select media file : %s\n", e.getMessage())); + } + + private String makeSendMessage(Integer type) + { + String msg = null; + switch (type) { + case 100: // NFC_TAG_DISCOVERED + { + int tagtype = cmbTagTypeList.getSelectionIndex(); + if (tagtype != -1 && tagtype != 0) { + String records = new String(); + records += "," + RecordList.size(); + for (NDEFRecord record : RecordList) { + records += "," + record.getFormat() + "," + + record.getTypeName() + "," + record.getId() + "," + + record.getPayload(); + } + + msg = NfcCommand.NFC_TAG_DISCOVERED.toString() + ":" + + String.valueOf(tagtype) + records + "\n"; + + } else { + NfcDialog.openErrorDialog(shell, "Select Tag Type\n"); + return null; + } + } + break; + case 101: // NFC_TAG_DETACHED + msg = NfcCommand.NFC_TAG_DETACHED.toString() + ":" + "\n"; + break; + case 102: // NFC_P2P_DISCOVERED + msg = NfcCommand.NFC_P2P_DISCOVERED.toString() + ":\n"; + break; + case 103: // NFC_P2P_DETACHED + msg = NfcCommand.NFC_P2P_DETACHED.toString() + ":\n"; + break; + case 104: // NFC_P2P_SEND + { + int tagtype = 5; // for peer to peer + String records = new String(); + records += "," + RecordList.size(); + for (NDEFRecord record : RecordList) { + records += "," + record.getFormat() + "," + + record.getTypeName() + "," + record.getId() + "," + + record.getPayload(); + } + + msg = NfcCommand.NFC_P2P_SEND.toString() + ":" + + String.valueOf(tagtype) + records + "\n"; + } + break; + } + + return msg; + } + + public boolean sendMessage(String msg) + { + boolean result = false; + try { + // add for test + //NfcDialog.openInfoDialog(shell, msg); + result = injectorSocket.sendNfc(msg); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + return result; + } + + private boolean checkDeviceConnectedAlready() + { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() + { + // TODO Auto-generated method stub + + } + + // @Override + public void connect() + { + // TODO Auto-generated method stub + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + } + + // @Override + public void disconnect() + { + // TODO Auto-generated method stub + } + + @Override + protected void finalize() throws Throwable + { + ConnectionPlugin.getDefault().removeSelectionListener(this); + // TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) + { + if (selectedEntry == null) { + disconnect(); + return; + } else if (!selectedEntry.getFileListingService().getDevice() + .isEmulator()) + return; + + if (currentDevice == null && selectedEntry.getName() != null) + connect(); + else if (currentDevice == null && selectedEntry.getName() == null) + return; + else if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect(); + connect(); + } + } +} \ No newline at end of file diff --git a/org.tizen.nfc/src/org/tizen/nfc/page/NfcStringResource.java b/org.tizen.nfc/src/org/tizen/nfc/page/NfcStringResource.java new file mode 100644 index 0000000..c3cc808 --- /dev/null +++ b/org.tizen.nfc/src/org/tizen/nfc/page/NfcStringResource.java @@ -0,0 +1,81 @@ +package org.tizen.nfc.page; + +import java.util.ArrayList; + +public class NfcStringResource +{ + private ArrayList list; + + public NfcStringResource() + { + list = new ArrayList(); + } + + public void add(int index, String element) + { + list.add(index, element); + } + + public String[] getList() + { + return list.toArray(new String[size()]); + } + + public int size() + { + return list.size(); + } +} + +class TagType extends NfcStringResource +{ + private static TagType tagtype = new TagType(); + public static TagType getInstance() + { + return tagtype; + } + + private TagType() + { + add(0, ""); + add(1, "Topaz Jewel (Type1)"); + add(2, "Mifare UL (Type2)"); + add(3, "Felica (Type3)"); + add(4, "Mifare Desfire (Type4)"); + } + +} + +class RecordFormat extends NfcStringResource +{ + private static RecordFormat format = new RecordFormat(); + public static RecordFormat getInstance() + { + return format; + } + + private RecordFormat() + { + add(0, "NDEF_TNF_EMPTY"); + add(1, "NDEF_TNF_WELL_KNOWN"); + add(2, "NDEF_TNF_MIME_MEDIA"); + add(3, "NDEF_TNF_ABSOLUTE_URI"); + add(4, "NDEF_TNF_EXTERNAL"); + add(5, "NDEF_TNF_UNKNOWN"); + } +} + +class TypeName extends NfcStringResource +{ + private static TypeName typename = new TypeName(); + public static TypeName getInstance() + { + return typename; + } + + private TypeName() + { + add(0, "U"); + add(1, "T"); + } +} \ No newline at end of file diff --git a/org.tizen.sensor.accelerometer/.classpath b/org.tizen.sensor.accelerometer/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.sensor.accelerometer/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.sensor.accelerometer/.project b/org.tizen.sensor.accelerometer/.project new file mode 100644 index 0000000..8caeef0 --- /dev/null +++ b/org.tizen.sensor.accelerometer/.project @@ -0,0 +1,28 @@ + + + org.tizen.sensor.accelerometer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.sensor.accelerometer/.settings/org.eclipse.core.runtime.prefs b/org.tizen.sensor.accelerometer/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 0000000..2124634 --- /dev/null +++ b/org.tizen.sensor.accelerometer/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1,3 @@ +#Tue Dec 14 16:31:30 CET 2010 +eclipse.preferences.version=1 +line.separator=\n diff --git a/org.tizen.sensor.accelerometer/.settings/org.eclipse.jdt.core.prefs b/org.tizen.sensor.accelerometer/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1ab6cd2 --- /dev/null +++ b/org.tizen.sensor.accelerometer/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Thu Dec 02 13:13:49 KST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF b/org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF new file mode 100644 index 0000000..9a4ba5f --- /dev/null +++ b/org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Sensor Accelerometer +Bundle-SymbolicName: org.tizen.sensor.accelerometer;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Tizen +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.eclipse.ui;bundle-version="3.5.2", + org.tizen.injector, + org.tizen.common, + org.tizen.common.connection, + org.eclipse.core.runtime;bundle-version="3.7.0" diff --git a/org.tizen.sensor.accelerometer/build.properties b/org.tizen.sensor.accelerometer/build.properties new file mode 100644 index 0000000..e9863e2 --- /dev/null +++ b/org.tizen.sensor.accelerometer/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.tizen.sensor.accelerometer/plugin.xml b/org.tizen.sensor.accelerometer/plugin.xml new file mode 100644 index 0000000..6190104 --- /dev/null +++ b/org.tizen.sensor.accelerometer/plugin.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/Sensor.java b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/Sensor.java new file mode 100644 index 0000000..ae0cadb --- /dev/null +++ b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/Sensor.java @@ -0,0 +1,39 @@ +/* + * org.tizen.sensor.accelerometer + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.accelerometer; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.sensor.accelerometer.page.Accelerometer; + +public class Sensor extends AbstractInjectorItem { + + @Override + protected void addPages() { + addPage(new Accelerometer(this, "Accelerometer, Gyroscope, Geomagnetic")); + } +} diff --git a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/Accelerometer.java b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/Accelerometer.java new file mode 100644 index 0000000..1913722 --- /dev/null +++ b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/Accelerometer.java @@ -0,0 +1,688 @@ +/* + * org.tizen.sensor.accelerometer + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.accelerometer.page; + +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.text.DecimalFormat; + +import javax.swing.Timer; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.awt.SWT_AWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Slider; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; + +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; +import org.tizen.sensor.magnetic.Magnetic; +//import org.tizen.sensor.accelerometer.DebugLog; + +public class Accelerometer extends AbstractInjectorPage { + Slider yawSlider, pitchSlider, rollSlider; + int yawValue, pitchValue, rollValue; + double xValue, yValue, zValue; + Mode mode; + MobilePanel panel; + Button checkboxAccelerometer; + Button checkboxGyro; + Button checkboxGeoMagnetic; + Button checkboxOrientation; + private Text dataText; + Timer dataOutputTimer; + + double north; + double east; + double vertical; + + static double tmp_accel_x = 0.1, tmp_accel_y = 0.1, tmp_accel_z = 0.1; + static double tmp_gyro_x = 0.1, tmp_gyro_y = 0.1, tmp_gyro_z = 0.1; + static double tmp_geo_x = 0.1, tmp_geo_y = 0.1, tmp_geo_z = 0.1, tmp_geo_a = 0.1, tmp_geo_b = 0.1, tmp_geo_c = 0.1, tmp_geo_d = 0.1; + static boolean changed_accel = false; + static boolean changed_gyro = false; + static boolean changed_geo = false; + + static String accelerometerData; + static String magneticData; + static String gyroData; + + static boolean orientation_active = true; + static boolean button_click = false; + + public Accelerometer(AbstractInjectorItem item, String name) { + super(item, name); + north = 22874.1; + east = 5939.5; + vertical = 43180.5; + } + + private void init() { + yawValue = 0; + pitchValue = -90; + rollValue = 0; + } + + @Override + protected void createContents() { + init(); + Composite mainComposite = formUtil.createComposite(parent, 2); + // Create Mobile Composite to draw virtual mobile phone + Composite mobileComposite = formUtil.createComposite(mainComposite); + + GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true); + gd.widthHint = 260; + mobileComposite.setLayoutData(gd); + + // Create panel composite to contain JPanel component + Composite panelComposite = new Composite(mobileComposite, SWT.EMBEDDED | SWT.BORDER); + + panel = new MobilePanel(this); + Frame frame = SWT_AWT.new_Frame(panelComposite); + frame.add(panel); + frame.pack(); + gd = new GridData(GridData.CENTER, GridData.CENTER, false, true); + gd.widthHint = 200; + gd.heightHint = 200; + panelComposite.setLayoutData(gd); + + // Create composite containing moving type selection radio buttons + Composite radioComposite = formUtil.createComposite(mobileComposite, 3); + + Button button01 = formUtil.createButton(radioComposite, "Yaw/Pitch", SWT.RADIO); + button01.setSelection(true); + mode = Mode.YAW_PITCH; + button01.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + mode = Mode.YAW_PITCH; + super.widgetSelected(e); + } + }); + Button button02 = formUtil.createButton(radioComposite, "Roll/Pitch", SWT.RADIO); + button02.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + mode = Mode.ROLL_PITCH; + super.widgetSelected(e); + } + }); + Button button03 = formUtil.createButton(radioComposite, "Move", SWT.RADIO); + button03.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + mode = Mode.MOVE; + super.widgetSelected(e); + } + }); + + // Create text (data output) + + dataText = new Text(mobileComposite, SWT.MULTI | SWT.BORDER ); + gd = new GridData(GridData.FILL, GridData.CENTER, true, false); + dataText.setLayoutData(gd); + + dataOutputTimer = new Timer(200, new ActionListener() { + public void actionPerformed(ActionEvent evt) { + if (PlatformUI.isWorkbenchRunning() == false){ + return; + } + if( PlatformUI.getWorkbench().isClosing() == true){ + return; + } + + PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){ + @Override + public void run() { + DecimalFormat mf = new DecimalFormat("#0.00"); + Magnetic magnetic = Magnetic.getInstance(); + + if(changed_accel == true){ + if(checkboxAccelerometer.isDisposed()) + dataOutputTimer.stop(); + else if( checkboxAccelerometer.getSelection()){ + accelerometerData = "accelerometer : " + mf.format(panel.read_accelx) + ", "+ mf.format(panel.read_accely) + + ", "+ mf.format(panel.read_accelz); + } + else { + accelerometerData = "accelerometer : Disable"; + } + changed_accel = false; + } + if(changed_geo == true){ + if(checkboxGeoMagnetic.isDisposed()) + dataOutputTimer.stop(); + else if( checkboxGeoMagnetic.getSelection()) { + magneticData = "magnetic filed : " + mf.format(magnetic.getReadCompassX()) + + ", " + mf.format(magnetic.getReadCompassY()) + ", " + mf.format(magnetic.getReadCompassZ()) + "\n" + "orientation : " + mf.format(magnetic.getAzimuth()) + + ", " + mf.format(magnetic.getPitch()) + ", " + mf.format(magnetic.getRoll()); + } + else { + magneticData = "magnetic : Disable"; + } + changed_geo = false; + } + if(changed_gyro == true){ + if(checkboxGyro.isDisposed()) + dataOutputTimer.stop(); + else if( checkboxGyro.getSelection()) { + gyroData = "gyroscope : " + mf.format(panel.gyroPitch) + ", " + mf.format(panel.gyroRoll) + ", " + mf.format(panel.gyroYaw); + } + else { + gyroData = "gyroscope : Disable"; + } + changed_gyro = false; + } + if(dataText.isDisposed()) + dataOutputTimer.stop(); + else + dataText.setText(accelerometerData + "\n" + magneticData + "\n" + gyroData); + } + }); + } + }); + dataOutputTimer.setCoalesce(true); + + // Create slider composite to add Yaw/Pitch/Roll sliders + Composite sliderComposite = formUtil.createComposite(mainComposite, 2); + + formUtil.createLabel(sliderComposite, "Pitch"); + pitchSlider = formUtil.createSlider(sliderComposite); + setDefaultSlider(pitchSlider); + pitchValue = (int) panel.pitchDegree; + pitchSlider.setSelection((int) panel.pitchDegree + 180); + pitchSlider.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO : Fix here + pitchValue = pitchSlider.getSelection() - 180; + panel.pitchDegree = pitchValue; + panel.repaint(); + + sendMessage(panel.read_accelx, panel.read_accely, panel.read_accelz); + + super.widgetSelected(e); + } + }); + pitchSlider.addMouseListener(new MouseAdapter(){ + public void mouseUp(MouseEvent e) { + ((MobilePanel)panel).phone_pos_conv = true; + } + }); + + formUtil.createLabel(sliderComposite, "Roll"); + rollSlider = formUtil.createSlider(sliderComposite); + setDefaultSlider(rollSlider); + rollValue = (int) panel.rollDegree; + rollSlider.setSelection((int) panel.rollDegree + 180); + rollSlider.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO : Fix here + rollValue = rollSlider.getSelection() - 180; + panel.rollDegree = rollValue; + panel.repaint(); + + sendMessage(panel.read_accelx, panel.read_accely, panel.read_accelz); + + super.widgetSelected(e); + } + }); + rollSlider.addMouseListener(new MouseAdapter(){ + public void mouseUp(MouseEvent e) { + ((MobilePanel)panel).phone_pos_conv = true; + } + }); + + formUtil.createLabel(sliderComposite, "Yaw"); + yawSlider = formUtil.createSlider(sliderComposite); + setDefaultSlider(yawSlider); + yawValue = (int) panel.yawDegree; + yawSlider.setSelection((int) panel.yawDegree + 180); + yawSlider.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + // TODO : Fix here + yawValue = yawSlider.getSelection() - 180; + panel.yawDegree = yawValue; + panel.repaint(); + sendMessage(panel.read_accelx, panel.read_accely, panel.read_accelz); + super.widgetSelected(e); + } + }); + yawSlider.addMouseListener(new MouseAdapter(){ + public void mouseUp(MouseEvent e) { + ((MobilePanel)panel).phone_pos_conv = true; + } + }); + + // Create rotation button + Composite rotationComposite = formUtil.createComposite(sliderComposite, 4); + gd = new GridData(GridData.FILL, GridData.FILL, true, false); + gd.horizontalSpan = 2; + rotationComposite.setLayoutData(gd); + createRotationButton(rotationComposite); + + + // Create checkbox (Enable sensor) + Composite checkboxComposite = formUtil.createComposite(sliderComposite, 2); + GridData cbGd = new GridData(GridData.FILL, GridData.FILL, true, false); + cbGd.horizontalSpan = 2; + checkboxComposite.setLayoutData(cbGd); + checkboxAccelerometer = formUtil.createButton(checkboxComposite, "Accelerometer sensor", SWT.CHECK); + checkboxGeoMagnetic = formUtil.createButton(checkboxComposite, "Geomagnetic sensor", SWT.CHECK); + checkboxGyro = formUtil.createButton(checkboxComposite, "Gyroscope sensor", SWT.CHECK); + checkboxOrientation = formUtil.createButton(checkboxComposite, "Orientation sensor", SWT.CHECK); + checkboxAccelerometer.setSelection(true); + checkboxGeoMagnetic.setSelection(true); + checkboxGyro.setSelection(true); + checkboxOrientation.setSelection(true); + checkboxAccelerometer.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + panel.accelerometerTimer(checkboxAccelerometer.getSelection()); + if(!checkboxAccelerometer.getSelection()) + { + checkboxOrientation.setSelection(false); + orientation_active = false; + } + super.widgetSelected(e); + } + + }); + checkboxGeoMagnetic.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + panel.geomagneticTimer(checkboxGeoMagnetic.getSelection()); + if(!checkboxGeoMagnetic.getSelection()) + { + checkboxOrientation.setSelection(false); + orientation_active = false; + } + super.widgetSelected(e); + } + }); + checkboxGyro.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + panel.gyroTimer(checkboxGyro.getSelection()); + super.widgetSelected(e); + } + }); + checkboxOrientation.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + if(checkboxOrientation.getSelection()) + { + checkboxAccelerometer.setSelection(true); + panel.accelerometerTimer(checkboxAccelerometer.getSelection()); + checkboxGeoMagnetic.setSelection(true); + panel.geomagneticTimer(checkboxGeoMagnetic.getSelection()); + orientation_active = true; + } + else + orientation_active = false; + super.widgetSelected(e); + } + }); + + //panel.ConnectionChanged(); + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + panel.connect(); + } + } + + private boolean checkDeviceConnectedAlready() { + if (panel.currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + private void createRotationButton( Composite rotationComposite){ + Button rotation0 = formUtil.createButton(rotationComposite, "Portrait", SWT.PUSH); + Button rotation90 = formUtil.createButton(rotationComposite, "Landscape", SWT.PUSH); + Button rotation180 = formUtil.createButton(rotationComposite, "Reverse Portrait", SWT.PUSH); + Button rotation270 = formUtil.createButton(rotationComposite, "Reverse Landscape", SWT.PUSH); + rotation0.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + + } + @Override + public void widgetSelected(SelectionEvent e) { + button_click = true; + double axisX[] = {1,0,0}; + double axisY[] = {0,0,1}; + double axisZ[] = {0,-1,0}; + panel.setGyroAxisX(axisX); + panel.setGyroAxisY(axisY); + panel.setGyroAxisZ(axisZ); + panel.repaint(); + } + }); + rotation90.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + button_click = true; + double axisX[] = {0,0,1}; + double axisY[] = {-1,0,0}; + double axisZ[] = {0,-1,0}; + panel.setGyroAxisX(axisX); + panel.setGyroAxisY(axisY); + panel.setGyroAxisZ(axisZ); + panel.repaint(); + } + }); + rotation180.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + + } + @Override + public void widgetSelected(SelectionEvent e) { + button_click = true; + double axisX[] = {-1,0,0}; + double axisY[] = {0,0,-1}; + double axisZ[] = {0,-1,0}; + panel.setGyroAxisX(axisX); + panel.setGyroAxisY(axisY); + panel.setGyroAxisZ(axisZ); + panel.repaint(); + } + }); + rotation270.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + + } + @Override + public void widgetSelected(SelectionEvent e) { + button_click = true; + double axisX[] = {0,0,-1}; + double axisY[] = {1,0,0}; + double axisZ[] = {0,-1,0}; + panel.setGyroAxisX(axisX); + panel.setGyroAxisY(axisY); + panel.setGyroAxisZ(axisZ); + panel.repaint(); + } + }); + } + + private void createMagenticInput( Composite magneticSection){ + Composite magneticComposite = formUtil.createComposite(magneticSection, 3); + formUtil.createLabel(magneticComposite, "North : "); + Text northText = formUtil.createText(magneticComposite, String.valueOf(north)); + northText.setTextLimit(10); + formUtil.createLabel(magneticComposite, "nT"); + formUtil.createLabel(magneticComposite, "East : "); + Text eastText = formUtil.createText(magneticComposite, String.valueOf(east)); + eastText.setTextLimit(10); + formUtil.createLabel(magneticComposite, "nT"); + formUtil.createLabel(magneticComposite, "Vertical : "); + Text verticalText = formUtil.createText(magneticComposite, String.valueOf(vertical)); + verticalText.setTextLimit(10); + formUtil.createLabel(magneticComposite, "nT"); + northText.addModifyListener(new ModifyListener(){ + @Override + public void modifyText(ModifyEvent e) { + try{ + north = Double.parseDouble(((Text)e.widget).getText()); + } + catch (NumberFormatException nfe) { + int caret = ((Text)e.widget).getCaretPosition(); + ((Text)e.widget).setText(String.valueOf(north)); + ((Text)e.widget).setSelection(caret-1, caret-1); + } + } + }); + eastText.addModifyListener(new ModifyListener(){ + @Override + public void modifyText(ModifyEvent e) { + try{ + east = Double.parseDouble(((Text)e.widget).getText()); + } + catch (NumberFormatException nfe) { + int caret = ((Text)e.widget).getCaretPosition(); + ((Text)e.widget).setText(String.valueOf(east)); + ((Text)e.widget).setSelection(caret-1, caret-1); + System.out.println(caret); + } + } + }); + verticalText.addModifyListener(new ModifyListener(){ + @Override + public void modifyText(ModifyEvent e) { + try{ + vertical = Double.parseDouble(((Text)e.widget).getText()); + } + catch (NumberFormatException nfe) { + int caret = ((Text)e.widget).getCaretPosition(); + ((Text)e.widget).setText(String.valueOf(vertical)); + ((Text)e.widget).setSelection(caret-1, caret-1); + } + } + }); + } + + private void setDefaultSlider(Slider slider) { + slider.setMinimum(0); + slider.setMaximum(361); + slider.setIncrement(1); + slider.setThumb(1); + } + + public int getYawSliderValue() { + return yawValue; + } + + public void setYawSliderValue(int value) { + yawValue = value; + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI + .getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + + shell.getDisplay().asyncExec(new Runnable() { + + @Override + public void run() { + yawSlider.setSelection(yawValue + 180); + } + }); + } + + public int getPitchSliderValue() { + return pitchValue; + } + + public void setPitchSliderValue(int value) { + pitchValue = value; + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI + .getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + + shell.getDisplay().asyncExec(new Runnable() { + + @Override + public void run() { + pitchSlider.setSelection(pitchValue + 180); + } + }); + } + + public int getRollSliderValue() { + return rollValue; + } + + public void setRollSliderValue(int value) { + rollValue = value; + + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + if (window == null) { + IWorkbenchWindow windows[] = PlatformUI + .getWorkbench().getWorkbenchWindows(); + window = windows[0]; + } + + final Shell shell = window.getShell(); + + shell.getDisplay().asyncExec(new Runnable() { + + @Override + public void run() { + rollSlider.setSelection(rollValue + 180); + } + }); + } + + public void sendMessage(double x, double y, double z) { + TestSensorMessage msg = new TestSensorMessage(x, y, z); + + try { + // sensorSocket.send(msg.getMessage()); + injectorSocket.sendSensor(msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + public void sendMessage(String sensorNumber, double x, double y, double z) { + if(sensorNumber == "1\n") // accel + { + if(button_click == true || tmp_accel_x != x || tmp_accel_y != y || tmp_accel_z != z) + { + TestSensorMessage msg = new TestSensorMessage(x, y, z); + + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + tmp_accel_x = x; + tmp_accel_y = y; + tmp_accel_z = z; + button_click = false; + changed_accel = true; + } + } + else if(sensorNumber == "4\n") // gyro + { + if(tmp_gyro_x != x || tmp_gyro_y != y || tmp_gyro_z != z) + { + TestSensorMessage msg = new TestSensorMessage(x, y, z); + + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + tmp_gyro_x = x; + tmp_gyro_y = y; + tmp_gyro_z = z; + changed_gyro = true; + } + } + } + public void sendMessage(String sensorNumber, double x, double y, double z, double a, double b, double c, double d) { + if(sensorNumber == "5\n") + { + if(tmp_geo_x != x || tmp_geo_y != y || tmp_geo_z != z || tmp_geo_a != a || tmp_geo_b != b || tmp_geo_c != c || tmp_geo_d != d) + { + TestSensorMessage msg = new TestSensorMessage(x, y, z, a, b, c, d); + + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + tmp_geo_x = x; // azimuth + tmp_geo_y = y; + tmp_geo_z = z; + tmp_geo_a = a; // accuracy + tmp_geo_b = b; // tesla x + tmp_geo_c = c; // tesla y + tmp_geo_d = d; // tesla z + changed_geo = true; + } + } + } + + public Mode getMode() { + return mode; + } + + public enum Mode { + YAW_PITCH, ROLL_PITCH, MOVE + }; +} diff --git a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/MobilePanel.java b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/MobilePanel.java new file mode 100644 index 0000000..6c40abc --- /dev/null +++ b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/MobilePanel.java @@ -0,0 +1,925 @@ +package org.tizen.sensor.accelerometer.page; + +/* + * Copyright (C) 2008 OpenIntents.org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * 09/Apr/08 Dale Thatcher + * Added wii-mote data collection. + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionListener; +import java.awt.geom.Line2D; + +import javax.swing.JPanel; +import javax.swing.Timer; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.sensor.accelerometer.page.Accelerometer.Mode; +import org.tizen.sensor.magnetic.Magnetic; + +/** + * Displays a mobile phone in a panel and calculates sensor physics. + * + * @author Peli + * + */ +@SuppressWarnings("serial") +public class MobilePanel extends JPanel implements ISelectionListener { + + Accelerometer mPage; + /** + * Reference to SensorSimulator for accessing widgets. + */ + + /** + * Current read-out value of accelerometer x-component. + * + * This value is updated only at the desired + * updateSensorRate(). + */ + double read_accelx; + /** Current read-out value of accelerometer y-component. */ + double read_accely; + /** Current read-out value of accelerometer z-component. */ + double read_accelz; + + /** Current read-out value of orientation yaw. */ + double read_yaw; + /** Current read-out value of orientation pitch. */ + double read_pitch; + /** Current read-out value of orientation roll. */ + double read_roll; + + /** Current read-out value of temperature. */ + double read_temperature; + + /** Duration (in milliseconds) between two updates. + * This is the inverse of the update rate. + */ + long accel_update_duration; + + /** Time of next update required. + * The time is compared to System.currentTimeMillis(). + */ + long accel_next_update; + + /** Duration (in milliseconds) between two updates. + * This is the inverse of the update rate. + */ + long orientation_update_duration; + + /** Time of next update required. + * The time is compared to System.currentTimeMillis(). + */ + long orientation_next_update; + + /** Duration in milliseconds until user setting + * changes are read out. + */ + long user_settings_duration; + + /** Time of next update for reading user settings from widgets. + * The time is compared to System.currentTimeMillis(). + */ + long user_settings_next_update; + + /** + * Partial read-out value of accelerometer x-component. + * + * This partial value is used to calculate the + * sensor average. + */ + double partial_accelx; + /** Partial read-out value of accelerometer y-component. */ + double partial_accely; + /** Partial read-out value of accelerometer z-component. */ + double partial_accelz; + /** Number of summands in partial sum for accelerometer. */ + int partial_accel_n; + /** Whether to form the average over the last duration when reading out sensors. + * Alternative is to just take the current value. + */ + boolean average_accel; + + /** Partial read-out value of orientation yaw. */ + double partial_yaw; + /** Partial read-out value of orientation pitch. */ + double partial_pitch; + /** Partial read-out value of orientation roll. */ + double partial_roll; + /** Number of summands in partial sum for orientation. */ + int partial_orientation_n; + /** Whether to form the average over the last duration when reading out sensors. + * Alternative is to just take the current value. + */ + boolean average_orientation; + + /** Internal state value of accelerometer x-component. + * + * This value is updated regularly by updateSensorPhysics(). + */ + double accelx; + /** Internal state value of accelerometer x-component. */ + double accely; + /** Internal state value of accelerometer x-component. */ + double accelz; + + // orientation (in degree) + double yaw; + double pitch; + double roll; + + // orientation sensor raw data (in degree) + double yawDegree; + double pitchDegree; + double rollDegree; + + /** Current position on screen. */ + int movex; + /** Current position on screen. */ + int movez; + + int oldx; + int oldz; + double vx; // velocity + double vz; + double oldvx; + double oldvz; + double ax; // acceleration + double az; + + double Fx; // force + double Fz; // force + double accx; // accelerometer position x on screen + double accz; // (DONT confuse with acceleration a!) + + /** Spring constant. */ + double k; // spring constant + + /** Mass of accelerometer test particle. + * + * This is set to 1, as only the ratio + * k/m enters the simulation. */ + double m; // mass of accelerometer test particle + + /** Damping constant. */ + double gamma; // damping of spring + + double dt; // time step size + + /** Inverse of screen pixel per meter */ + double meterperpixel; + + /** Gravity constant. + * + * This takes the value 9.8 m/s^2. + * */ + double g; + + /** 1/g (g-inverse) */ + double ginverse; + + int mousedownx; + int mousedowny; + int mousedownyaw; + int mousedownpitch; + int mousedownroll; + int mousedownmovex; + int mousedownmovez; + + //gyro + boolean gyroStart; + Vector old_vector_yz; + Vector old_vector_xz; + double old_gyroYaw; + double old_gyroPitch; + double old_gyroRoll; + int gyroYawCount; + int gyroPitchCount; + int gyroRollCount; + + private double old_gyro_rollDegree = 0; + private double old_gyro_pitchDegree = 0; + private double old_gyro_yawDegree = 0; + private double[] gyro_axisX; + private double[] gyro_axisY; + private double[] gyro_axisZ; + + double gyroYaw; + double gyroPitch; + double gyroRoll; + + final String accelerometerSensorNumber = "1\n"; + final String gyroSensorNumber = "4\n"; + public boolean phone_pos_conv = false; + public IDevice currentDevice; + + /* + * http://code.google.com/android/reference/android/hardware/Sensors.html + * + * With the device lying flat on a horizontal surface in front of the user, + * oriented so the screen is readable by the user in the normal fashion, + * the X axis goes from left to right, the Y axis goes from the user + * toward the device, and the Z axis goes upwards perpendicular to the + * surface. + */ + // Mobile size + final double sx = 15; // size x + final double sy = 40; // size y + final double sz = 5; // size z + + // Display size + final double dx = 12; // size x + final double dy1 = 33; // size y + final double dy2 = -15; + + /** Contains the grid model of the phone. */ + double[][] phone = { + // bottom shape + { sx, sy, -sz}, {-sx, sy, -sz}, + {-sx, sy, -sz}, {-sx,-sy, -sz}, + {-sx,-sy, -sz}, { sx,-sy, -sz}, + { sx,-sy, -sz}, { sx, sy, -sz}, + // top shape + { sx, sy, sz}, {-sx, sy, sz}, + {-sx, sy, sz}, {-sx,-sy, sz}, + {-sx,-sy, sz}, { sx,-sy, sz}, + { sx,-sy, sz}, { sx, sy, sz}, + // connectint top and bottom + { sx, sy, -sz}, { sx, sy, sz}, + {-sx, sy, -sz}, {-sx, sy, sz}, + {-sx,-sy, -sz}, {-sx,-sy, sz}, + { sx,-sy, -sz}, { sx,-sy, sz}, + // display + { dx, dy1, sz}, {-dx, dy1, sz}, + {-dx, dy1, sz}, {-dx, dy2, sz}, + {-dx, dy2, sz}, { dx, dy2, sz}, + { dx, dy2, sz}, { dx, dy1, sz}, + }; + private Timer timer; + private Timer geomagneticTimer; + private Timer gyroTimer; + private Timer orientationTimer; + private boolean connected = false; + + public MobilePanel(Accelerometer page) { + ConnectionPlugin.getDefault().addSelectionListener(this); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); +// TargetConnectionControl.addTargetConnectionListener(this); + + mPage = page; + + yawDegree = 0; + pitchDegree = 0; + rollDegree = 0; + + gyroYawCount = 0; + gyroPitchCount = 0; + gyroRollCount = 0; + gyroStart = false; + + gyro_axisX = Vector.getAxisX().clone(); + gyro_axisY = Vector.getAxisY().clone(); + gyro_axisZ = Vector.getAxisZ().clone(); + + movex = 0; + movez = 0; + oldx = 0; + oldz = 0; + oldvx = 0; + oldvz = 0; + + Fx = 0; + Fz = 0; + accx = 0; + accz = 0; + k = 500; // spring constant + m = 1; // mass + gamma = 50; // damping + + dt = 0.1; + meterperpixel = 1/3000.; // meter per pixel + g = 9.80665; // meter per second^2 + ginverse = 1 / g; + + user_settings_duration = 500; // Update every half second. This should be enough. + user_settings_next_update = System.currentTimeMillis(); // First update is now. + + addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + mousedownx = e.getX(); + mousedowny = e.getY(); + mousedownyaw = mPage.getYawSliderValue(); + mousedownpitch = mPage.getPitchSliderValue(); + mousedownroll = mPage.getRollSliderValue(); + mousedownmovex = movex; + mousedownmovez = movez; + } + public void mouseReleased(MouseEvent e){ + phone_pos_conv = true; + } + }); + + + + addMouseMotionListener(new MouseMotionListener() { + public void mouseDragged(MouseEvent e) { + if (mPage.getMode() == Mode.YAW_PITCH) { + // Control yawDegree + int newyaw = mousedownyaw - (e.getX() - mousedownx); + while (newyaw > 180) { + newyaw -= 360; + gyroYawCount++; + } + while (newyaw < -180) { + newyaw += 360; + gyroYawCount--; + } + mPage.setYawSliderValue((int) newyaw); + yawDegree = newyaw; + + // Control pitch + int newpitch = mousedownpitch - (e.getY() - mousedowny); + while (newpitch > 180) { + newpitch -= 360; + gyroPitchCount++; + } + while (newpitch < -180) { + newpitch += 360; + gyroPitchCount--; + } + mPage.setPitchSliderValue((int) newpitch); + pitchDegree = newpitch; + } else if (mPage.getMode() == Mode.ROLL_PITCH) { + int newroll = mousedownroll + (e.getX() - mousedownx); + while (newroll > 180) { + newroll -= 360; + gyroRollCount++; + } + while (newroll < -180) { + newroll += 360; + gyroRollCount--; + } + mPage.setRollSliderValue((int) newroll); + rollDegree = newroll; + + // Control pitch + int newpitch = mousedownpitch - (e.getY() - mousedowny); + while (newpitch > 180) { + newpitch -= 360; + gyroPitchCount++; + } + while (newpitch < -180) { + newpitch += 360; + gyroPitchCount--; + } + mPage.setPitchSliderValue((int) newpitch); + pitchDegree = newpitch; + } else if (mPage.getMode() == Mode.MOVE) { + // Control roll + int newmovex = mousedownmovex + (e.getX() - mousedownx); + movex = newmovex; + + // Control pitch + int newmovez = mousedownmovez - (e.getY() - mousedowny); + movez = newmovez; + } + + repaint(); + } + + public void mouseMoved(MouseEvent evt) { + // NOOP + } + }); + + int delay = 200; + timer = new Timer(delay, new ActionListener() { + public void actionPerformed(ActionEvent evt) { + updateSensorPhysics(); + updateSensorReadoutValues(); + updateUserSettings(); + + mPage.sendMessage(accelerometerSensorNumber, read_accelx, read_accely, read_accelz); + + } + }); + geomagneticTimer = new Timer(delay, new ActionListener(){ + public void actionPerformed(ActionEvent arg0) { + Magnetic magnetic = Magnetic.getInstance(); + magnetic.setMagneticFiled(mPage.north, mPage.east, mPage.vertical); + magnetic.updateSensorPhysics(rollDegree, pitchDegree, yawDegree); + magnetic.updateSensorReadoutValues(); + magnetic.updateUserSettings(); + if(Accelerometer.orientation_active) + magnetic.setOrient(read_accelx, read_accely, read_accelz); + + mPage.sendMessage(Magnetic.sensorNumber, magnetic.getAzimuth(), magnetic.getPitch(), magnetic.getRoll() , 4, magnetic.getReadCompassX(), magnetic.getReadCompassY(), magnetic.getReadCompassZ()); + } + }); + gyroTimer = new Timer(delay, new ActionListener(){ + public void actionPerformed(ActionEvent arg0) { + updateSensorGyro(); + mPage.sendMessage(gyroSensorNumber, gyroPitch, gyroRoll, gyroYaw); + } + }); + + timer.setCoalesce(true); + geomagneticTimer.setCoalesce(true); + gyroTimer.setCoalesce(true); + } + +private void updateSensorGyro(){ + + if( gyroStart == false){ + old_gyroYaw = yawDegree; + old_gyroPitch = pitchDegree; + old_gyroRoll = rollDegree; + gyroStart = true; + return; + } + + gyroRoll = gyroRollCount * 360 + rollDegree - old_gyroRoll; + gyroPitch = gyroPitchCount * 360 + pitchDegree - old_gyroPitch; + gyroYaw = gyroYawCount * 360 + yawDegree - old_gyroYaw; + + gyroYawCount = 0; + gyroPitchCount = 0; + gyroRollCount = 0; + + old_gyroRoll = rollDegree; + old_gyroPitch = pitchDegree; + old_gyroYaw = yawDegree; + while( gyroRoll > 2000) gyroRoll-=360; + while( gyroRoll < -2000) gyroRoll+=360; + while( gyroPitch > 2000) gyroPitch-=360; + while( gyroPitch < -2000) gyroPitch+=360; + while( gyroYaw > 2000) gyroYaw-=360; + while( gyroYaw < -2000) gyroYaw+=360; + } + + /** + * Updates physical model of all sensors by minimum time-step. + * + * This internal update provides the close-to-continuum + * description of the sensors. + * It does not yet provide the values that + * are read out by the Sensors class (which are + * obtained by further time-selection or averaging). + */ + public void updateSensorPhysics() { + Vector vec; + + dt = 0.001 * 10; + g = 9.80665; + if (g != 0) { + ginverse = 1 / g; + } + k = 500; + gamma = 50; + + Fx = + k * (movex - accx); + Fz = + k * (movez - accz); + + ax = Fx / m; + az = Fz / m; + + vx += (ax) * dt; + vz += (az) * dt; + + accx += vx * dt; + accz += vz * dt; + + // We put damping here: We don't want to damp for + // zero motion with respect to the background, + // but with respect to the mobile phone: + accx += gamma * (movex - accx) * dt; + accz += gamma * (movez - accz) * dt; + + // Calculate acceleration by gravity: + // TODO: Make to be able to set by settings page + double gravityax = 0; + double gravityay = 0; + double gravityaz = -9.80665; + + //// + // Now calculate this into mobile phone acceleration: + // ! Mobile phone's acceleration is just opposite to + // lab frame acceleration ! + vec = new Vector(-ax * meterperpixel + gravityax, gravityay, -az * meterperpixel + gravityaz); + + // we reverse roll, pitch, and yawDegree, + // as this is how the mobile phone sees the coordinate system. + vec.reverserollpitchyaw(); + + // TODO: Add check condition to figure out selected sensors +// if (mSensorSimulator.mEnabledAccelerometer.isSelected()) { + accelx = vec.x; + accely = vec.y; + accelz = vec.z; + + // Add accelerometer limit: + double limit = g * 10; + if (limit > 0) { + // limit on each component separately, as each is + // a separate sensor. + if (accelx > limit) accelx = limit; + if (accelx < -limit) accelx = -limit; + if (accely > limit) accely = limit; + if (accely < -limit) accely = -limit; + if (accelz > limit) accelz = limit; + if (accelz < -limit) accelz = -limit; + } +// } else { +// accelx = 0; +// accely = 0; +// accelz = 0; +// } + + // Orientation is currently not affected: +// if (mSensorSimulator.mEnabledOrientation.isSelected()) { + //yaw = Math.toRadians(yawDegree); + //pitch = Math.toRadians(pitchDegree); + //roll = Math.toRadians(rollDegree); + // Since OpenGL uses degree as input, + // and it seems also more user-friendly, + // let us stick to degree. + // (it seems, professional sensors also use + // degree output.) + yaw = yawDegree; + pitch = pitchDegree; + roll = rollDegree; +// } else { +// yaw = 0; +// pitch = 0; +// roll = 0; +// } + + // TODO: Add check condition for showing acceleration bar +// if (mSensorSimulator.mShowAcceleration.isSelected()) { + // We only have to repaint if we show the acceleration, + // otherwise the phone does not change as long as there is + // no user interaction. + repaint(); +// }; + + } + + /** + * Updates sensor values in time intervals as specified by updateSensorRate(). + */ + public void updateSensorReadoutValues() { + long currentTime = System.currentTimeMillis(); + + // From time to time we + + if (average_accel) { + // Form the average + partial_accelx += accelx; + partial_accely += accely; + partial_accelz += accelz; + partial_accel_n++; + } + + if (average_orientation) { + // Form the average + partial_yaw += yaw; + partial_pitch += pitch; + partial_roll += roll; + partial_orientation_n++; + } + + if (currentTime >= accel_next_update) { + // Update + accel_next_update += accel_update_duration; + if (accel_next_update < currentTime) { + // Don't lag too much behind. + // If we are too slow, then we are too slow. + accel_next_update = currentTime; + } + + if (average_accel) { + // form average + read_accelx = partial_accelx / partial_accel_n; + read_accely = partial_accely / partial_accel_n; + read_accelz = partial_accelz / partial_accel_n; + + // reset average + partial_accelx = 0; + partial_accely = 0; + partial_accelz = 0; + partial_accel_n = 0; + + } else { + // Only take current value + read_accelx = accelx; + read_accely = accely; + read_accelz = accelz; + } + + } + + if (currentTime >= orientation_next_update) { + // Update + orientation_next_update += orientation_update_duration; + if (orientation_next_update < currentTime) { + // Don't lag too much behind. + // If we are too slow, then we are too slow. + orientation_next_update = currentTime; + } + + if (average_orientation) { + // form average + read_yaw = partial_yaw / partial_orientation_n; + read_pitch = partial_pitch / partial_orientation_n; + read_roll = partial_roll / partial_orientation_n; + + // reset average + partial_yaw = 0; + partial_pitch = 0; + partial_roll = 0; + partial_orientation_n = 0; + + } else { + // Only take current value + read_yaw = yaw; + read_pitch = pitch; + read_roll = roll; + } + + // Normalize values: + + // Restrict pitch value to -90 to +90 + if (read_pitch < -90) { + read_pitch = -180 - read_pitch; + read_yaw += 180; + read_roll += 180; + } else if (read_pitch > 90) { + read_pitch = 180 - read_pitch; + read_yaw += 180; + read_roll += 180; + + } + + // yaw from 0 to 360 + if (read_yaw < 0) { + read_yaw = read_yaw + 360; + } + if (read_yaw >= 360) { + read_yaw -= 360; + } + + // roll from -180 to + 180 + if (read_roll >= 180) { + read_roll -= 360; + } + + } + } + + /** + * Updates user settings by reading out the widgets. + * This is done after some duration + * set by user_settings_duration. + */ + public void updateUserSettings() { + long currentTime = System.currentTimeMillis(); + double rate; + + // From time to time we get the user settings: + if (currentTime >= user_settings_next_update) { + // Do update + user_settings_next_update += user_settings_duration; + if (user_settings_next_update < currentTime) { + // Skip time if we are already behind: + user_settings_next_update = System.currentTimeMillis(); + } + + average_accel = true; + rate = 50; + if (rate != 0) { + accel_update_duration = (long) (1000. / rate); + } else { + accel_update_duration = 0; + } + + average_orientation = true; + rate = 50; + if (rate != 0) { + orientation_update_duration = (long) (1000. / rate); + } else { + orientation_update_duration = 0; + } + } + } + + public Dimension getPreferredSize() { + return new Dimension(250,200); + } + + /** + * yaws a vector (rotate around z-axis) + */ + + /** + * Draws the phone. + */ + protected void paintComponent(Graphics graphics) { + super.paintComponent(graphics); + // g.drawString("This is my custom Panel!",(int)yawDegree,(int)pitch); + + Graphics2D g2 = (Graphics2D) graphics; + // draw Line2D.Double + + double centerx = 100; + double centery = 100; + double centerz = -150; + double draw_roll = old_gyro_rollDegree - rollDegree; + double draw_pitch = old_gyro_pitchDegree-pitchDegree; + double draw_yaw = old_gyro_yawDegree-yawDegree; + + for (int i=0; i positive as defined in SDK. + double cos = Math.cos(pitchRad); + double sin = Math.sin(pitchRad); + x = v.x; + y = cos * v.y + sin * v.z; + z = -sin * v.y + cos * v.z; + } + + public void roll(double roll) { + Vector v = new Vector(this); // temporary vector + double rollRad = Math.toRadians(roll); + double cos = Math.cos(rollRad); + double sin = Math.sin(rollRad); + x = cos * v.x + sin * v.z; + y = v.y; + z = -sin * v.x + cos * v.z; + } + + public static double[] getAxisX(){ + return axisX; + } + public static double[] getAxisY(){ + return axisY; + } + public static double[] getAxisZ(){ + return axisZ; + } + public void setAxisX(double[] axis){ + axisX[0] = axis[0]; + axisX[1] = axis[1]; + axisX[2] = axis[2]; + } + public void setAxisY(double[] axis){ + axisY[0] = axis[0]; + axisY[1] = axis[1]; + axisY[2] = axis[2]; + } + public void setAxisZ(double[] axis){ + axisZ[0] = axis[0]; + axisZ[1] = axis[1]; + axisZ[2] = axis[2]; + } + + public double[][] getRotationMatrix(){ + double ret_val[][] = + { {axisX[0], axisX[1], axisX[2], 0}, + {axisY[0], axisY[1], axisY[2], 0}, + {axisZ[0], axisZ[1], axisZ[2], 0}, + {0, 0, 0, 1} + }; + + return ret_val; + } + public double[][] getReverseMatrix(double[][] matrix){ + double ret_val[][] = new double[4][4]; + for( int i = 0 ; i < 4 ; i++){ + for( int j = 0 ; j < 4 ; j++){ + ret_val[i][j] = matrix[j][i]; + } + } + + return ret_val; + } + + public void changeAxisRoll( double angle, double[] axisX, double[] axisZ){ + double orignalMatrix[][] = getRotationMatrix(); + double reverseMatrix[][] = getReverseMatrix(orignalMatrix); + + double Rad = Math.toRadians(angle); + double cos = Math.cos(Rad); + double sin = Math.sin(Rad); + + axisX[0] = cos * 1 + sin * 0; + axisX[1] = 0; + axisX[2] = -sin * 1 + cos * 0; + trasnAxis(axisX, reverseMatrix); + + axisZ[0] = cos * 0 + sin * 1; + axisZ[1] = 0; + axisZ[2] = -sin * 0 + cos * 1; + trasnAxis(axisZ, reverseMatrix); + } + public void changeAxisPitch( double angle, double[] axisY, double[] axisZ){ + double orignalMatrix[][] = getRotationMatrix(); + double reverseMatrix[][] = getReverseMatrix(orignalMatrix); + + double Rad = Math.toRadians(angle); + double cos = Math.cos(Rad); + double sin = Math.sin(Rad); + + axisY[0] = 0; + axisY[1] = cos * 1 + sin * 0; + axisY[2] = -sin * 1 + cos * 0; + trasnAxis(axisY, reverseMatrix); + + axisZ[0] = 0; + axisZ[1] = cos * 0 + sin * 1; + axisZ[2] = -sin * 0 + cos * 1; + trasnAxis(axisZ, reverseMatrix); + } + public void changeAxisYaw( double angle, double[] axisX, double[] axisY){ + double orignalMatrix[][] = getRotationMatrix(); + double reverseMatrix[][] = getReverseMatrix(orignalMatrix); + + double Rad = Math.toRadians(angle); + double cos = Math.cos(Rad); + double sin = Math.sin(Rad); + + axisX[0] = cos * 1 + sin * 0; + axisX[1] = -sin * 1 + cos * 0; + axisX[2] = 0; + trasnAxis(axisX, reverseMatrix); + + axisY[0] = cos * 0 + sin * 1; + axisY[1] = -sin * 0 + cos * 1; + axisY[2] = 0; + trasnAxis(axisY, reverseMatrix); + } + public void trasnAxis( double[] axis, double[][] matrix){ + double[] temp_pos = {0,0,0,0}; + for( int i = 0 ; i < 4 ; i++){ + temp_pos[i] = matrix[i][0] * axis[0] + matrix[i][1] * axis[1] + matrix[i][2] * axis[2]; + } + + axis[0] = temp_pos[0]; + axis[1] = temp_pos[1]; + axis[2] = temp_pos[2]; + } + public void transVector( double[][] matrix){ + double[] temp_pos = {0,0,0,0}; + for( int i = 0 ; i < 4 ; i++){ + temp_pos[i] = matrix[i][0] * x + matrix[i][1] * y + matrix[i][2] * z; + } + + x = temp_pos[0]; + y = temp_pos[1]; + z = temp_pos[2]; + } + public void setPosition(){ + double[][] rotationMatrix = getRotationMatrix(); + double[][] reverseMatrix = getReverseMatrix(rotationMatrix); + transVector(reverseMatrix); + } + + public void rollpitchyaw(double roll, double pitch, double yaw) { + changeAxisRoll(roll, axisX, axisZ); + changeAxisPitch(pitch, axisY, axisZ); + changeAxisYaw(yaw, axisX, axisY); + } + + + public void reverserollpitchyaw() { + double[][] rotationMatrix = getRotationMatrix(); + transVector(rotationMatrix); + } +} diff --git a/org.tizen.sensor.accelerometer/src/org/tizen/sensor/magnetic/Magnetic.java b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/magnetic/Magnetic.java new file mode 100644 index 0000000..b0a30c9 --- /dev/null +++ b/org.tizen.sensor.accelerometer/src/org/tizen/sensor/magnetic/Magnetic.java @@ -0,0 +1,241 @@ +/* + * org.tizen.sensor.accelerometer + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.magnetic; + +import java.util.Random; + +import org.tizen.sensor.accelerometer.page.Vector; + +public class Magnetic { + private static Magnetic instance; + private Random r; + private double compassx; + private double compassy; + private double compassz; + private int azimuth = 0; + private int pitch = -90; + private int roll = 0; +// private double magneticnorth = 22874.1; +// private double magneticeast = 5939.5; +// private double magneticvertical = 43180.5; + private double magneticnorth = 10000; + private double magneticeast = 1000; + private double magneticvertical = 0; + public static final String sensorNumber = "5\n"; + + /** Current read-out value of compass x-component. */ + private double read_compassx; + /** Current read-out value of compass y-component. */ + private double read_compassy; + /** Current read-out value of compass z-component. */ + private double read_compassz; + + /** Partial read-out value of compass x-component. */ + private double partial_compassx; + /** Partial read-out value of compass y-component. */ + private double partial_compassy; + /** Partial read-out value of compass z-component. */ + private double partial_compassz; + /** Number of summands in partial sum for compass. */ + private int partial_compass_n; + /** Duration (in milliseconds) between two updates. + * This is the inverse of the update rate. + */ + private long compass_update_duration; + /** Time of next update required. + * The time is compared to System.currentTimeMillis(). + */ + private long compass_next_update; + /** Duration in milliseconds until user setting + * changes are read out. + */ + private long user_settings_duration; + /** Time of next update for reading user settings from widgets. + * The time is compared to System.currentTimeMillis(). + */ + private long user_settings_next_update; + + private boolean average_compass; + + private Magnetic(){ + r = new Random(); + average_compass = true; + user_settings_duration = 500; // Update every half second. This should be enough. + user_settings_next_update = System.currentTimeMillis(); // First update is now. + azimuth = 0; + } + + public static Magnetic getInstance(){ + if( instance == null) { + instance = new Magnetic(); + } + return instance; + } + + public void setMagneticFiled(double north, double east, double vertical){ +// magneticnorth = north; +// magneticeast = east; +// magneticvertical = vertical; + } + + public void updateSensorPhysics(double rollDegree, double pitchDegree, double yawDegree){ + // user input + + double random = 0.0f; + + Vector vec; + + + + // Add random component: + if (random > 0) { + magneticnorth += getRandom(random); + magneticeast += getRandom(random); + magneticvertical += getRandom(random); + } + + // Magnetic vector in phone coordinates: + vec = new Vector(magneticeast, magneticnorth, -magneticvertical); + vec.scale(0.001); // convert from nT (nano-Tesla) to 占폯 (micro-Tesla) + + // we reverse roll, pitch, and yawDegree, + // as this is how the mobile phone sees the coordinate system. + vec.reverserollpitchyaw(); + + compassx = vec.x; + compassy = vec.y; + compassz = vec.z; + } + + public void setOrient(double x, double y, double z){ + /* orientation logic via accelerometer value */ + int orient_yaw, orient_pitch, orient_roll; + orient_yaw = (int)(Math.round(Math.atan2(-x, -y) * (180.0/3.14) + 360) % 360); + orient_pitch = (int)(Math.atan2(-y, -z) * (180.0/3.14)) % 180; + orient_roll = (int)(Math.atan2(x, z) * (180.0/3.14)) % 180; + + if(orient_roll > 90) + orient_roll = 180 - orient_roll; + else if(orient_roll < -90) + orient_roll = -180 - orient_roll; + + azimuth = orient_yaw; + pitch = -orient_pitch; + roll = orient_roll; + } + + public int getAzimuth(){ + return azimuth; + } + public int getPitch(){ + return pitch; + } + public int getRoll(){ + return roll; + } + public void updateSensorReadoutValues() { + long currentTime = System.currentTimeMillis(); + if (average_compass) { + // Form the average + partial_compassx += compassx; + partial_compassy += compassy; + partial_compassz += compassz; + partial_compass_n++; + } + if (currentTime >= compass_next_update) { + // Update + compass_next_update += compass_update_duration; + if (compass_next_update < currentTime) { + // Don't lag too much behind. + // If we are too slow, then we are too slow. + compass_next_update = currentTime; + } + + if (average_compass) { + // form average + read_compassx = partial_compassx / partial_compass_n; + read_compassy = partial_compassy / partial_compass_n; + read_compassz = partial_compassz / partial_compass_n; + + // reset average + partial_compassx = 0; + partial_compassy = 0; + partial_compassz = 0; + partial_compass_n = 0; + + } else { + // Only take current value + read_compassx = compassx; + read_compassy = compassy; + read_compassz = compassz; + } + + } + + } + + public void updateUserSettings(){ + long currentTime = System.currentTimeMillis(); + double rate; + // From time to time we get the user settings: + if (currentTime >= user_settings_next_update) { + // Do update + user_settings_next_update += user_settings_duration; + if (user_settings_next_update < currentTime) { + // Skip time if we are already behind: + user_settings_next_update = System.currentTimeMillis(); + } + + // user input + average_compass = true; + rate = 10; + if (rate != 0) { + compass_update_duration = (long) (1000. / rate); + } else { + compass_update_duration = 0; + } + } + } + + public double getReadCompassX(){ + return read_compassx; + } + public double getReadCompassY(){ + return read_compassy; + } + public double getReadCompassZ(){ + return read_compassz; + } + + + private double getRandom(double random) { + double val; + val = r.nextDouble(); + return (2*val - 1) * random; + } +} diff --git a/org.tizen.sensor.light/.classpath b/org.tizen.sensor.light/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.sensor.light/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.sensor.light/.project b/org.tizen.sensor.light/.project new file mode 100644 index 0000000..d5448fc --- /dev/null +++ b/org.tizen.sensor.light/.project @@ -0,0 +1,28 @@ + + + org.tizen.sensor.light + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.sensor.light/.settings/org.eclipse.jdt.core.prefs b/org.tizen.sensor.light/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..6022d0a --- /dev/null +++ b/org.tizen.sensor.light/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Thu May 12 13:46:39 KST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.sensor.light/META-INF/MANIFEST.MF b/org.tizen.sensor.light/META-INF/MANIFEST.MF new file mode 100644 index 0000000..3dd22cb --- /dev/null +++ b/org.tizen.sensor.light/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Sensor Light +Bundle-SymbolicName: org.tizen.sensor.light;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Tizen +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: + org.eclipse.swt.widgets, + org.eclipse.ui.plugin, + org.tizen.common.connection, + org.tizen.common.util, + org.tizen.sdblib +Require-Bundle: org.tizen.injector;bundle-version="1.3.20", + org.eclipse.swt;bundle-version="3.5.2", + org.eclipse.core.runtime;bundle-version="3.7.0" diff --git a/org.tizen.sensor.light/build.properties b/org.tizen.sensor.light/build.properties new file mode 100644 index 0000000..e9863e2 --- /dev/null +++ b/org.tizen.sensor.light/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.tizen.sensor.light/plugin.xml b/org.tizen.sensor.light/plugin.xml new file mode 100644 index 0000000..c83cad3 --- /dev/null +++ b/org.tizen.sensor.light/plugin.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/org.tizen.sensor.light/src/org/tizen/sensor/light/Light.java b/org.tizen.sensor.light/src/org/tizen/sensor/light/Light.java new file mode 100644 index 0000000..78409aa --- /dev/null +++ b/org.tizen.sensor.light/src/org/tizen/sensor/light/Light.java @@ -0,0 +1,40 @@ +/* + * org.tizen.sensor.light + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.light; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.sensor.light.page.LightPage; + +public class Light extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new LightPage(this, "Light")); + } + +} diff --git a/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java b/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java new file mode 100644 index 0000000..f4a4b7b --- /dev/null +++ b/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java @@ -0,0 +1,194 @@ +/* + * org.tizen.sensor.light + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.light.page; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Slider; +import org.eclipse.swt.widgets.Text; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.common.util.DialogUtil; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; + +public class LightPage extends AbstractInjectorPage implements ISelectionListener { + private Text sliderText; + private Text luxText; + private Button injectLux; + private Slider slider; + private final String sensorNumber = "3\n"; + private final String lightLevel = "Level"; + private int luxData = 65535, levelData; + private IDevice currentDevice; + + public LightPage(AbstractInjectorItem item, String name) { + super(item, name); + } + + public static boolean checkNumberFormat(String noStr) { + Pattern luxPattern = Pattern.compile( "[^0-9]"); + Matcher matcher = luxPattern.matcher(noStr); + return matcher.find(); + } + + @Override + protected void createContents() { + ConnectionPlugin.getDefault().addSelectionListener(this); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + +// Composite mainComposite = formUtil.createComposite(parent, 3); +// formUtil.createLabel(mainComposite, lightLevel); +// slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL); +// slider.setValues(10, 1, 11, 1, 1, 1); +// slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); +// sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection())); +// sliderText.setEditable(false); +// GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false); +// gd.widthHint = 20; +// sliderText.setLayoutData(gd); +// levelData = slider.getSelection(); +// slider.addSelectionListener(new SelectionListener() { +// @Override +// public void widgetDefaultSelected(SelectionEvent e) { +// // TODO Auto-generated method stub +// } +// @Override +// public void widgetSelected(SelectionEvent e) { +// levelData = slider.getSelection(); +// sliderText.setText(Integer.toString(levelData)); +// sendMessage(1, levelData); +// } +// }); + + Composite mainComposite2 = formUtil.createComposite(parent, 100); + formUtil.createLabel(mainComposite2, "Lux "); + luxText = formUtil.createText(mainComposite2, ""); + luxText.setTextLimit(5); + + Composite buttonComposite = formUtil.createComposite(mainComposite2); + injectLux = formUtil.createButton(buttonComposite, "Inject", SWT.PUSH); + injectLux.addSelectionListener(new SelectionAdapter(){ + @Override + public void widgetSelected(SelectionEvent e) { + String number = luxText.getText().trim(); + if(number==null||number.length()==0) + return; + + if(checkNumberFormat(number) || Double.parseDouble(number) <= 0 || Double.parseDouble(number) > 65535) + { + DialogUtil.openMessageDialog("Please enter the correct value.\nLux can be entered in the range of 1 to 65535."); + return; + } + luxData = Integer.parseInt(number); + sendMessage(2, luxData); + } + }); + + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } + } + + private boolean checkDeviceConnectedAlready() { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + + public void sendMessage(int label, int data) { + TestSensorMessage msg = new TestSensorMessage(label, data); + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + +// @Override + public void connect() { + // TODO Auto-generated method stub + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + } + +// @Override + public void disconnect() { + // TODO Auto-generated method stub + } + + @Override + protected void finalize() throws Throwable { + ConnectionPlugin.getDefault().removeSelectionListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + if( selectedEntry == null) + { + disconnect(); + return; + } + else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) + return; + + if(currentDevice == null && selectedEntry.getName() != null) + connect(); + else if(currentDevice == null && selectedEntry.getName() == null) + return; + else if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect(); + connect(); + } + sendMessage(1, levelData); + sendMessage(2, luxData); + } +} diff --git a/org.tizen.sensor.motion/.classpath b/org.tizen.sensor.motion/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.sensor.motion/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.sensor.motion/.project b/org.tizen.sensor.motion/.project new file mode 100644 index 0000000..b4d9e48 --- /dev/null +++ b/org.tizen.sensor.motion/.project @@ -0,0 +1,28 @@ + + + org.tizen.sensor.motion + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.sensor.motion/.settings/org.eclipse.jdt.core.prefs b/org.tizen.sensor.motion/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..5f79cf8 --- /dev/null +++ b/org.tizen.sensor.motion/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Jun 29 14:18:42 KST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.sensor.motion/META-INF/MANIFEST.MF b/org.tizen.sensor.motion/META-INF/MANIFEST.MF new file mode 100644 index 0000000..a914a1a --- /dev/null +++ b/org.tizen.sensor.motion/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Sensor Motion +Bundle-SymbolicName: org.tizen.sensor.motion;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Tizen +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.swt, + org.tizen.injector +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Import-Package: org.tizen.injector.provider, + org.tizen.common.connection, + org.tizen.sdblib, + org.eclipse.swt, + org.eclipse.ui.plugin diff --git a/org.tizen.sensor.motion/build.properties b/org.tizen.sensor.motion/build.properties new file mode 100644 index 0000000..e9863e2 --- /dev/null +++ b/org.tizen.sensor.motion/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.tizen.sensor.motion/plugin.xml b/org.tizen.sensor.motion/plugin.xml new file mode 100644 index 0000000..429250f --- /dev/null +++ b/org.tizen.sensor.motion/plugin.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/org.tizen.sensor.motion/src/org/tizen/sensor/motion/Motion.java b/org.tizen.sensor.motion/src/org/tizen/sensor/motion/Motion.java new file mode 100644 index 0000000..49e4bcc --- /dev/null +++ b/org.tizen.sensor.motion/src/org/tizen/sensor/motion/Motion.java @@ -0,0 +1,40 @@ +/* + * org.tizen.sensor.motion + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.motion; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.sensor.motion.page.MotionPage; + +public class Motion extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new MotionPage(this, "Motion")); + } + +} diff --git a/org.tizen.sensor.motion/src/org/tizen/sensor/motion/page/MotionPage.java b/org.tizen.sensor.motion/src/org/tizen/sensor/motion/page/MotionPage.java new file mode 100644 index 0000000..44dda57 --- /dev/null +++ b/org.tizen.sensor.motion/src/org/tizen/sensor/motion/page/MotionPage.java @@ -0,0 +1,210 @@ +/* + * org.tizen.sensor.motion + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.motion.page; + + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; + +public class MotionPage extends AbstractInjectorPage implements ISelectionListener { + private final String sensorNumber = "6\n"; + + public MotionPage(AbstractInjectorItem item, String name) { + super(item, name); + } + + @Override + protected void createContents() { + Composite mainComposite = formUtil.createComposite(parent, 3); + + Button button_doubleTap = formUtil.createButton(mainComposite, "Double Tap", SWT.PUSH); + Button button_shakeStart = formUtil.createButton(mainComposite, "Shake Start", SWT.PUSH); + Button button_shakeEnd = formUtil.createButton(mainComposite, "Shake End", SWT.PUSH); + Button button_snapXp = formUtil.createButton(mainComposite, "Snap X+", SWT.PUSH); + Button button_snapYp = formUtil.createButton(mainComposite, "Snap Y+", SWT.PUSH); + Button button_snapZp = formUtil.createButton(mainComposite, "Snap Z+", SWT.PUSH); + Button button_snapXm = formUtil.createButton(mainComposite, "Snap X-", SWT.PUSH); + Button button_snapYm = formUtil.createButton(mainComposite, "Snap Y-", SWT.PUSH); + Button button_snapZm = formUtil.createButton(mainComposite, "Snap Z-", SWT.PUSH); + Button button_snapLeft = formUtil.createButton(mainComposite, "Snap Left", SWT.PUSH); + Button button_snapRight = formUtil.createButton(mainComposite, "Snap Right", SWT.PUSH); + + GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false); + + button_doubleTap.setLayoutData(gd); + button_shakeStart.setLayoutData(gd); + button_shakeEnd.setLayoutData(gd); + button_snapXp.setLayoutData(gd); + button_snapXm.setLayoutData(gd); + button_snapYp.setLayoutData(gd); + button_snapYm.setLayoutData(gd); + button_snapZp.setLayoutData(gd); + button_snapZm.setLayoutData(gd); + button_snapLeft.setLayoutData(gd); + button_snapRight.setLayoutData(gd); + + button_doubleTap.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(1); + } + }); + button_shakeStart.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(2); + } + }); + button_shakeEnd.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(3); + } + }); + button_snapXp.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(4); + } + }); + button_snapXm.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(5); + } + }); + button_snapYp.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(6); + } + }); + button_snapYm.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(7); + } + }); + button_snapZp.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(8); + } + }); + button_snapZm.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(9); + } + }); + button_snapLeft.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(10); + } + }); + button_snapRight.addSelectionListener(new SelectionListener(){ + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + @Override + public void widgetSelected(SelectionEvent e) { + sendMessage(11); + } + }); + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + public void sendMessage(int level) { + TestSensorMessage msg = new TestSensorMessage(level); + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + + @Override + protected void finalize() throws Throwable { +// DeviceLauncherManager.removeDeviceListener(this); +// TargetConnectionControl.removeTargetConnectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + // TODO Auto-generated method stub + + } + +} diff --git a/org.tizen.sensor.proximity/.classpath b/org.tizen.sensor.proximity/.classpath new file mode 100644 index 0000000..ad32c83 --- /dev/null +++ b/org.tizen.sensor.proximity/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.tizen.sensor.proximity/.project b/org.tizen.sensor.proximity/.project new file mode 100644 index 0000000..58c1bbf --- /dev/null +++ b/org.tizen.sensor.proximity/.project @@ -0,0 +1,28 @@ + + + org.tizen.sensor.proximity + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.tizen.sensor.proximity/.settings/org.eclipse.jdt.core.prefs b/org.tizen.sensor.proximity/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..7f0584e --- /dev/null +++ b/org.tizen.sensor.proximity/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed May 11 20:48:33 KST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.tizen.sensor.proximity/META-INF/MANIFEST.MF b/org.tizen.sensor.proximity/META-INF/MANIFEST.MF new file mode 100644 index 0000000..cd4b5d0 --- /dev/null +++ b/org.tizen.sensor.proximity/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tizen Event Injector Sensor Proximity +Bundle-SymbolicName: org.tizen.sensor.proximity;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: Tizen +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.tizen.injector, + org.eclipse.swt, + org.tizen.common, + org.eclipse.ui;bundle-version="3.7.0", + org.eclipse.core.runtime;bundle-version="3.7.0" +Import-Package: + org.eclipse.swt, + org.eclipse.swt.widgets, + org.tizen.common.connection, + org.tizen.sdblib diff --git a/org.tizen.sensor.proximity/build.properties b/org.tizen.sensor.proximity/build.properties new file mode 100644 index 0000000..e9863e2 --- /dev/null +++ b/org.tizen.sensor.proximity/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.tizen.sensor.proximity/plugin.xml b/org.tizen.sensor.proximity/plugin.xml new file mode 100644 index 0000000..222d6f4 --- /dev/null +++ b/org.tizen.sensor.proximity/plugin.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/Proximity.java b/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/Proximity.java new file mode 100644 index 0000000..a113635 --- /dev/null +++ b/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/Proximity.java @@ -0,0 +1,41 @@ +/* + * org.tizen.sensor.proximity + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.proximity; + +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.sensor.proximity.page.ProximityPage; + +public class Proximity extends AbstractInjectorItem{ + + @Override + protected void addPages() { + addPage(new ProximityPage(this, "Proximity")); + + } + +} diff --git a/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityConstants.java b/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityConstants.java new file mode 100644 index 0000000..da5203e --- /dev/null +++ b/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityConstants.java @@ -0,0 +1,33 @@ +/* + * org.tizen.sensor.proximity + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.proximity.page; + +public class ProximityConstants { + public static final String ON = "Near"; + public static final String OFF = "Far"; +} diff --git a/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityPage.java b/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityPage.java new file mode 100644 index 0000000..bf9912e --- /dev/null +++ b/org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityPage.java @@ -0,0 +1,157 @@ +/* + * org.tizen.sensor.proximity + * + * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * Sungmin Ha + * YeongKyoon Lee + * DongKyun Yun + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.sensor.proximity.page; + +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Slider; +import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.SWT; + +import org.tizen.common.connection.ConnectionPlugin; +import org.tizen.common.connection.ConnectionPlugin.ISelectionListener; +import org.tizen.sdblib.FileListingService.FileEntry; +import org.tizen.sdblib.IDevice; +import org.tizen.injector.protocol.sensor.TestSensorMessage; +import org.tizen.injector.provider.AbstractInjectorItem; +import org.tizen.injector.provider.AbstractInjectorPage; + +public class ProximityPage extends AbstractInjectorPage implements ISelectionListener { + private Text sliderText; + private Slider slider; + private final String sensorNumber = "2\n"; + private final String proxiDistance = "Distance"; + private int sendData; + private IDevice currentDevice = null; + + public ProximityPage(AbstractInjectorItem item, String name) { + super(item, name); + // TODO Auto-generated constructor stub + } + + @Override + protected void createContents() { + ConnectionPlugin.getDefault().addSelectionListener(this); + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + + Composite mainComposite = formUtil.createComposite(parent, 3); + formUtil.createLabel(mainComposite, proxiDistance); + slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL); + slider.setValues(0, 0, 9, 1, 1, 1); + slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); + sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection())); + sliderText.setEditable(false); + GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false); + gd.widthHint = 20; + sliderText.setLayoutData(gd); + sendData = slider.getSelection(); + + slider.addSelectionListener(new SelectionListener() { + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + @Override + public void widgetSelected(SelectionEvent e) { + sendData = slider.getSelection(); + sliderText.setText(Integer.toString(sendData)); + sendMessage(sendData); + } + }); + + boolean connected = checkDeviceConnectedAlready(); + if (connected == true) { + connect(); + } + } + + private boolean checkDeviceConnectedAlready() { + if (currentDevice == null) + return false; + else + return true; + } + + @Override + protected void registerReceivers() { + // TODO Auto-generated method stub + + } + + public void sendMessage(int distance) { + TestSensorMessage msg = new TestSensorMessage(distance); + try { + // sensorSocket.send(sensorNumber + msg.getMessage()); + injectorSocket.sendSensor(sensorNumber + msg.getMessage()); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + + // @Override + public void connect() { + // TODO Auto-generated method stub + currentDevice = ConnectionPlugin.getDefault().getCurrentDevice(); + } + +// @Override + public void disconnect() { + // TODO Auto-generated method stub + } + + @Override + protected void finalize() throws Throwable { + ConnectionPlugin.getDefault().removeSelectionListener(this); + super.finalize(); + } + + @Override + public void selectionChanged(FileEntry selectedEntry) { + if( selectedEntry == null) + { + disconnect(); + return; + } + else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) + return; + + if(currentDevice == null && selectedEntry.getName() != null) + connect(); + else if(currentDevice == null && selectedEntry.getName() == null) + return; + else if (currentDevice.getSerialNumber() != selectedEntry.getName()) { + disconnect(); + connect(); + } + sendMessage(sendData); + } +} diff --git a/package/build.linux b/package/build.linux new file mode 100755 index 0000000..b6eaae3 --- /dev/null +++ b/package/build.linux @@ -0,0 +1,296 @@ +#!/bin/bash -x + +build_path=${SRCDIR}/build_result + +__set_parameter() +{ + build_id=${package_name} + build_type=N + build_result_directory=${build_type}.${build_id} + build_result_path="$build_path/$build_result_directory" + architecture=x86 + ide_root_path_name=IDE + + case ${platform} in + linux) + archive_platform_name=linux + windowing=gtk + ;; + windows) + archive_platform_name=win32 + windowing=win32 + ;; + *) + echo "${platform} is not support yet." + ;; + esac + + result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip +} + +__set_build_parameter() +{ + case ${platform} in + linux) + reference_ide_path=${ROOTDIR}/indigo-pde/eclipse + ;; + windows) + reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse + ;; + *) + echo "${platform} is not support yet." + ;; + esac +} + +__set_install_parameter() +{ + INSTALL_DIR=${SRCDIR}/package/${package_name}.package.${platform}/data +} + +__clean_build_environment() +{ + if [ -d $build_path ] + then + echo "Build result directory : [$build_path]" + else + echo "Make build result directory [$build_path]" + mkdir -p $build_path + fi + + echo "Remove legacy build files..." + if [ -d ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} ] + then + rm -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} + fi + if [ -e ${build_result_path}/${result_archive_file} ] + then + rm -rf ${build_result_path}/${result_archive_file} + fi + if [ -d ${build_path}/tmp ] + then + rm -rf ${build_path}/tmp + fi + + if [ -d ${build_path}/buildRepo ] + then + rm -rf ${build_path}/buildRepo + fi + + rm -r ${build_path}/*.xml + rm -r ${build_path}/*.properties + rm -r ${build_path}/*.clean + + + if [ -d $build_path/plugins ] + then + echo "plugins directory recreate..." + rm -rf $build_path/plugins + mkdir $build_path/plugins + else + echo "Make plugins directory..." + mkdir $build_path/plugins + fi + if [ -d $build_path/features/ ] + then + echo "features directory recreate..." + rm -rf $build_path/features + mkdir $build_path/features + else + echo "Make features directory..." + mkdir $build_path/features + fi + +} + +__copy_build_sources() +{ + echo "Copy features from $SRCDIR to $build_path/features" + cp -r $SRCDIR/*.feature $build_path/features + + echo "Copy plugins from $SRCDIR to $build_path/plugins" + cp -r $SRCDIR/* $build_path/plugins + rm -rf $build_path/plugins/*.feature +} + +__copy_dependency_plugins() +{ + dependency_plugin_path=${ROOTDIR}/${ide_root_path_name} + if [ -d ${dependency_plugin_path} ] + then + cp -rf ${dependency_plugin_path}/features/* ${build_path}/features/ + cp -rf ${dependency_plugin_path}/plugins/* ${build_path}/plugins/ + fi +} + +__make_ant_build_properties_file() +{ + builder_path="${SRCDIR}/builder" + parent_path_of_based_eclipse=${reference_ide_path}/.. + + echo "Make build.properties file..." + if [ ! -e $builder_path/build.properties.clean ] ; then + echo "ERROR : \"build.properties.clean\" file does not exist..." + exit 1 + fi + cp $builder_path/build.properties.clean $build_path + cp $builder_path/customTargets.xml $build_path + + if [ -d $reference_ide_path ] + then + sed -e "s;\(^buildDirectory=\).*;\1${build_path};g" \ + -e "s;\(^base=\).*;\1${parent_path_of_based_eclipse};g" \ + -e "s;\(^baseLocation=\).*;\1${reference_ide_path};g" \ + -e "s;\(^configs=\).*;\1${archive_platform_name},${windowing},${architecture};g" \ + -e "s;\(^buildType=\).*;\1${build_type};g" \ + -e "s;\(^buildId=\).*;\1${build_id};g" \ + -e "s;\(^archivePrefix=\).*;\1${build_id};g" \ + < $build_path/build.properties.clean > $build_path/build.properties + + else + echo "ERROR : target eclipse is not exist." + exit 1 + fi +} + +__execute_pde_build() +{ + echo "Execute Product Ant Builder..." + equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar` + pde_build=`echo org.eclipse.pde.build_*` + + java -XX:+UseParNewGC -jar ${reference_ide_path}/plugins/$equinox_launcher -application org.eclipse.ant.core.antRunner -buildfile ${reference_ide_path}/plugins/$pde_build/scripts/productBuild/productBuild.xml -Dbuilder=$build_path -Dosgi.locking=none 2>&1 + + if [ $? != 0 ]; + then + echo "Build failed..." + exit 1 + fi +} + +__unzip_plugin_pack() +{ + echo "unzip to $build_result_path" + unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture} +} + +build_plugins() +{ + case ${platform} in + linux) + echo "build plugin for ${platform}" + ;; + windows) + echo "build plugin for ${platform}" + ;; + *) + echo "${platform} is not support yet." + exit 1 + ;; + esac + + __set_parameter + __set_build_parameter + __clean_build_environment + __copy_build_sources + __copy_dependency_plugins + __make_ant_build_properties_file + __execute_pde_build + __unzip_plugin_pack + + echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"." +} + +__clean_packaging_environment() +{ + + if [ -d ${INSTALL_DIR} ] + then + rm -rf ${INSTALL_DIR} + else + mkdir -p ${INSTALL_DIR} + fi +} + +__copy_necessary_binaries() +{ + ## 패키징시 필요한 파일이 있으면 여기에 구현하시면 됩니다. + ## 파일을 복사할 위치는 ${INSTALL_DIR} 아래에 원하는 위치로 지정하시면 됩니다. + ## INSTALL_DIR의 값은 "${git repository 위치}/package/${package_name}.package.${platform}/data" 로 되어있습니다. + ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/ + + echo "add necessary files." +} + +packaging_plugins() +{ + __set_parameter + __set_install_parameter + + __clean_packaging_environment + __copy_necessary_binaries + + install_ide_path=${INSTALL_DIR}/${ide_root_path_name} + + if [ ! -d ${install_ide_path} ] + then + mkdir -p ${install_ide_path} + fi + + cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/ +} + +# clean +clean() +{ + echo "=========================================CLEAN============================================" + make clean + rm -rf ${SRCDIR}/*.zip + rm -rf ${SRCDIR}/*.tar.gz + rm -rf ${build_path} +} + +# build +build() +{ + echo "=========================================BUILD============================================" + pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i $build_path/build.properties + + else + echo "ERROR : target eclipse is not exist." + exit 1 + fi +} + +__execute_pde_build() +{ + echo "Execute Product Ant Builder..." + equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar` + pde_build=`echo org.eclipse.pde.build_*` + + java -XX:+UseParNewGC -jar ${reference_ide_path}/plugins/$equinox_launcher -application org.eclipse.ant.core.antRunner -buildfile ${reference_ide_path}/plugins/$pde_build/scripts/productBuild/productBuild.xml -Dbuilder=$build_path -Dosgi.locking=none 2>&1 + + if [ $? != 0 ]; + then + echo "Build failed..." + exit 1 + fi +} + +__unzip_plugin_pack() +{ + echo "unzip to $build_result_path" + unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture} +} + +build_plugins() +{ + case ${platform} in + linux) + echo "build plugin for ${platform}" + ;; + windows) + echo "build plugin for ${platform}" + ;; + *) + echo "${platform} is not support yet." + exit 1 + ;; + esac + + __set_parameter + __set_build_parameter + __clean_build_environment + __copy_build_sources + __copy_dependency_plugins + __make_ant_build_properties_file + __execute_pde_build + __unzip_plugin_pack + + echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"." +} + +__clean_packaging_environment() +{ + + if [ -d ${INSTALL_DIR} ] + then + rm -rf ${INSTALL_DIR} + else + mkdir -p ${INSTALL_DIR} + fi +} + +__copy_necessary_binaries() +{ + ## 패키징시 필요한 파일이 있으면 여기에 구현하시면 됩니다. + ## 파일을 복사할 위치는 ${INSTALL_DIR} 아래에 원하는 위치로 지정하시면 됩니다. + ## INSTALL_DIR의 값은 "${git repository 위치}/package/${package_name}.package.${platform}/data" 로 되어있습니다. + ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/ + + echo "add necessary files." +} + +packaging_plugins() +{ + __set_parameter + __set_install_parameter + + __clean_packaging_environment + __copy_necessary_binaries + + install_ide_path=${INSTALL_DIR}/${ide_root_path_name} + + if [ ! -d ${install_ide_path} ] + then + mkdir -p ${install_ide_path} + fi + + cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/ +} + +# clean +clean() +{ + echo "=========================================CLEAN============================================" + make clean + rm -rf ${SRCDIR}/*.zip + rm -rf ${SRCDIR}/*.tar.gz + rm -rf ${build_path} +} + +# build +build() +{ + echo "=========================================BUILD============================================" + pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i, sungmin Ha +Description:EventInjector for emulator +Build-dependency:indigo-pde[linux], common-eplugin[linux] +Install-dependency:base-ide-product[linux] +Source:eventinjector-eplugin + +Package:eventinjector-eplugin +Version:0.2.6 +OS:windows +Build-host-os:linux +Maintainer:yeongkyoon Lee , sungmin Ha +Description:EventInjector for emulator +Build-dependency:indigo-winpde[windows], common-eplugin[linux] +Install-dependency:base-ide-product[windows] +Source:eventinjector-eplugin diff --git a/packaging_eventinjector.sh b/packaging_eventinjector.sh new file mode 100755 index 0000000..aaaf3fb --- /dev/null +++ b/packaging_eventinjector.sh @@ -0,0 +1,122 @@ +#!/bin/bash +######################################################################################## +## +## This script is packaging fresh ide. +## If you have any question, please send e-mail to taeyoung2.son@samsung.com. +## +######################################################################################## +## You must setup parameter +set_build_result_path="`pwd`/.." + +############################################################################################################ +## Don't touch below!!!! If you want to touch this script, ask to Taeyoung Son(taeyoung2.son@samsung.com) +############################################################################################################ +package() +{ + architecture=x86 + case ${platform} in + linux) + upload_platform_name=LINUX + windowing=gtk + ;; + windows) + upload_platform_name=WINDOWS + windowing=win32 + ;; + *) + echo "${platform} is not support yet." + exit 1 + ;; + esac + + current_date=`date +%Y%m%d` + upload_server=172.21.17.46 + case ${branch} in + master) + upload_directory=/packages/PACKAGES_${upload_platform_name} + ;; + release) + upload_directory=/packages/${current_date}_PACKAGES_${upload_platform_name} + ;; + *) + echo "${branch} is not supported." + exit 1 + ;; + esac + + upload_user=core + upload_password=tmaxcore + + package_name=eventinjector + start_path=`pwd` + build_path="$set_build_result_path/build_result" + + case ${platform} in + windows) + build_result_directory=N.eventinjector_build/win32.${windowing}.${architecture} + ;; + *) + build_result_directory=N.eventinjector_build/${platform}.${windowing}.${architecture} + ;; + esac + + build_result_path="$build_path/$build_result_directory" + builder_path="$start_path/builder" + metadata_path=$start_path/builder/metadata + config_path=${start_path}/com.samsung.freshide/config.ini + + package_version=`grep "Version" ${builder_path}/metadata/pkginfo.manifest` + ide_version=`echo $package_version | cut -f 2 -d":"` + sed -e "s;\(^Version:\).*;\1${ide_version};g" < $metadata_path/pkginfo.manifest > $metadata_path/pkginfo.manifest.new + mv ${metadata_path}/pkginfo.manifest ${metadata_path}/pkginfo.manifest.bak + mv ${metadata_path}/pkginfo.manifest.new ${metadata_path}/pkginfo.manifest + + package_file=${package_name}_${ide_version}.${BUILD_NUMBER}_${platform}.zip + + rm -rf $build_path/packaging + + echo "Create package for install manager..." + mkdir -p $build_path/packaging/data + cp -rf $build_result_path/eventinjector $build_path/packaging/data/ + mv $build_path/packaging/data/eventinjector $build_path/packaging/data/NativeIDE + cp -rf $metadata_path/* $build_path/packaging + cd $build_path/packaging + + echo "Remove legacy package file..." + rm -f $package_file + echo "Archive package for upload to server..." + if [ ${platform} = "linux" ] + then + zip -r $package_file pkginfo.manifest data + elif [ ${platform} = "windows" ] + then + zip -r $package_file pkginfo.manifest data + fi + + echo "Copy to Packaging directory" + mv $package_file ${build_path}/ + echo "Package file's path : ${build_path}" + cd - + echo "Packaging SUCCESS" + + cd $build_path + echo "Delete legacy package from server...(download legacy package to \"$HOME/${package_name}_*_${platform}.zip\")" +# ncftpget -DD -u ${upload_user} -p ${upload_password} ${upload_server} ~/ ${upload_directory}/${package_name}_*_${platform}.zip + echo "Upload $package_file to server..." +# ncftpput -u ${upload_user} -p ${upload_password} ${upload_server} ${upload_directory} ${package_file} + cd - + echo "Upload SUCCESS" + + echo "Packaing and uploading complete." + echo "You can find package in \"${build_path}/${package_file}\"" +} + +if [ "x$1" = "x" ] +then + echo "Usage : packaging_ide.sh PLATFORM_NAME" + exit 1 +fi + +platform=$1 +branch=$2 +package diff --git a/packaging_eventinjector_wac.sh b/packaging_eventinjector_wac.sh new file mode 100755 index 0000000..c78f89d --- /dev/null +++ b/packaging_eventinjector_wac.sh @@ -0,0 +1,123 @@ +#!/bin/bash +######################################################################################## +## +## This script is packaging fresh ide. +## If you have any question, please send e-mail to taeyoung2.son@samsung.com. +## +######################################################################################## +## You must setup parameter +set_build_result_path="`pwd`/.." + +############################################################################################################ +## Don't touch below!!!! If you want to touch this script, ask to Taeyoung Son(taeyoung2.son@samsung.com) +############################################################################################################ +package() +{ + architecture=x86 + case ${platform} in + linux) + upload_platform_name=LINUX + windowing=gtk + ;; + windows) + upload_platform_name=WINDOWS + windowing=win32 + ;; + *) + echo "${platform} is not support yet." + exit 1 + ;; + esac + + current_date=`date +%Y%m%d` + upload_server=172.21.17.46 + upload_directory=/packages/${current_date}_PACKAGES_${upload_platform_name} + case ${branch} in + master) + upload_directory=/packages/PACKAGES_${upload_platform_name} + ;; + release) + upload_directory=/packages/${current_date}_PACKAGES_${upload_platform_name} + ;; + *) + echo "${branch} is not supported." + exit 1 + ;; + esac + + upload_user=core + upload_password=tmaxcore + + package_name=eventinjector_wac + start_path=`pwd` + build_path="$set_build_result_path/build_result" + + case ${platform} in + windows) + build_result_directory=N.eventinjector_build/win32.${windowing}.${architecture} + ;; + *) + build_result_directory=N.eventinjector_build/${platform}.${windowing}.${architecture} + ;; + esac + + build_result_path="$build_path/$build_result_directory" + builder_path="$start_path/builder" + metadata_path=$start_path/builder/metadata/wac + config_path=${start_path}/com.samsung.freshide/config.ini + + package_version=`grep "Version" ${builder_path}/metadata/pkginfo.manifest` + ide_version=`echo $package_version | cut -f 2 -d":"` + sed -e "s;\(^Version:\).*;\1${ide_version};g" < $metadata_path/pkginfo.manifest > $metadata_path/pkginfo.manifest.new + mv ${metadata_path}/pkginfo.manifest ${metadata_path}/pkginfo.manifest.bak + mv ${metadata_path}/pkginfo.manifest.new ${metadata_path}/pkginfo.manifest + + package_file=${package_name}_${ide_version}.${BUILD_NUMBER}_${platform}.zip + + rm -rf $build_path/packaging + + echo "Create package for install manager..." + mkdir -p $build_path/packaging/data + cp -rf $build_result_path/eventinjector $build_path/packaging/data/ + mv $build_path/packaging/data/eventinjector $build_path/packaging/data/WebIDE + cp -rf $metadata_path/* $build_path/packaging + cd $build_path/packaging + + echo "Remove legacy package file..." + rm -f $package_file + echo "Archive package for upload to server..." + if [ ${platform} = "linux" ] + then + zip -r $package_file pkginfo.manifest data + elif [ ${platform} = "windows" ] + then + zip -r $package_file pkginfo.manifest data + fi + + echo "Copy to Packaging directory" + mv $package_file ${build_path}/ + echo "Package file's path : ${build_path}" + cd - + echo "Packaging SUCCESS" + + cd $build_path + echo "Delete legacy package from server...(download legacy package to \"$HOME/${package_name}_*_${platform}.zip\")" +# ncftpget -DD -u ${upload_user} -p ${upload_password} ${upload_server} ~/ ${upload_directory}/${package_name}_*_${platform}.zip + echo "Upload $package_file to server..." +# ncftpput -u ${upload_user} -p ${upload_password} ${upload_server} ${upload_directory} ${package_file} + cd - + echo "Upload SUCCESS" + + echo "Packaing and uploading complete." + echo "You can find package in \"${build_path}/${package_file}\"" +} + +if [ "x$1" = "x" ] +then + echo "Usage : packaging_ide.sh PLATFORM_NAME" + exit 1 +fi + +platform=$1 +branch=$2 +package -- 2.7.4