[SRADA-243]When StopTrace, delete ProgressBar popup
authorggh1933.go <ggh1933.go@samsung.com>
Mon, 21 Mar 2016 07:58:07 +0000 (16:58 +0900)
committerggh1933.go <ggh1933.go@samsung.com>
Mon, 21 Mar 2016 07:58:07 +0000 (16:58 +0900)
 - progressBar don't need for StopTrace.
 - When StopTrace, progressBar make "NullPointException" sometimes.. so Better delete that.

Change-Id: I66f09b68e18fd9240664444ace33e85f0eed080a

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/control/StopTraceManager.java

index f04428d..19bfcbf 100644 (file)
@@ -45,58 +45,19 @@ import org.tizen.dynamicanalyzer.swap.logparser.MessageParser;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackInserter;
 import org.tizen.dynamicanalyzer.ui.info.screenshot.ScreenshotTimer;
 import org.tizen.dynamicanalyzer.ui.page.UpdateViewTimer;
-import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
 import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
 import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 import org.tizen.dynamicanalyzer.widgets.da.base.ProgressDialog;
-import org.tizen.dynamicanalyzer.workbench.LayoutManager;
 
 public class StopTraceManager implements Runnable {
 
-       private STAGE lastStage = STAGE.NONE;
        private ProgressDialog progressDlg = null;
        private DAResult error;
        private boolean stopFromTarget = false;
        private Boolean stopThreadCompleted = false;
        public StopTraceManager(DAResult err, boolean stopFromTarget) {
                this.error = err;
-               this.stopFromTarget = stopFromTarget;
-
-               // create progress dialog and open it
-               Display.getDefault().syncExec(new Runnable() {
-                       @Override
-                       public void run() {
-                               Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
-                               progressDlg = new ProgressDialog(shell, LayoutManager.getBaseComposite());
-                               if (null != progressDlg) {
-                                       progressDlg.setProgressMessage(AnalyzerLabels.DLG_SUMMARIZING_DATA);
-                                       progressDlg.setProgressInfo(AnalyzerLabels.DLG_PLEASE_WAIT);
-                                       if (!error.isSuccess()) {
-                                               progressDlg.setProgressStyle(ProgressDialog.PROGRESS_STYLE_WARNING);
-                                               String errorMessage = error.getMessage();
-                                               if (errorMessage.length() > 240) {
-                                                       progressDlg.setWarnigDialogType(ProgressDialog.DIALOG_TYPE_LARGE);
-                                               } else if (errorMessage.length() > 120) {
-                                                       progressDlg.setWarnigDialogType(ProgressDialog.DIALOG_TYPE_MIDDLE);
-                                               } else {
-                                                       progressDlg.setWarnigDialogType(ProgressDialog.DIALOG_TYPE_SMALL);
-                                               }
-                                               progressDlg.setProgressWarningMessage(errorMessage);
-                                               progressDlg.setOkListener(new DACustomButtonClickEventListener() {
-                                                       @Override
-                                                       public void handleClickEvent(DACustomButton button) {
-                                                               progressDlg.close();
-                                                       }
-                                               });
-                                       }
-                                       progressDlg.open();
-                               }
-                       }
-               });
+               this.stopFromTarget = stopFromTarget;           
        }
        
        @Override
@@ -106,37 +67,24 @@ public class StopTraceManager implements Runnable {
                try {
                        // stop resource monitor
                        ResourceMonitor.stop();
-                       setStageComplete(STAGE.STOP_RESOURCE_MONITOR);
 
                        // send stop message if necessary
                        if (!stopFromTarget) {
                                DACommunicator.stopTrace();
                        }
-                       setStageComplete(STAGE.SEND_STOPMSG);
                        
                        Thread stopTimers = new Thread(new Runnable() {
                                public void run() {
-                               // stop clock
-                                       try{
-                                       Toolbar.INSTANCE.stopTimer();
-                                       setStageComplete(STAGE.STOP_CLOCK);
+                                 Toolbar.INSTANCE.stopTimer();
                
                                        // stop replay timer
                                        ReplayManager.resetStopAlarm();
-                                       setStageComplete(STAGE.STOP_REPLAY_TIMER);
                
                                        // stop screenshot timer
                                        ScreenshotTimer.stop();
-                                       setStageComplete(STAGE.STOP_SCREENSHOT_TIMER);
                
                                        // stop update timer
                                        UpdateViewTimer.stop();
-                                       setStageComplete(STAGE.STOP_UPDATE_TIMER);
-                                       }
-                                       catch(InterruptedException e){
-                                               Logger.debug(); // for new line
-                                               Logger.debug("Interrupt occurred while stopTimers");
-                                       }
                                }
                        });
                        
@@ -166,7 +114,6 @@ public class StopTraceManager implements Runnable {
                                });
                                
                                stopForcedThread.start();
-                               setStageComplete(STAGE.STOP_DATATHREADS);
                                
                        } else {
                                
@@ -193,8 +140,6 @@ public class StopTraceManager implements Runnable {
                                
                                stopNormalThread.start();
                                
-                               setStageComplete(STAGE.STOP_DATATHREADS);
-                               
                                Project project = Global.getProject();
                                if (project != null && project.isValid()) {
                                        project.setTotalStopTime(Toolbar.INSTANCE.getTime());
@@ -208,8 +153,6 @@ public class StopTraceManager implements Runnable {
                        // change to summary page
                        UIAction.applyStopTraceUI();
 
-                       // confirm that all stage run
-                       setStageComplete(STAGE.FINAL);
                } catch (InterruptedException e) {
                        // canceled stop tracing
                        // never happened
@@ -280,17 +223,6 @@ public class StopTraceManager implements Runnable {
                }
        }
 
-       private void setStageComplete(STAGE st) throws InterruptedException {
-               lastStage = st;
-
-               int percent = ProgressTable.getPercent(PHASE.TRACE_END, lastStage);
-               if (percent != 100) {
-                       testCancel();
-               }
-
-               setProgressPercent(percent);
-       }
-
        private void testCancel() throws InterruptedException {
                // do nothing
        }