Automotive Assessment Workflow Tool

The automotive assessment tool allows users to tag crash test models in PRIMER with details about the crash test type and the occupants in the model.

These details are used in T/HIS to carry out assessments on the occupants following the rules from different regulations.

This document describes how the tool works in PRIMER and how the code is organised. The documentation for T/HIS can be found here.

Primer menus

Introduction

In PRIMER the tool is used to tag crash test models with details about the crash test type, the model unit system, the occupants in the model and the IDs of entities that will be used to extract data from in T/HIS.

How to use the Workflow Tool

A model with occupants first needs to be loaded in PRIMER and then the automotive tool should be selected from the Workflow menu. This will open a window that allows the user to tag the model with details about the crash test type and the occupants in the model.

Primer menus

Select the crash test type from the first drop down menu.

Primer menus

Select the model unit system from the second drop down menu.

Primer menus

Press the Add button to open a new window to enter the details for each occupant.

Primer menus

In the occupant window, set the occupant version, its position, whether it is in the front or rear of the vehicle and the side it's on from the drop down menus at the top of the window.

Primer menus

You now need to enter the IDs of the entities that will be used to extract data in T/HIS. These can be populated by reading the default IDs for the selected occupant from a csv file in the "$OA_INSTALL\reporter_library\templates\dummy_info" directory. The csv filename relevant to the selected occupant will be selected automatically when the occupant version is selected, but you also have the option to select a different one if required. An offset can be applied to the IDs read from the csv file. Press the Import IDs button to populate the IDs in the text boxes.

If the ID doesn't exist in any of the models loaded in PRIMER, the textbox will be coloured red to indicate this.

Primer menus

Alternatively the IDs can be selected manually, either by entering the IDs directly into the textbox, selecting/picking them from the graphics window or by selecting them from a list of database histories by right-clicking on the textbox.

Primer menus

Once all the entities have been selected press the Add button at the top of the window to add the occupant.

Primer menus

This will add a new row to the table of occupants on the main window. You can edit or delete it by right-clicking on it.

Primer menus

Repeat the process for each occupant in the model and then either save the data to a JSON file by pressing the Save To File button or save it as post *END data in the model keyword file by pressing the Save To Model button. Note, that if you save it as post *END data you also need to write the keyword file out from PRIMER from the model->write menu as the tool only writes the data to memory and it is up to the user to write it out to the keyword file.

How the code works

GUI

The GUI is imported from the pre_automotive_assessment_gui.jsi file written out from the GUI Builder. It has been slightly modified to include a call to export the gui object so that it can be imported as a module into the main pre_automotive_assessment.js file (rather than using the Use() function), which is where all the GUI processing is done.

The data required to populate the drop down menus and create the labels and textboxes used to select the entities is obtained from classes defined in the modules/shared directory. Each class is described next.

CrashTest Class

The CrashTest class is used to hold data about each crash test we want to support.

In PRIMER it is used to get a list of all the different crash test types we support (CrashTest.GetAll()) to populate the drop down menu in the main window.

WorkflowOccupant Class

The WorkflowOccupant class is used to hold data about an occupant.

A workflow occupant instance holds data about the occupant version, whether it's a driver or passenger, whether it's in the front/rear position, the side it's seated on and the body parts it contains.

In PRIMER it's used for a few things:

  1. to generate a list of all the occupant versions (WorkflowOccupant.Versions()) to populate the drop down menu in the occupant window.
  2. to generate a list of all the occupant positions (WorkflowOccupant.Positions()) to populate the drop down menu in the occupant window.
  3. to generate a list of all the occupant sides (WorkflowOccupant.Sides()) to populate the drop down menu in the occupant window.
  4. to generate a list of all the front/rear positions (WorkflowOccupant.FrontRear()) to populate the drop down menu in the occupant window.
  5. to get the body parts and entities of each occupant version we support to create the widgets for selecting the entities. This uses the WorkflowOccupant.CreateWorkflowOccupant() function to create a workflow occupant instance for each version that we support, populated with the OccupantBodyParts relevant to each version, which in turn are populated with the relevant OccupantEntities.

OccupantBodyPart Class

The OccupantBodyPart class is used to hold data about an occupant body part.

OccupantBodyPart instances are referred to from the WorkflowOccupant class and hold data about the body part type (HEAD, NECK, etc) and the entities that make up the body part.

In PRIMER it's used when looping over the body parts of each occupant version to create the widgets for selecting the entities.

OccupantEntity Class

The OccupantEntity class is used to hold data about an occupant entity.

OccupantEntity instances are referred to from the OccupantBodyPart class and hold data about the entity type (NODE, BEAM, etc), the entity ID, the name of the entity, a tag used to identify it in the csv file which contains the default IDs (in SOURCE/reporter_dir/library/templates/dummy_info) and the raw measurements that can be extracted from the entity.

In PRIMER it's used when looping over the entities of each body part to create the widgets for selecting the entities.

It is also used to pick and select the entities from the graphics window with the OccupantEntity.Select() and OccupantEntity.Pick() functions.

Measurement Class

The Measurement class is used to hold data about a measurement. It is referred to from the OccupantEntity class to specify what measurements can be read from it.

The WorkflowOccupant.ReadRawBodyPartMeasurements() function uses the measurements specified on the OccupantEntity to extract the data from it in T/HIS. The results are returned in a BodyPartMeasurementCurves instance and the curve for each measurement can be retrieved using BodyPartMeasurementCurves.GetCurve() with the measurement name as the argument.

Class hierachy

This diagram shows the relationship between the WorkflowOccupant, OccupantBodyPart and OccupantEntity classes:

Occupant Classes

OccupantEntityWidgets Class

The OccupantEntityWidgets class is used to store all the widgets used to select the entities for an occupant.

Each instance holds data about the occupant version and a list of body part widgets.

BodyPartEntityWidgets Class

The BodyPartEntityWidgets class is used to store all the widgets used to select the entities for a body part.

Each instance holds data about the label widget at for the body part and a list of entity widgets.

EntityWidgets Class

The EntityWidgets class is used to store all the widgets used to select an entity.

Each instance holds data about the entity type, the label widget, the textbox widget and a tag used to identify it in the csv file which contains the default IDs.

This diagram shows the relationship between the OccupantEntityWidgets, BodyPartEntityWidgets and EntityWidgets classes:

Occupant Entity Classes

How to add a new occupant version

If a new occupant version is required, the following steps need to be taken to add it:

If a new occupant version is required you simply need to create a new occupant json and save it in the occupants folder.

The simplest way to do this is to make a copy then rename it and change the values of the properties to reflect the new occupant. The steps to follow are:

  1. Copy an existing json file e.g. Humanetics HIII 50M v1.5.1.json.
  2. Rename the file for the new occupant and save it in the appropriate subdirectory (e.g. "/HUMANETICS/HIII/50M/").
  3. Change the values of the properties in the json file to reflect the new occupant (note if there have been no major changes since the previous version then you may only need to update the "version" field.
  4. Save the file and run the automtivr assessmen workflow tool in PRIMER and check that the new occupatn appears correctly in the dropdown when trying to add a new occupant.

How to add a new body part type

If a new body part type is required, the following steps need to be taken to add it:

  1. Add a class constant to the OccupantBodyPart class for the name of the body part type. For an example search for HEAD.
  2. Add it to the array returned by OccupantBodyPart.BodyPartTypes().
  3. Add logic to the WorkflowOccupant.CreateWorkflowOccupant() function to create the OccupantEntity instances for each occupant version.

How to add a new entity type

If a new entity type is required, the following steps need to be taken to add it:

  1. Add a class constant to the OccupantEntity class for the name of the entity type. For an example search for BEAM_BASIC. The value of the constant needs to be the string used in the T/HIS dialogue command "/MODEL DATA <entity_type>" for extracting data from an entity, e.g. "beam basic" for beams.
  2. Add it to the array returned by OccupantEntity.EntityTypes().
  3. Add logic to the OccupantEntity.Pick() and OccupantEntity.Select() functions to pick and select the entities from the graphics window.
  4. Add a class constant to the OccupantEntity class for the tag used to identify the entity in the csv file which contains the default IDs. For an example search for HEAD_NODE. The value of the constant needs to be match the tag in the csv file (in SOURCE/reporter_dir/library/templates/dummy_info).
  5. Add it to the array returned by OccupantEntity.EntityTags().

How to add a new measurement type

If a new Measurement type is required, the following steps need to be taken to add it:

  1. Add a class constant to the Measurement class for the name of the measurement type. For an example search for X_ACCELERATION. The value of the constant can be anything you want so long as it's different from all the other measurement types.
  2. Add it to the array returned by Measurement.GetAllMeasurementNames().

How to add a new crash test type

  1. Add a class constant to the CrashTest class for the name of the crash test type. For an example search for ODB.
  2. Add it to the array returned by CrashTest.GetAll().
  3. Add the test to the switch statement in Protocol.GetViscousCriterionConstants().
  4. Add the test to the switch statement in Protocol.HICWindow() for each regulation that has the test.
  5. Add the test to the switch statement in Protocol.Versions() for each regulation that has the test.
  6. Add the test to the switch statement in Protocol.AssessmentTypes() for each regulation that has the test.