[Title]fixed duplicated usb event
authorsungmin ha <sungmin82.ha@samsung.com>
Mon, 9 Jul 2012 03:17:23 +0000 (12:17 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Mon, 9 Jul 2012 03:17:23 +0000 (12:17 +0900)
[Type]Bugfix
[Module]eventinjector
[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.device/src/org/tizen/device/usb/page/UsbPage.java
package/pkginfo.manifest

index b51dc82..b3f4ea8 100644 (file)
@@ -26,8 +26,6 @@
 
 package org.tizen.device.usb.page;
 
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -51,6 +49,7 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
        private Button radioButton[];
        private final String sensorNumber = "10\n";
        private boolean sensorOn;
+       private int preStatus = -1;
        private IDevice currentDevice;
        
        public UsbPage(AbstractInjectorItem item, String name) {
@@ -92,6 +91,7 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
                radioButton[1] = formUtil.createButton(subComposite, UsbConstants.remove, SWT.RADIO);
                radioButton[1].setSelection(true);
                sensorOn = false;
+               preStatus = 0;
                /*
                for( int i = 0 ; i < radioButton.length ; i++ ) {
                        if(radioButton[i].getSelection()) {
@@ -144,6 +144,9 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
        }
 
        public void sendMessage(int status) {
+                       if(preStatus == status)
+                               return;
+                       
                        TestSensorMessage msg = new TestSensorMessage(status);
                        try {
                        //      sensorSocket.send(sensorNumber + msg.getMessage());
@@ -152,6 +155,7 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        }
+                       preStatus = status;
        }
 
 //     @Override
index 5e92e81..e6d0865 100644 (file)
@@ -1,5 +1,5 @@
 Package:eventinjector-eplugin
-Version:0.2.36
+Version:0.2.37
 OS:linux
 Build-host-os:linux
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
@@ -9,7 +9,7 @@ Install-dependency:common-eplugin[linux], base-ide-product[linux]
 Source:eventinjector-eplugin
 
 Package:eventinjector-eplugin
-Version:0.2.36
+Version:0.2.37
 OS:windows
 Build-host-os:linux
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>