Moddy Result Generator APIs¶
Sequence Diagrams¶
-
moddy.interactive_sequence_diagram.
gen_interactive_sequence_diagram
(sim, file_name, show_parts_list=None, excluded_element_list=None, show_var_list=None, refer_files=False, **kwargs)[source]¶ Moddy function to create sequence diagrams. The function is supposed to be called after the simulator has stopped. It takes the recorded events from the simulator instance.
Depending on the fmt parameter, either dynamic or static diagrams are generated.
- Parameters
sim (sim) – Simulator instance
file_name (str) – output filename (including filename extension
.html
)show_parts_list (list) – if given, show only the listed parts in that order in sequence diagram. Each element can be either a reference to the part or a string with the hierarchy name of the part. if omitted, show all parts known by simulator, in the order of their creation
show_var_list (list) – List of watched variables to include in the sequence diagram. Each element must be a string with the variable hierarchy name. event.g. “VC.var1”. If omitted, no variables are included.
excluded_element_list (list) –
parts or timers that should be excluded from drawing Each list element can be the object to exclude or one of the following: - ‘allTimers’ - exclude all timers
NOTE: Unlike in show_parts_list, strings with hierarchy names are not yet supported
refer_files – Include references to .css and .js file instead of including them
**kwargs –
further arguments
title - Title text to be displayed above the sequence diagram
timePerDiv - time per “Time Div”.
pixPerDiv=25 - pixels per time grid division. Optional, default:25. Note: The interactive viewer dynamically adjust the time scale depending on the current time scale factor and uses * timePerDiv* and pixPerDiv only as an hint for the initial scale factor.
partSpacing=300 - horizontal spacing in pixels between parts. (start value)
partBoxSize = (100,60) - Tupel with x,y pixel size of part box. Note: The interactive viewer dynamically adjust the part box size according to the length of the part names.
statusBoxWidth=20 - pixel width of status box on life line
variableBoxWidth=150 - pixel width of watched variable value box on life line
varSpacing = 180 - pixels between variables
Trace Tables¶
-
moddy.trace_to_csv.
gen_trace_table
(sim, file_name, **kwargs)[source]¶ Moddy high level function to create trace tables as .csv.
- Parameters
sim (sim) – Simulator instance
file_name – output filename (including .csv)
kwargs –
further arguments
time_unit=”s” - time unit for all time stamps in table (‘s’, ‘ms’, ‘us’, ‘ns’)
float_comma=’,’ - Comma character for float numbers
Structure Graph¶
-
moddy.dot_structure.
gen_dot_structure_graph
(sim, file_name, keep_gv_file=False)[source]¶ Generate a graph of the model structure using the GraphViz dot tool
- Parameters
sim (sim) – Simulator instance
file_name – the relative filename including ‘.svg’
keep_gv_file – if True, don’t delete graphviz input file