Search in sources :

Example 16 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class ExcludeTimeRangeAnalysisDialog method getOKButton.

/**
 * Initializes and returns the start button
 */
private JButton getOKButton() {
    if (startButton == null) {
        startButton = new JButton();
        startButton.setText(ResourceBundleHelper.getMessageString(DialogItem.Button_ok));
        startButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent arg0) {
                double startTime;
                double endTime;
                try {
                    startTime = getTimeValue(startTimeTextField);
                    endTime = getTimeValue(endTimeTextField);
                } catch (NumberFormatException e) {
                    MessageDialogFactory.getInstance().showErrorDialog(ExcludeTimeRangeAnalysisDialog.this, ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_numberError));
                    return;
                }
                double timeRangeEndTime = Double.valueOf(DECIMAL_FORMAT.format(traceEndTime));
                if (startTime < endTime) {
                    if ((startTime >= 0.0) && (startTime <= endTime) && endTime <= timeRangeEndTime) {
                        AnalysisFilter filter = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getFilter();
                        filter.setTimeRange(new TimeRange(startTime, endTime));
                        if (!hasDataAfterFiltering(filter)) {
                            MessageDialogFactory.getInstance().showErrorDialog(ExcludeTimeRangeAnalysisDialog.this, ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_noResultDataError));
                        } else {
                            ((MainFrame) parent).updateFilter(filter);
                            dispose();
                        }
                    } else {
                        String strErrorMessage = MessageFormat.format(ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_rangeError), 0.00, DECIMAL_FORMAT.format(timeRangeEndTime));
                        MessageDialogFactory.showMessageDialog(ExcludeTimeRangeAnalysisDialog.this, strErrorMessage, ResourceBundleHelper.getMessageString(DialogItem.menu_error_title), JOptionPane.ERROR_MESSAGE);
                    }
                } else {
                    String strErrorMessage = ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_startTimeError);
                    MessageDialogFactory.showMessageDialog(ExcludeTimeRangeAnalysisDialog.this, strErrorMessage, ResourceBundleHelper.getMessageString(DialogItem.menu_error_title), JOptionPane.ERROR_MESSAGE);
                }
            }
        });
    }
    return startButton;
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) JButton(javax.swing.JButton) MainFrame(com.att.aro.ui.view.MainFrame)

Example 17 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class FilterProcessesDialog method oKButtonAction.

/**
 * Actions performed when OK button is clicked.
 */
private void oKButtonAction() {
    CpuActivityList cpuAList = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getTraceresult().getCpuActivityList();
    cpuAList.setProcessSelection(filteredProcessSelection);
    cpuAList.recalculateTotalCpu();
    PacketAnalyzerResult tempresult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
    BurstCollectionAnalysisData bd = burstAnalysis.analyze(tempresult.getTraceresult().getAllpackets(), tempresult.getProfile(), tempresult.getStatistic().getPacketSizeToCountMap(), tempresult.getStatemachine().getStaterangelist(), tempresult.getTraceresult().getUserEvents(), cpuAList.getCpuActivities(), tempresult.getSessionlist());
    ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().setBurstCollectionAnalysisData(bd);
    ((MainFrame) parent).refresh();
    callerMenuItem.setEnabled(true);
    dispose();
}
Also used : CpuActivityList(com.att.aro.core.peripheral.pojo.CpuActivityList) BurstCollectionAnalysisData(com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) MainFrame(com.att.aro.ui.view.MainFrame)

Example 18 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class PrivateDataDialog method initialize.

private void initialize() {
    PacketAnalyzerResult currentTraceResult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
    setCurrentPktAnalyzerResult(currentTraceResult);
    this.setSize(400, 500);
    this.setTitle(resourceBundle.getString("privatedatasetting.title"));
    this.setLocationRelativeTo(getOwner());
    this.setContentPane(getJDialogPanel());
}
Also used : PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) MainFrame(com.att.aro.ui.view.MainFrame)

Example 19 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class AROToolMenu method openTimeRangeAnalysis.

private void openTimeRangeAnalysis() {
    MainFrame mainFrame = ((MainFrame) parent);
    if (mainFrame.getController().getTheModel() != null && mainFrame.getController().getTheModel().getAnalyzerResult() != null) {
        TimeRangeAnalysisDialog timeRangeDialog = new TimeRangeAnalysisDialog(mainFrame.getJFrame(), parent);
        timeRangeDialog.setVisible(true);
    } else {
        showNoTraceLoadedError();
    }
}
Also used : TimeRangeAnalysisDialog(com.att.aro.ui.view.menu.tools.TimeRangeAnalysisDialog) MainFrame(com.att.aro.ui.view.MainFrame)

Example 20 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class AROToolMenu method collectErrorMessage.

private void collectErrorMessage() {
    try {
        LOG.debug("collecting logcat");
        String fileName = String.format(FILE_NAME, LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE), LocalTime.now().toSecondOfDay());
        File outFile = new File(Util.getAROTraceDirAndroid(), fileName);
        IDevice device = getDevice();
        String adbPath = adbservice.getAdbPath(true);
        String[] command = new String[] { adbPath, "logcat", "-d", "2", "-t", "5000", "com.att.arocollector:I" };
        ProcessBuilder procBuilder = new ProcessBuilder(command);
        Process process = procBuilder.redirectOutput(outFile).start();
        process.waitFor(6, TimeUnit.SECONDS);
        MessageDialogFactory.showMessageDialog(((MainFrame) parent).getJFrame(), MessageFormat.format(getMsg("logcat.collection.success"), fileName) + ":\n" + device.getName(), "Collection Successful", JOptionPane.INFORMATION_MESSAGE);
    } catch (IOException | InterruptedException e) {
        LOG.error("Logcat collection failed", e);
        MessageDialogFactory.showMessageDialog(((MainFrame) parent).getJFrame(), e.getMessage(), getMsg("logcat.collection.failed"), JOptionPane.ERROR_MESSAGE);
    }
}
Also used : IDevice(com.android.ddmlib.IDevice) IOException(java.io.IOException) File(java.io.File) MainFrame(com.att.aro.ui.view.MainFrame)

Aggregations

MainFrame (com.att.aro.ui.view.MainFrame)24 File (java.io.File)7 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)5 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)4 IOException (java.io.IOException)4 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 IFileManager (com.att.aro.core.fileio.IFileManager)2 FileManagerImpl (com.att.aro.core.fileio.impl.FileManagerImpl)2 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)2 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)2 EnableEscKeyCloseDialog (com.att.aro.ui.commonui.EnableEscKeyCloseDialog)2 MessageDialogFactory (com.att.aro.ui.commonui.MessageDialogFactory)2 TimeRangeAnalysisDialog (com.att.aro.ui.view.menu.tools.TimeRangeAnalysisDialog)2 JButton (javax.swing.JButton)2 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)2 IDevice (com.android.ddmlib.IDevice)1 IExternalProcessRunner (com.att.aro.core.commandline.IExternalProcessRunner)1 ExternalProcessRunnerImpl (com.att.aro.core.commandline.impl.ExternalProcessRunnerImpl)1 ProfileType (com.att.aro.core.configuration.pojo.ProfileType)1