Package gov.nasa.arc.mct.components.FeedProvider

Examples of gov.nasa.arc.mct.components.FeedProvider.RenderingInfo


    for (FeedProvider fp : feedProviders) {
      if (data.containsKey(fp.getSubscriptionId())) {
        List<Map<String, String>> series = data.get(fp.getSubscriptionId());
        if (!series.isEmpty()){
          String display = getManifestedComponent().getDisplayName();
          RenderingInfo ri = fp.getRenderingInfo(series.get(series.size() - 1));
          String status = ri.getStatusText();
          if (!status.trim().isEmpty()) display = "(" + status + ") " + display;
          label.setText(display);
          label.setFont(ri.isPlottable() ? baseFont : strikeThroughFont);
        }
      }
    }

  }
View Full Code Here


    Map<String, String> dataAPoint1 = new Hashtable<String, String>();
    dataAPoint1.put(FeedProvider.NORMALIZED_TIME_KEY, "1");
    dataAPoint1.put(FeedProvider.NORMALIZED_VALUE_KEY, valueFifty);
    dataAPoint1.put(FeedProvider.NORMALIZED_IS_VALID_KEY, "TRUE");
    dataAPoint1.put(FeedProvider.NORMALIZED_TELEMETRY_STATUS_CLASS_KEY, "1");
    RenderingInfo ri1 = new RenderingInfo(valueFifty, Color.BLACK, "X", Color.BLACK, true);
    Mockito.when(feed1.getRenderingInfo(Mockito.anyMap())).thenReturn(ri1);

    Map<String, String> dataAPoint2 = new Hashtable<String, String>();
    dataAPoint2.put(FeedProvider.NORMALIZED_TIME_KEY, "1");
    dataAPoint2.put(FeedProvider.NORMALIZED_VALUE_KEY, "86.2");
    dataAPoint2.put(FeedProvider.NORMALIZED_IS_VALID_KEY, "TRUE");
    dataAPoint2.put(FeedProvider.NORMALIZED_TELEMETRY_STATUS_CLASS_KEY, "1");

    dataSetA.add(dataAPoint1);
    dataSetA.add(dataAPoint2);

    theData.put("PUI1", dataSetA);

    // data set B two points
    Map<String, String> dataBPoint1 = new Hashtable<String, String>();
    dataBPoint1.put(FeedProvider.NORMALIZED_TIME_KEY, "1");
    dataBPoint1.put(FeedProvider.NORMALIZED_VALUE_KEY, "25.0");
    dataBPoint1.put(FeedProvider.NORMALIZED_IS_VALID_KEY, "TRUE");
    dataBPoint1.put(FeedProvider.NORMALIZED_TELEMETRY_STATUS_CLASS_KEY, "1");
    RenderingInfo ri2 = new RenderingInfo("25.0", Color.BLACK, "X", Color.BLACK, true);
    Mockito.when(feed2.getRenderingInfo(Mockito.anyMap())).thenReturn(ri2);
   
    Map<String, String> dataBPoint2 = new Hashtable<String, String>();
    dataBPoint2.put(FeedProvider.NORMALIZED_TIME_KEY, "1");
    dataBPoint2.put(FeedProvider.NORMALIZED_VALUE_KEY, "110.9");
View Full Code Here

    Map<String, String> dataAPoint1 = new Hashtable<String, String>();
    dataAPoint1.put(FeedProvider.NORMALIZED_TIME_KEY, "1");
    dataAPoint1.put(FeedProvider.NORMALIZED_VALUE_KEY, valueFifty);
    dataAPoint1.put(FeedProvider.NORMALIZED_IS_VALID_KEY, "TRUE")
    dataAPoint1.put(FeedProvider.NORMALIZED_TELEMETRY_STATUS_CLASS_KEY, "1");
      RenderingInfo ri1 = new RenderingInfo(valueFifty, Color.BLACK, "X", Color.BLACK, true);
        Mockito.when(feed1.getRenderingInfo(Mockito.anyMap())).thenReturn(ri1);

    Map<String, String> dataAPoint2 = new Hashtable<String, String>();
    dataAPoint2.put(FeedProvider.NORMALIZED_TIME_KEY, "1");
    dataAPoint2.put(FeedProvider.NORMALIZED_VALUE_KEY, "86.2");
View Full Code Here

            if(dataForPlotThisFeed == null) {
              dataForPlotThisFeed = new TreeMap<Long, Double>();
              dataForPlot.put(feedId, dataForPlotThisFeed);
            }
 
            RenderingInfo lastRI = DEFAULT_RI;
            boolean haveLegendInfo = false;
 
            // Loop over each point that needs to be plotted for this
            // feed.
            for (Map<String, String> pointsData : dataForThisFeed) {
              RenderingInfo ri = provider
                  .getRenderingInfo(pointsData);
              assert pointsData != null : "PointsData is Null";
              String timeAsString = pointsData
                  .get(FeedProvider.NORMALIZED_TIME_KEY);
              String valueAsString = ri.getValueText();
                boolean isPlottable = ri.isPlottable();
 
              // Robust to time or value keys not being present.
              if (timeAsString != null && valueAsString != null) {
                try {
                  long milliSecondsEpoch = Long
View Full Code Here

    String id = fp.getSubscriptionId();
    if (data.containsKey(id)) {
      List<Map<String, String>> series = data.get(id);
      if (series.size() > 0) {
        Map<String, String> point = series.get(series.size() - 1);
        RenderingInfo ri = fp.getRenderingInfo(point);
        if (ri != null && ri.isPlottable()) {
          String value = ri.getValueText();         
          try {
            return Double.parseDouble(value);
          } catch (Exception e) {
            return null;
          }
View Full Code Here

          if (delta < -EPSILON) continue;
          if (delta >  EPSILON) return null;
        } catch (Exception e) {
          continue;
        }
        RenderingInfo ri = fp.getRenderingInfo(datum);       
        if (ri != null && ri.isPlottable()) {
          String value = ri.getValueText();         
          try {
            return Double.parseDouble(value);
          } catch (Exception e) {
            return null;
          }
View Full Code Here

    for (FeedProvider fp : feedProviders) {
      if (data.containsKey(fp.getSubscriptionId())) {
        List<Map<String, String>> series = data.get(fp.getSubscriptionId());
        if (!series.isEmpty()){
          String display = getManifestedComponent().getDisplayName();
          RenderingInfo ri = fp.getRenderingInfo(series.get(series.size() - 1));
          String status = ri.getStatusText();
          if (!status.trim().isEmpty()) display = "(" + status + ") " + display;
          label.setText(display);
          label.setFont(ri.isPlottable() ? baseFont : strikeThroughFont);
        }
      }
    }
   
  }
View Full Code Here

          // Process the first value for this feed.
          Map<String, String> entry = dataForThisFeed
              .get(dataForThisFeed.size() - 1);

          try {
            RenderingInfo ri = provider.getRenderingInfo(entry);
            Object value = ri.getValueText();
            valuesMap.put(feedId,Double.valueOf(ri.getValueText()));;
            for (AbstractComponent parameter : telemetryElements) {
              FeedProvider fp = parameter.getCapability(FeedProvider.class);
              if (fp != null && feedId.equals(fp.getSubscriptionId())) {
                telemetryTable.getModel().setValueAt(value, telemetryElements.indexOf(parameter), 2);
              }
View Full Code Here

        if (feedDataForThisComponentCastAsMap == null || feedDataForThisComponentCastAsMap.isEmpty()) {
            return;
        }
        Map<String, String> entry = feedDataForThisComponentCastAsMap.get( feedDataForThisComponentCastAsMap.size() -1 );        

        RenderingInfo ri =  feed.getRenderingInfo(entry);
        valueLabel.setText(ri.getValueText());
        valueLabel.setForeground(ri.getValueColor());
        if (!valueLabel.isVisible()) valueLabel.setVisible(true)
  }
View Full Code Here

        Map<String,String> values = new HashMap<String,String>();
        List<Map<String,String>> origValues = originalData.get(f);
        if (origValues != null && !origValues.isEmpty()) {
          values.putAll(origValues.get(origValues.size()-1));
          values.put(FeedProvider.NORMALIZED_VALUE_KEY, val);
          RenderingInfo originalInfo = RenderingInfo.valueOf(values.get(FeedProvider.NORMALIZED_RENDERING_INFO));
          RenderingInfo ri = new RenderingInfo(
              val,
              originalInfo.getValueColor(),
              originalInfo.getStatusText(),
              originalInfo.getStatusColor(),
              true
          );
          values.put(FeedProvider.NORMALIZED_RENDERING_INFO, ri.toString());
          data.put(f, Collections.singletonList(values));
        }

        if (e != null) {
          RenderingInfo ri = e.evaluate(data, getVisibleFeedProviders());
          setValueAt(ri == null ? "" : ri.getValueText(), i, FEED_VALUE_COLUMN);
        } else {
          setValueAt("No executor found", i, FEED_VALUE_COLUMN);
        }
      }
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.components.FeedProvider.RenderingInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.