Package gov.nasa.arc.mct.components

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


        f.setAccessible(true);
        FeedRenderingPool rp = (FeedRenderingPool) f.get(fv1);
        rp.cancelTimer();
        final String feedId = "f1";
        FeedView fv2 = Mockito.mock(FeedView.class);
        FeedProvider fp2 = Mockito.mock(FeedProvider.class);
        Mockito.when(fp2.getSubscriptionId()).thenReturn(feedId);
        Mockito.when(fp2.toString()).thenReturn("fp2 : " + feedId);
        Mockito.when(fp2.getTimeService()).thenReturn(timeService);
        Mockito.when(fv2.getVisibleFeedProviders()).thenReturn(Collections.singleton(fp2));
       
        feedId1.set(feedId);
        Assert.assertEquals(fv1.getVisibleFeedProviders().iterator().next().getSubscriptionId(), feedId);
        Assert.assertEquals(fv1.getVisibleFeedProviders().iterator().next().getSubscriptionId().compareTo(fv2.getVisibleFeedProviders().iterator().next().getSubscriptionId()),0);
View Full Code Here


            w.dispose();
        }
        Assert.assertTrue(Window.getWindows().length == 0);
        Collection<FeedProvider> providers = new ArrayList<FeedProvider>(3000);
        for (int i = 0; i < 3001; i++) {
            FeedProvider fp = Mockito.mock(FeedProvider.class);
            Mockito.when(fp.getSubscriptionId()).thenReturn(Integer.toString(i));
            providers.add(fp);
        }
        Mockito.when(fv1.getVisibleFeedProviders()).thenReturn(providers);
        pool.cancelTimer();
        pool = new FeedRenderingPool(10000) {
View Full Code Here

  private List<FeedProvider> getFeedProviders(AbstractComponent component) {

    List<FeedProvider> feedProviders = new ArrayList<FeedProvider>(
        component.getComponents().size());
    for (AbstractComponent referencedComponent : component.getComponents()) {
      FeedProvider fp = referencedComponent.getCapability(
          FeedProvider.class);
      if (fp != null) {
        feedProviders.add(fp);
      }
    }
View Full Code Here

  private void updateFeedProviders() {
    ArrayList<FeedProvider> feedProviders = new ArrayList<FeedProvider>();
    timeConversionMap.clear();
    for (AbstractComponent component : telemetryElements) {
      if (component != null) {
        FeedProvider fp = getFeedProvider(component);
        if (fp != null) {
          feedProviders.add(fp);
          TimeConversion tc = component.getCapability(TimeConversion.class);
          if (tc != null) {
            timeConversionMap.put(fp.getSubscriptionId(), tc);
          }             
        } else {
          if (component.getCapability(Evaluator.class) != null) {
            for (AbstractComponent referencedComponent : component.getComponents()) {
              fp = getFeedProvider(referencedComponent);
View Full Code Here

          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);
              }
            }
          } catch (ClassCastException ex) {
            logger.error("Feed data entry of unexpected type",
View Full Code Here

             highestPriorityAll = null;
      int highestPriorityInvalidClass = Integer.MAX_VALUE,
          highestPriorityAllClass = Integer.MAX_VALUE;
      String lastOnValue = null;
      for (String feedId : feedValues.keySet()) {
        FeedProvider fp = getFeedProvider(feedId, feedProviders);
        FeedProvider.RenderingInfo feedValue = null;
        if (fp != null) {
          feedValue = getSingleFeedValue(feedProviders, data, feedId);
        }
        int currentPriority = getPriority(data,fp);
View Full Code Here

    // if this is identified as a performance hotspot, then cache this list and recreate when
    // children are added or deleted
    List<AbstractComponent> components = getManifestedComponent().getComponents();
   
    List<FeedProvider> providers = new ArrayList<FeedProvider>(components.size() + 1);
    FeedProvider fp = getFeedProvider(getManifestedComponent());
    if (fp != null) {
      providers.add(fp);
    }
    for (AbstractComponent component : components) {
      fp = getFeedProvider(component);
View Full Code Here

      expressions = expressionList;
    }
   
    private FeedProvider.RenderingInfo getValueFromFeed(List<FeedProvider> providers, Map<String, List<Map<String, String>>> data) {
      FeedProvider.RenderingInfo result = null;
      FeedProvider provider = providers.get(0);
      String feedId = provider.getSubscriptionId();
      List<Map<String,String>> values = data.get(feedId);
      if (values != null) {
        result = provider.getRenderingInfo(values.get(values.size() - 1));
      }
     
      return result;
    }
View Full Code Here

   
    robot = BasicRobot.robotWithCurrentAwtHierarchy();
    tList = new ArrayList<AbstractComponent>();
    tList.add(ac);
   
    FeedProvider mockfp = Mockito.mock(FeedProvider.class);
    Mockito.when(mockExpManifestation.getExpressions()).thenReturn(ruleList);
    Mockito.when(ruleList.size()).thenReturn(2);
    Mockito.when(mockExpManifestation.getMulti()).thenReturn(mc);
    Mockito.when(mc.getData()).thenReturn(multiData);
    Mockito.when(ac.getExternalKey()).thenReturn("isp:PARAMETER1");
    Mockito.when(ac.getCapability(FeedProvider.class)).thenReturn(mockfp);
    Mockito.when(mockfp.getSubscriptionId()).thenReturn("isp:PARAMETER1");
    Mockito.when(multiData.isPassThrough()).thenReturn(false);
    Mockito.when(mc.getComponents()).thenReturn(Collections.<AbstractComponent>emptyList());
   
    Mockito.when(mockExpManifestation.getSelectedTelemetry()).thenReturn(ac);
    Mockito.when(mockExpManifestation.getTelemetry()).thenReturn(tList);
View Full Code Here

        Request r = new Request(start,end);
        Set<FeedProvider> providers = new HashSet<FeedProvider>();
        Map<FeedProvider,Request> expectedMaxValues = new HashMap<FeedProvider,Request>();
        Set<Request> expectedRequests = new HashSet<Request>();
        for (int i = 0; i < maxTimes.length; i++) {
            FeedProvider fp = Mockito.mock(FeedProvider.class);
            Mockito.when(fp.getValidDataExtent()).thenReturn(maxTimes[i]);
            Mockito.when(fp.getMaximumSampleRate()).thenReturn(1);
            Mockito.when(fp.getSubscriptionId()).thenReturn("feed"+i);
            providers.add(fp);
            expectedMaxValues.put(fp, new Request(start,expectedTimes[i]));
            expectedRequests.add(new Request(start, expectedTimes[i]));
        }
        requestSet.put(r, providers);
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.