예제 #1
0
  /**
   * This is the UART protocol decoder core The decoder scans for a decode start event like CS high
   * to low edge or the trigger of the captured data. After this the decoder starts to decode the
   * data by the selected mode, number of bits and bit order. The decoded data are put to a JTable
   * object directly.
   */
  @Override
  public void onToolWorkerReady(final UARTDataSet aAnalysisResult) {
    super.onToolWorkerReady(aAnalysisResult);

    try {
      final String htmlPage;
      if (aAnalysisResult != null) {
        htmlPage = toHtmlPage(null /* aFile */, aAnalysisResult);
        this.exportAction.setEnabled(!aAnalysisResult.isEmpty());
      } else {
        htmlPage = getEmptyHtmlPage();
        this.exportAction.setEnabled(false);
      }

      this.outText.setText(htmlPage);
      this.outText.setEditable(false);

      this.runAnalysisAction.restore();
    } catch (final IOException exception) {
      // Make sure to handle IO-interrupted exceptions properly!
      if (!HostUtils.handleInterruptedException(exception)) {
        // Should not happen in this situation!
        throw new RuntimeException(exception);
      }
    }
  }