TimeLaneExtension

class caqtus.extension.TimeLaneExtension(
label,
lane_type: type[L],
dumper: LaneDumper,
loader: LaneLoader,
lane_factory: LaneFactory,
lane_model_factory: LaneModelFactory,
lane_delegate_factory: LaneDelegateFactory = attr_dict['lane_delegate_factory'].default,
type_tag: str | None = attr_dict['type_tag'].default,
)

Bases: Generic

Define how to implement a time lane plugin.

label

An identifier for this type of lane to be displayed to the user.

Type:

str

lane_type

The type of lane to be created.

Type:

type[L]

dumper

A function to serialize the lane to JSON. When a lane with the corresponding type needs to be saved, this function will be called and the result will be stored. The returned value must be a dictionary that can be serialized to JSON. The dictionary will be added a “type” key to identify the lane type.

Type:

caqtus.types.timelane._serializer._implementation.LaneDumper

loader

A function to deserialize the lane from JSON. When JSON data with the corresponding “type” key is loaded, this function will be called to create a lane.

Type:

caqtus.types.timelane._serializer._implementation.LaneLoader

lane_factory

A factory function to create a new lane when the user wants to create a lane with this label. The factory will be called with the number of steps the lane must have.

Type:

caqtus.gui.condetrol.timelanes_editor.extension._implementation.LaneFactory

lane_delegate_factory

A factory function to create a delegate for the lane. The factory will be called when the lane is displayed in the editor. The delegate returned by the factory will be used for custom painting and editing of the lane. The default lane delegate factory returns None.

Type:

caqtus.gui.condetrol.timelanes_editor.extension._implementation.LaneDelegateFactory

lane_model_factory

A factory function to create a model for the lane. The model will be used to provide the data from the lane to the view.

Type:

caqtus.gui.condetrol.timelanes_editor.extension._implementation.LaneModelFactory