Changeset 142:a4faa8b213e9 in finroc_plugins_structure


Ignore:
Timestamp:
18.10.2020 21:25:17 (7 weeks ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Parents:
139:071e1f828c9d (diff), 141:357b3b9eaeb6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Tags:
tip
Message:

Merge with 17.03

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main_utilities.cpp

    r120 r142  
    113113bool enable_crash_handler = true; 
    114114#endif 
     115rrlib::time::tTimeMode time_mode = rrlib::time::tTimeMode::STEADY_INITIAL_SYSTEM_TIME; 
    115116 
    116117// We do not use stuff from rrlib_thread, because we have the rare case that in signal handler 
     
    189190  if (log_config->IsActive()) 
    190191  { 
    191     rrlib::logging::ConfigureFromFile(rrlib::getopt::EvaluateValue(log_config)); 
     192    rrlib::getopt::tOption offline(name_to_option_map.at("offline")); 
     193    bool set_offline = offline->IsActive(); 
     194    rrlib::logging::ConfigureFromFile(rrlib::getopt::EvaluateValue(log_config), set_offline); 
    192195  } 
    193196 
     
    314317  } 
    315318 
     319  // default clock 
     320  rrlib::getopt::tOption default_clock_option(name_to_option_map.at("default-clock")); 
     321  if (default_clock_option->IsActive()) 
     322  { 
     323    std::string mode = rrlib::getopt::EvaluateValue(default_clock_option); 
     324    if (mode == "system") 
     325    { 
     326      time_mode = rrlib::time::tTimeMode::SYSTEM_TIME; 
     327    } 
     328    else if (mode == "steady-initial-system-time") 
     329    { 
     330      time_mode = rrlib::time::tTimeMode::STEADY_INITIAL_SYSTEM_TIME; 
     331    } 
     332    else 
     333    { 
     334      FINROC_LOG_PRINT_STATIC(ERROR, "Option --default-clock needs to be either 'system' or 'steady-initial-system-time'"); 
     335      return false; 
     336    } 
     337  } 
    316338  return true; 
    317339} 
     
    366388  rrlib::getopt::AddFlag("profiling", 0, "Enables profiling (creates additional ports with profiling information)", &OptionsHandler); 
    367389  rrlib::getopt::AddFlag("disable-component-visualization", 0, "Disables component visualization (no dedicated visualization ports will be created)", &OptionsHandler); 
     390  rrlib::getopt::AddFlag("offline", 0, "Disables online services which would retard software startup time.", &OptionsHandler); 
     391  rrlib::getopt::AddValue("default-clock", 0, "Default clock used for processing timestamps and durations ('system' and 'steady-initial-system-time' (default))", &OptionsHandler); 
    368392} 
    369393 
     
    399423int InitializeAndRunMainLoop(const std::string &program_name) 
    400424{ 
     425  { 
     426    auto current_time_mode = rrlib::time::GetTimeMode(); 
     427    if (current_time_mode == rrlib::time::tTimeMode::SYSTEM_TIME && current_time_mode != time_mode) 
     428    { 
     429      rrlib::time::SetTimeMode(time_mode); 
     430    } 
     431  } 
     432 
    401433  core::tRuntimeEnvironment &runtime_environment = core::tRuntimeEnvironment::GetInstance(); 
    402434 
Note: See TracChangeset for help on using the changeset viewer.