Protocol

Protocol

new Protocol(regulation, crash_test, version, vehicle, assessment_datumsopt)

Description:
  • Note you can create a protocol with no assessment_datums (e.g. empty array) which is useful when we do not need this data (e.g. PRIMER gui)
Source:
Example
let protocol = new ProtocolAssessment(Regulation.EuroNCAP, CrashTest.ODB, "7.1.2", []);
Parameters:
Name Type Attributes Default Description
regulation string Regulation, e.g. Regulation.CNCAP
crash_test string Crash test, e.g. CrashTest.ODB
version string Version, e.g. "7.1.2"
vehicle ProtocolVehicle class containing info about valid occupant types
assessment_datums Array.<AssessmentDatums> <optional>
[] Array of AssessmentDatums instances

Members

assessment_datums :Array.<AssessmentDatums>

Description:
  • Array of AssessmentDatums instances
Source:
Array of AssessmentDatums instances
Type:

crash_test :string

Description:
  • Protocol crash test
Source:
Protocol crash test
Type:
  • string

regulation :string

Description:
  • Protocol regulation
Source:
Protocol regulation
Type:
  • string

version :string

Description:
  • Protocol version
Source:
Protocol version
Type:
  • string

Methods

(static) CreateDefaultAssessmentDatums(regulation, crash_test, version) → {Array.<AssessmentDatums>}

Description:
  • Create AssessmentDatums for the given regulation, test and year These are read from the default.json file in the datums/[regulation]/[crash_test]/[assessment] directory
Source:
Example
let a = Protocol.CreateDefaultAssessmentDatums(Regulation.CNCAP, CrashTest.ODB, "7.1.2");
Parameters:
Name Type Description
regulation string Protocol regulation, e.g. Regulation.CNCAP
crash_test string Protocol crash test, e.g. CrashTest.ODB
version string Protocol version, e.g. "7.1.2"
Returns:
Type
Array.<AssessmentDatums>

(static) CreateDefaultProtocol(regulation, crash_test, version) → {Protocol}

Description:
  • Create a Protocol instance with the default AssessmentDatums for the given regulation, test and year
Source:
Example
let p = Protocol.CreateDefaultProtocol(Regulation.CNCAP, CrashTest.ODB, "7.1.2");
Parameters:
Name Type Description
regulation string Protocol regulation, e.g. Regulastion.CNCAP
crash_test string Protocol crash test, e.g. CrashTest.ODB
version string Version, e.g. "7.1.2"
Returns:
Type
Protocol

(static) FromJSON(json) → (nullable) {Protocol}

Description:
  • construct a Protocol from JSON
Source:
Parameters:
Name Type Description
json Object JSON of Protocol
Returns:
Type
Protocol

(static) FromJSONFile(filepath) → (nullable) {Protocol}

Description:
  • this constructs a protocol object from a filepath
Source:
Parameters:
Name Type Description
filepath string to a protocol json file
Returns:
Type
Protocol

(static) Versions(regulation, crash_test) → {Array.<string>}

Description:
  • Returns the versions we support for a regulation and crash test (Most recent version first)
Source:
Example
let versions = Protocol.Versions(Regulation.CNCAP, CrashTest.ODB);
Parameters:
Name Type Description
regulation string Regulation, e.g. Regulation.CNCAP
crash_test string Crash test, e.g. CrashTest.ODB
Returns:
Type
Array.<string>

GetDatumsByAssessment(assessment) → (nullable) {AssessmentDatums}

Description:
  • Returns the datums for the given assessment
Source:
Example
let assessment_datums = p.GetDatumsByAssessment(AssessmentType.NECK_EXTENSION);
for (let datum of assessment_datums.datums)
{
    datum.Plot();
}
Parameters:
Name Type Description
assessment string Assessment type, e.g. AssessmentType.NECK_AXIAL
Returns:
Type
AssessmentDatums

GetViscousCriterionConstants() → (nullable) {ViscousCriterionConstants}

Description:
  • Returns the Viscous Criterion Constants
Source:
Returns:
Type
ViscousCriterionConstants

HICWindow(occupant) → {number}

Description:
  • Returns the HIC window (in seconds) for the protocol and the given occupant
Source:
Example
// Get the HIC window to use for Protocol p and occupant o
let hic_window = p.HICWindow(o);
Parameters:
Name Type Description
occupant WorkflowOccupant Workflow occupant
Returns:
Type
number

OccupantAssessmentTypes(occupant, body_part_type) → {Array.<string>}

Description:
  • Returns the assessment types we support for the protocol and the given occupant and body part type
Source:
Example
let assessment_types = p.OccupantAssessmentTypes(o, OccupantBodyPart.NECK);
Parameters:
Name Type Description
occupant WorkflowOccupant Occupant
body_part_type string Occupant body part type
Returns:
Type
Array.<string>

StructureAssessmentTypes(structure) → {Array.<string>}

Description:
  • Returns the assessment types we support for the protocol and the given structure
Source:
Example
let assessment_types = p.StructureAssessmentTypes(s);
Parameters:
Name Type Description
structure Structure Structure
Returns:
Type
Array.<string>

toString() → {string}

Description:
  • String representation
Source:
Returns:
Type
string