Table of Contents

Class CoherenceInputDebugger

Namespace
Coherence.Toolkit
Assembly
Coherence.Toolkit.dll
public class CoherenceInputDebugger
Inheritance
CoherenceInputDebugger

Constructors

CoherenceInputDebugger(CoherenceInputManager, Action<string>)

public CoherenceInputDebugger(CoherenceInputManager inputManager, Action<string> onDataDump = null)

Parameters

inputManager CoherenceInputManager
onDataDump Action<string>

Fields

DEBUG_CONDITIONAL

public const string DEBUG_CONDITIONAL = "COHERENCE_INPUT_DEBUG"

Field Value

string

OnDump

Called by the Dump() method, right after serialization. Contains all the debug data in a JSON format.

public Action<string> OnDump

Field Value

Action<string>

Properties

FramesToKeep

Number of last frames to keep in the debugger memory. If null, all frames are kept.

public int? FramesToKeep { get; set; }

Property Value

int?

Methods

AcknowledgeFrame(long)

Marks inputs from a given frame as acknowledged.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void AcknowledgeFrame(long frame)

Parameters

frame long

AddEvent(Event, object)

Stores an input related event in this frame's sample.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void AddEvent(CoherenceInputDebugger.Event inputEvent, object eventData)

Parameters

inputEvent CoherenceInputDebugger.Event
eventData object

AddEvent(string, object)

Stores an input related event in this frame's sample.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void AddEvent(string inputEvent, object eventData)

Parameters

inputEvent string
eventData object

AddInput(CoherenceInput, string)

Registers new input in the debugger. The following data is recorded for registered inputs:

* Received inputs

* Sent inputs

* Input buffer state for each frame

[Conditional("COHERENCE_INPUT_DEBUG")]
public void AddInput(CoherenceInput input, string id)

Parameters

input CoherenceInput
id string

AddInputs(long, IEnumerable<DebugInput>, bool)

Adds or updates an input to the sample from a given frame.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void AddInputs(long frame, IEnumerable<DebugInput> inputs, bool simulationEnabled)

Parameters

frame long
inputs IEnumerable<DebugInput>
simulationEnabled bool

AddState(long, object)

Adds or updates a state in the sample from a given frame.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void AddState(long frame, object state)

Parameters

frame long
state object

Dump()

Serializes the debug data to a JSON and dumps it using the OnDump event. By default the dump is saved to a file that starts with 'inputDbg_', in a executable directory.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void Dump()

HandleInputReceived(CoherenceInput, long, object)

Adds an input receive event to the sample.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void HandleInputReceived(CoherenceInput coherenceInput, long frame, object input)

Parameters

coherenceInput CoherenceInput
frame long
input object

HandleInputSent(CoherenceInput, long, object)

Adds an input send event to the sample.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void HandleInputSent(CoherenceInput coherenceInput, long frame, object input)

Parameters

coherenceInput CoherenceInput
frame long
input object

PushSample()

Stores the last sample if the current frame has changed.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void PushSample()

RemoveInput(CoherenceInput)

Removes a input from the debugger.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void RemoveInput(CoherenceInput input)

Parameters

input CoherenceInput

SetInputBufferStates()

Stores input buffer states for all registered inputs.

[Conditional("COHERENCE_INPUT_DEBUG")]
public void SetInputBufferStates()