TXTHTraceFileWriter

class osi_utilities.tracefile.txth_writer.TXTHTraceFileWriter[source]

Bases: TraceFileWriter

Writer for text human-readable OSI trace files (.txth).

Messages are stored in Google protobuf TextFormat, one after another.

open(path)[source]

Open a .txth trace file for writing.

Parameters:

path (Path) – Path to the output file. Must have .txth extension.

Returns:

True on success, False on failure.

Return type:

bool

write_message(message, topic='')[source]

Write a protobuf message in TextFormat.

Parameters:
  • message (Message) – The protobuf message to write.

  • topic (str) – Ignored for single-channel text files.

Returns:

True on success, False on failure.

Return type:

bool

close()[source]

Close the trace file.

Return type:

None

property written_count: int

Number of messages written so far.