[Title]modified sign of accel value for osp
authorsungmin ha <sungmin82.ha@samsung.com>
Sat, 8 Sep 2012 04:56:47 +0000 (13:56 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Sat, 8 Sep 2012 04:56:47 +0000 (13:56 +0900)
[Type]Bugfix
[Module]eventinjector-eplugin
[Priority]Major
[Jira#] // Jira Issue Number
[Redmine#]  // Redmine Isuue Number
[Problem]  // Problem Description
[Cause]  // Cause Description
[Solution] // Solution Description
[TestCase]  // Executed the test-target (How to)

org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/Accelerometer.java
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputAccel.java
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/MobilePanel.java
package/pkginfo.manifest

index 74bb67e..9e2bae6 100644 (file)
@@ -194,6 +194,24 @@ public class Accelerometer extends AbstractInjectorPage {
                                        public void run() {
                                                DecimalFormat mf = new DecimalFormat("#0.00");
                                                Magnetic magnetic = Magnetic.getInstance();
+                                               double accelX = 0, accelY = 0, accelZ = 0;
+                                               double magneticX = 0, magneticY = 0, magneticZ = 0;
+                                               
+                                               accelX = panel.read_accelx/panel.g;
+                                               accelY = panel.read_accely/panel.g;
+                                               accelZ = panel.read_accelz/panel.g;
+                                               /* for convert (-0 or 1.8014523799287584E-15 etc.) to 0 */
+                                               if(accelX > -0.01 && accelX < 0.01) accelX = 0;
+                                               if(accelY > -0.01 && accelY < 0.01) accelY = 0;
+                                               if(accelZ > -0.01 && accelZ < 0.01) accelZ = 0;
+                                               
+                                               magneticX = magnetic.getReadCompassX();
+                                               magneticY = magnetic.getReadCompassY();
+                                               magneticZ = magnetic.getReadCompassZ();
+                                               /* for convert (-0 or 1.8014523799287584E-15 etc.) to 0 */
+                                               if(magneticX > -0.01 && magneticX < 0.01) magneticX = 0;
+                                               if(magneticY > -0.01 && magneticY < 0.01) magneticY = 0;
+                                               if(magneticZ > -0.01 && magneticZ < 0.01) magneticZ = 0;
                                                
                                                if(checkboxAcceleration.isDisposed())
                                                {
@@ -205,8 +223,8 @@ public class Accelerometer extends AbstractInjectorPage {
                                                {                                                       
                                                        if(changed_accel == true){      
                                                                if( checkboxAcceleration.getSelection()){
-                                                                       accelerationData = "Acceleration : " + mf.format(panel.read_accelx/panel.g) + ", "+ mf.format(panel.read_accely/panel.g) +
-                                                                       ", "+ mf.format(panel.read_accelz/panel.g);
+                                                                       accelerationData = "Acceleration : " + mf.format(accelX) + ", "+ mf.format(accelY) +
+                                                                       ", "+ mf.format(accelZ);
                                                                }
                                                                else {
                                                                        accelerationData = "Acceleration : Disable";
@@ -221,8 +239,8 @@ public class Accelerometer extends AbstractInjectorPage {
                                                        }
                                                        else
                                                        {
-                                                               accelerationData = "Acceleration : " + mf.format(panel.read_accelx/panel.g) + ", "+ mf.format(panel.read_accely/panel.g) +
-                                                                               ", "+ mf.format(panel.read_accelz/panel.g);
+                                                               accelerationData = "Acceleration : " + mf.format(accelX) + ", "+ mf.format(accelY) +
+                                                               ", "+ mf.format(accelZ);
                                                        }
                                                }
                                                
@@ -236,8 +254,8 @@ public class Accelerometer extends AbstractInjectorPage {
                                                {
                                                        if(changed_geo == true){
                                                                if( checkboxMagnetic.getSelection()) {
-                                                                       magneticData = "Magnetic : " + mf.format(magnetic.getReadCompassX()) +
-                                                                       ", " + mf.format(magnetic.getReadCompassY()) + ", " + mf.format(magnetic.getReadCompassZ());
+                                                                       magneticData = "Magnetic : " + mf.format(magneticX) +
+                                                                       ", " + mf.format(magneticY) + ", " + mf.format(magneticZ);
                                                                        
                                                                        if( checkboxTilt.getSelection() ) {
                                                                                tiltData = "Tilt : " + mf.format(magnetic.getAzimuth()) +
@@ -259,8 +277,8 @@ public class Accelerometer extends AbstractInjectorPage {
                                                        }
                                                        else
                                                        {
-                                                               magneticData = "Magnetic : " + mf.format(magnetic.getReadCompassX()) +
-                                                                               ", " + mf.format(magnetic.getReadCompassY()) + ", " + mf.format(magnetic.getReadCompassZ());
+                                                               magneticData = "Magnetic : " + mf.format(magneticX) +
+                                                                               ", " + mf.format(magneticY) + ", " + mf.format(magneticZ);
                                                                                
                                                                if( checkboxTilt.getSelection() ) {
                                                                        tiltData = "Tilt : " + mf.format(magnetic.getAzimuth()) +
index d012f03..1edb074 100644 (file)
@@ -65,7 +65,7 @@ public class ManualInputAccel extends AbstractInjectorPage {
        Slider accel_xSlider, accel_ySlider, accel_zSlider;
        private Text accel_xText, accel_yText, accel_zText;
        double accel_xValue, accel_yValue, accel_zValue;
-       double g = 9.80665;
+       double g = -9.80665;
        int accel_forSliderVal = 200;
        DecimalFormat df = new DecimalFormat("0.##");
        
index 6d3bcda..1ed37d0 100644 (file)
@@ -403,7 +403,7 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                
                dt = 0.1;
                meterperpixel = 1/3000.; // meter per pixel
-               g = 9.80665; // meter per second^2
+               g = -9.80665; // meter per second^2
                ginverse = 1 / g;
                
                user_settings_duration = 500;  // Update every half second. This should be enough.
@@ -594,7 +594,7 @@ private void updateSensorGyro(){
                Vector vec;
 
                dt = 0.001 * 10;
-               g = 9.80665;
+               g = -9.80665;
                if (g != 0) {
                        ginverse = 1 / g;
                }
index 23918e5..aa02cd5 100644 (file)
@@ -1,5 +1,5 @@
 Source:eventinjector-eplugin
-Version:0.2.65
+Version:0.2.66
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
 
 Package:eventinjector-eplugin