XCP

Overview

GWv4 features XCP / A2L support if an XCP license is installed.

Contents

Subsections of XCP

A2L Unit Groups

Support Predefined Unit Conversions

GWv4 offers conversion of units in the user interface from the units specified in the A2L file, where possible.

There can be some ambiguity for units and some units of the same type may require independent grouping for conversions in GWv4.

Unit Quantity

The ’type’ of a unit such as G-Force (g) or Mass (g) is important. Units may be specified in the A2L file in GWv4 format.

acceleration:G
mass:g

This deviates from the ASAM A2L specification but may be convenient for your application.

Alternatively, an annotation field can be added to the object specifying the unit to keep the unit field clean for use with other applications:

\begin ANNOTATION
    ANNOTATION_ORIGIN "UnitQuantity"
    ANNOTATION_LABEL "pressure"
\end

Unit Selection Grouping

Whilst it may be acceptable in most cases to control all temperature units via a single selection, there may be other items that want to have different units for the same quantity.

For example, it may be preferred to have some pressures in kPa and others in Bar, depending upon the expected range. See Pressure Units and WGT Units below.

The units format allows for a group to be specified if desired:

pressure:bar:WGT

These will show up in the units selection dialog as WGT Units.

Alternatively, a group name may be specified in an annotation field of the A2L object.

A2L supports multiple ANNOTATION fields:

    \begin ANNOTATION
        ANNOTATION_ORIGIN "UnitGroup"
        ANNOTATION_LABEL "Pressure"
    \end
    \begin ANNOTATION
        ANNOTATION_ORIGIN "UnitQuantity"
        ANNOTATION_LABEL "pressure"
    \end

If a group name is not specified, then a unit quantity will be checked for from the predefined units.

"Β°C" => "temperature:C" => quantity is temperature.

If this quantity does not already have a unit selected for it then the display name of the quantity will be used:

temperature:C => Temperature Units.

If the quantity does already have a unit selected for it but the unit being added is not the same one as previously seen then a new group will be created with a numerical suffix:

β€œΒ°F” => temperature:F => Temperature2 Units.

Extending the Predefined Units

It is possible to add new units to tab layout files.

This is supported through a configuration file that can be loaded / saved, and is in json5 format

{
    quantities:{
        mass: { // Existing Predefined Quantity
             units: {
                 // Add β€˜suns’ unit, relative to kg.
                 // The default base unit of mass is g which is what the unit would 
                 // be scaled relative to if β€˜rel’ were not specified.
                 suns:{name:"Suns", m:0.0000000000000000000000000000005, rel:"kg"}
             }
        },
        cpuperf:{
            name:"CPU Performance",
            units: {
                // base unit is FLOPS. Units are scaled relative to this unless specified by β€˜rel’
                flops:{name: "FLOPS"}, 
                kflops:{name: "Kilo FLOPS", unit: "KFLOPS", m:0.001},
                mflops:{name: "Mega FLOPS", unit: "MFLOPS", m:0.000001},
                gflops:{name: "Giga FLOPS", unit: "GFLOPS", m:0.000000001},
                tflops:{name: "Tera FLOPS", unit: "TFLOPS", m:0.0000000000001},
                pflops:{name: "Peta FLOPS", unit: "PFLOPS", m:0.000000000000001},
                eflops:{name: "Exa FLOPS", unit: "EFLOPS", rel: "PFLOPS", m:0.001}
            }
        }
    }
}

Extending the Predefined Units thorough the UI

The “Configure Units / Scaling” dialog has a new button:

“Define Units…”

This will bring up a ‘Define Units’ dialog.

Units and Quantities may be added/removed via +/- buttons.

The selected unit or quantity to be configured by clicking the configure button (wrench icon).

Adding a new item will pop up the configuration box. The configuration box will allow the display name and the script name to be specified for both quantities and units.

When configuring units, the display unit, linear scaling (m and c values) and the relative unit may be selected. The relative unit will default to the base unit.

The base unit will not allow configuration of the β€˜m’ or β€˜c’ values which will be fixed as β€˜1’ and β€˜0’ (identity).

Quantities and units must have unique names and script names (units must only be unique within a given quantity).

The remove button is be disabled if there is no selection or if the item is predefined.

Additionally, the remove button is disabled for units that are used as a relative unit.

The default base unit may not be removed if there are any other units defined.

Load / Save Unit Configuration File

The unit configuration file can be loaded or saved from the Unit Selection Dialog.

Loading of units offers to merge or replace the existing user defined units (if any and if the merge would result in any changes).

Storage

Unit configurations are stored in layout files.

A2L SI units

At present, A2L UNIT is not supported.