Changeset 71:e7746fedf724 in finroc_plugins_data_ports


Ignore:
Timestamp:
26.06.2014 16:53:42 (5 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Fix for data ports: unconnected (group) output ports with push strategy flag set now also cause values to be actually pushed to them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/tAbstractDataPort.cpp

    r46 r71  
    193193int16_t tAbstractDataPort::GetStrategyRequirement() const 
    194194{ 
    195   if (IsInputPort()) 
    196   { 
    197     if (GetFlag(tFlag::PUSH_STRATEGY)) 
    198     { 
    199       if (GetFlag(tFlag::USES_QUEUE)) 
    200       { 
    201         int qlen = GetMaxQueueLength(); 
    202         return static_cast<int16_t>((qlen > 0 ? std::min<int>(qlen, std::numeric_limits<int16_t>::max()) : std::numeric_limits<int16_t>::max())); 
    203       } 
    204       else 
    205       { 
    206         return 1; 
    207       } 
     195  if (GetFlag(tFlag::PUSH_STRATEGY)) 
     196  { 
     197    if (GetFlag(tFlag::USES_QUEUE)) 
     198    { 
     199      int qlen = GetMaxQueueLength(); 
     200      return static_cast<int16_t>((qlen > 0 ? std::min<int>(qlen, std::numeric_limits<int16_t>::max()) : std::numeric_limits<int16_t>::max())); 
    208201    } 
    209202    else 
    210203    { 
    211       return 0; 
     204      return 1; 
    212205    } 
    213206  } 
    214207  else 
    215208  { 
    216     return static_cast<int16_t>((IsConnected() ? 0 : -1)); 
     209    return static_cast<int16_t>((IsInputPort() || IsConnected() ? 0 : -1)); 
    217210  } 
    218211} 
Note: See TracChangeset for help on using the changeset viewer.