Exemple #1
0
def _trace_state():
    """This method using the smtrace module to trace each registered proxy and
    generate a python trace script.  The proxies must be traced in the correct
    order so that no traced proxy refers to a proxy that is yet to be traced."""

    # Start trace
    smtrace.start_trace(CaptureAllProperties=True, UseGuiName=True)

    # Disconnect the smtrace module's observer.  It should not be
    # active while tracing the state.
    smtrace.reset_trace_observer()

    # Get proxy lists ordered by group
    proxy_lists = get_proxy_lists_ordered_by_group()

    # Now register the proxies with the smtrace module
    for proxy_list in proxy_lists:
        register_proxies_by_dependency(proxy_list)

    # Calling append_trace causes the smtrace module to sort out all the
    # registered proxies and their properties and write them as executable
    # python.
    smtrace.append_trace()

    # Stop trace and print it to the console
    smtrace.stop_trace()
    smtrace.print_trace()
def _trace_state():
    """This method using the smtrace module to trace each registered proxy and
    generate a python trace script.  The proxies must be traced in the correct
    order so that no traced proxy refers to a proxy that is yet to be traced."""

    # Start trace
    smtrace.start_trace(CaptureAllProperties=True, UseGuiName=True)

    # Get proxy lists by group.  Order is very important here.  The idea is that
    # we want to register groups of proxies such that when a proxy is registered
    # none of its properties refer to proxies that have not yet been registered.
    #
    # rules:
    #
    # scalar_bars refer to lookup_tables.
    # representations refer to sources and piecewise_functions
    # views refer to representations and scalar_bars

    proxy_groups = ["implicit_functions", "piecewise_functions",
                    "lookup_tables", "scalar_bars", "sources",
                    "representations", "views"]

    # Collect the proxies using a list comprehension
    get_func = servermanager.ProxyManager().GetProxiesInGroup
    proxy_lists = [get_func(proxy_group).values() for proxy_group in proxy_groups]

    # Now register the proxies with the smtrace module
    for proxy_list in proxy_lists:
        register_proxies_by_dependency(proxy_list)

    # Calling append_trace causes the smtrace module to sort out all the
    # registered proxies and their properties and write them as executable
    # python.
    smtrace.append_trace()

    # Stop trace and print it to the console
    smtrace.stop_trace()
    smtrace.print_trace()