osc_generator/helper_functions.py
def layer_setup_end_eval():
    """
    Set up OpenSCENARIO end evaluation KPIs layer
    """
    root_layer = QgsProject.instance().layerTreeRoot()
    osc_layer = root_layer.findGroup("OpenSCENARIO")
    if osc_layer is None:
        osc_layer = root_layer.addGroup("OpenSCENARIO")

    if not QgsProject.instance().mapLayersByName("End Evaluation KPIs"):
        end_eval_layer = QgsVectorLayer("None", "End Evaluation KPIs", "memory")
        QgsProject.instance().addMapLayer(end_eval_layer, False)
        osc_layer.addLayer(end_eval_layer)
        # Setup layer attributes
        data_attributes = [
            QgsField("Condition Name", QVariant.String),
            QgsField("Delay", QVariant.Double),
            QgsField("Condition Edge", QVariant.String),
            QgsField("Parameter Ref", QVariant.String),
            QgsField("Value", QVariant.Double),
            QgsField("Rule", QVariant.String)
        ]

        end_eval_layer.dataProvider().addAttributes(data_attributes)
        end_eval_layer.updateFields()

        message = "End evaluation KPIs layer added"
        display_message(message, level="Info")

    Set up OpenSCENARIO end evaluation KPIs layer
    
Set up OpenSCENARIO end evaluation KPIs layer
Set up OpenSCENARIO end evaluation KPIs layer
def layer_setup_end_eval():
    root_layer = QgsProject.instance().layerTreeRoot()
    osc_layer = root_layer.findGroup("OpenSCENARIO")
    if osc_layer is None:
        osc_layer = root_layer.addGroup("OpenSCENARIO")
    if not QgsProject.instance().mapLayersByName("End Evaluation KPIs"):
        end_eval_layer = QgsVectorLayer("None", "End Evaluation KPIs", "memory")
        QgsProject.instance().addMapLayer(end_eval_layer, False)
        osc_layer.addLayer(end_eval_layer)
        data_attributes = [
            QgsField("Condition Name", QVariant.String),
            QgsField("Delay", QVariant.Double),
            QgsField("Condition Edge", QVariant.String),
            QgsField("Parameter Ref", QVariant.String),
            QgsField("Value", QVariant.Double),
            QgsField("Rule", QVariant.String)
        ]
        end_eval_layer.dataProvider().addAttributes(data_attributes)
        end_eval_layer.updateFields()
        message = "End evaluation KPIs layer added"
        display_message(message, level="Info")
def layer_setup_end_eval ( ) : root_layer = QgsProject . instance ( ) . layerTreeRoot ( ) osc_layer = root_layer . findGroup ( "OpenSCENARIO" ) if osc_layer is None : osc_layer = root_layer . addGroup ( "OpenSCENARIO" ) if not QgsProject . instance ( ) . mapLayersByName ( "End Evaluation KPIs" ) : end_eval_layer = QgsVectorLayer ( "None" , "End Evaluation KPIs" , "memory" ) QgsProject . instance ( ) . addMapLayer ( end_eval_layer , False ) osc_layer . addLayer ( end_eval_layer ) data_attributes = [ QgsField ( "Condition Name" , QVariant . String ) , QgsField ( "Delay" , QVariant . Double ) , QgsField ( "Condition Edge" , QVariant . String ) , QgsField ( "Parameter Ref" , QVariant . String ) , QgsField ( "Value" , QVariant . Double ) , QgsField ( "Rule" , QVariant . String ) ] end_eval_layer . dataProvider ( ) . addAttributes ( data_attributes ) end_eval_layer . updateFields ( ) message = "End evaluation KPIs layer added" display_message ( message , level = "Info" )
Set up OpenSCENARIO end evaluation KPIs layer
Set up OpenSCENARIO end evaluation KPIs layer
"""
    Set up OpenSCENARIO end evaluation KPIs layer
    """ # Setup layer attributes