Changeset 95:ed8d661e287f in finroc_plugins_data_ports


Ignore:
Timestamp:
09.02.2015 23:31:32 (5 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

SetDefault() now propagates values to already connected cheap copy ports. This is the same behaviour as standard ports have.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • api/tPortImplementation.h

    r70 r95  
    265265    rrlib::rtti::tGenericObjectWrapper<typename tBase::tPortBuffer> wrapper(buffer); 
    266266    port.SetDefault(wrapper); 
     267    port.ApplyDefaultValue(); 
    267268  } 
    268269#endif 
     
    305306    rrlib::rtti::tGenericObjectWrapper<T> wrapper(t); 
    306307    port.SetDefault(wrapper); 
     308    port.ApplyDefaultValue(); 
    307309  } 
    308310}; 
  • optimized/tSingleThreadedCheapCopyPortGeneric.cpp

    r69 r95  
    108108void tSingleThreadedCheapCopyPortGeneric::ApplyDefaultValue() 
    109109{ 
    110   if (default_value) 
    111   { 
    112     current_value.data->DeepCopyFrom(*default_value); 
    113   } 
     110  if (!default_value) 
     111  { 
     112    FINROC_LOG_PRINT(ERROR, "No default value has been set. Doing nothing."); 
     113    return; 
     114  } 
     115  BrowserPublishRaw(*default_value, rrlib::time::cNO_TIME, true); 
    114116} 
    115117 
Note: See TracChangeset for help on using the changeset viewer.