src/mesytec-mvlc/mvlc_readout_config.cc
/// Serializes a CrateConfig to YAML format.
Serializes a CrateConfig to YAML format.
Serializes a CrateConfig to YAML format .
std::string to_yaml(const CrateConfig &crateConfig)
{
    YAML::Emitter out;
    out << YAML::Hex;
    assert(out.good());
    out << YAML::BeginMap;
    out << YAML::Key << "crate" << YAML::Value << YAML::BeginMap;
    out << YAML::Key << "mvlc_connection" << YAML::Value << YAML::BeginMap;
    out << YAML::Key << "type" << YAML::Value << to_string(crateConfig.connectionType);
    out << YAML::Key << "usbIndex" << YAML::Value << std::to_string(crateConfig.usbIndex);
    out << YAML::Key << "usbSerial" << YAML::Value << crateConfig.usbSerial;
    out << YAML::Key << "ethHost" << YAML::Value << crateConfig.ethHost;
    out << YAML::Key << "ethJumboEnable" << YAML::Value << crateConfig.ethJumboEnable;
    out << YAML::EndMap; 
    out << YAML::Key << "readout_stacks" << YAML::Value << YAML::BeginSeq;
    for (const auto &stack: crateConfig.stacks)
        out << stack;
    out << YAML::EndSeq; 
    out << YAML::Key << "stack_triggers" << YAML::Value << crateConfig.triggers;
    out << YAML::Key << "init_trigger_io" << YAML::Value << crateConfig.initTriggerIO;
    out << YAML::Key << "init_commands" << YAML::Value << crateConfig.initCommands;
    out << YAML::Key << "stop_commands" << YAML::Value << crateConfig.stopCommands;
    out << YAML::Key << "mcst_daq_start" << YAML::Value << crateConfig.mcstDaqStart;
    out << YAML::Key << "mcst_daq_stop" << YAML::Value << crateConfig.mcstDaqStop;
    out << YAML::EndMap; 
    assert(out.good());
    return out.c_str();
}
std :: string to_yaml ( const CrateConfig & crateConfig ) { YAML :: Emitter out ; out << YAML :: Hex ; assert ( out . good ( ) ) ; out << YAML :: BeginMap ; out << YAML :: Key << " " << YAML :: Value << YAML :: BeginMap ; out << YAML :: Key << " " << YAML :: Value << YAML :: BeginMap ; out << YAML :: Key << " " << YAML :: Value << to_string ( crateConfig . connectionType ) ; out << YAML :: Key << " " << YAML :: Value << std :: to_string ( crateConfig . usbIndex ) ; out << YAML :: Key << " " << YAML :: Value << crateConfig . usbSerial ; out << YAML :: Key << " " << YAML :: Value << crateConfig . ethHost ; out << YAML :: Key << " " << YAML :: Value << crateConfig . ethJumboEnable ; out << YAML :: EndMap ; out << YAML :: Key << " " << YAML :: Value << YAML :: BeginSeq ; for ( const auto & stack : crateConfig . stacks ) out << stack ; out << YAML :: EndSeq ; out << YAML :: Key << " " << YAML :: Value << crateConfig . triggers ; out << YAML :: Key << " " << YAML :: Value << crateConfig . initTriggerIO ; out << YAML :: Key << " " << YAML :: Value << crateConfig . initCommands ; out << YAML :: Key << " " << YAML :: Value << crateConfig . stopCommands ; out << YAML :: Key << " " << YAML :: Value << crateConfig . mcstDaqStart ; out << YAML :: Key << " " << YAML :: Value << crateConfig . mcstDaqStop ; out << YAML :: EndMap ; assert ( out . good ( ) ) ; return out . c_str ( ) ; }
Serializes a CrateConfig to YAML format.
Serializes a CrateConfig to YAML format .
// end mvlc_connection // end readout_stacks // end crate