THisHelper

THisHelper

Helper class to carry out tasks in T-HIS

Constructor

new THisHelper()

Source:

Members

(static) MAX_GRAPHS :number

Description:
  • Maximum number of graphs
Source:
Maximum number of graphs
Type:
  • number

(static) MAX_PAGES :number

Description:
  • Maximum number of pages
Source:
Maximum number of pages
Type:
  • number

Methods

(static) BlankAllCurves()

Description:
  • Blanks all the curves in all graphs
Source:
Example
THisHelper.BlankAllCurves();

(static) BlankAllDatums()

Description:
  • Blanks all the datums in all graphs
Source:
Example
THisHelper.BlankAllDatums();

(static) CaptureImage(fname)

Description:
  • Captures an image of Graph 1 (REPORTER templates always designed to capture Graph 1).
Source:
Parameters:
Name Type Description
fname string Image filename

(static) PutGraphsOnPage(graphs, page, remove_existing_graphs)

Description:
  • Put graphs on a page, removing any that are not required
Source:
Parameters:
Name Type Description
graphs Array.<number> Graph ids to put on page
page number Page to put graphs on
remove_existing_graphs boolean Switch whether to remove existing graphs from page

(static) PutGraphsOnSeparatePages(graphs, start_pageopt) → {number}

Description:
  • Puts graphs on separate pages
Source:
Parameters:
Name Type Attributes Default Description
graphs Array.<number> Graph ids to put on separate pages
start_page number <optional>
1 Page to start adding graphs on
Returns:
The last page id used
Type
number

(static) ReadData(model, entity_type, entity_id, component, blankopt) → (nullable) {Curve}

Description:
  • Reads data into a curve, returning null if it fails
Source:
Example
// Pass in the entity_type and entity_id parameters explicitly

let curve = THisHelper.ReadData(m, "node", 1, "AX");

// Typically you will use the OccupantEntity entity_type and
// id properties for the entity_type and entity_id parameters

let node_x = head.GetEntityByTag(OccupantEntity.HEAD_NODE);
let curve = THisHelper.ReadData(m, node_x.entity_type, node_x.id, "AX");
Parameters:
Name Type Attributes Default Description
model Model Model
entity_type string Entity type
entity_id string | number Entity ID (label of database history name)
component string Component name (used in dialogue command)
blank boolean <optional>
false Flag to blank the curve after reading it
Returns:
Type
Curve

(static) ScaleGraph(graph_id, assessment_datumsopt)

Description:
  • Scales the graph to show the curves and datums in the graph This is different to just using the dialogue command "/AU" because it scales it so there is space above and below the curve. Also if assessment datums are passed to the function it will be scaled to show all the datums, again with space above and below.
Source:
Parameters:
Name Type Attributes Description
graph_id number Index of graph to scale
assessment_datums AssessmentDatums <optional>
Datums to show

(static) SetCurveLabels(curve, label, x_label, y_label)

Description:
  • Sets the labels on a curve
Source:
Example
THisHelper.SetLabels(curve, "My Curve", "Time (s)", "Acceleration (g)");
Parameters:
Name Type Description
curve Curve Curve to set labels on
label string Curve label
x_label string x-axis label
y_label string y-axis label

(static) SetGraphTitle(graph_id, title)

Description:
  • Sets the graph title
Source:
Parameters:
Name Type Description
graph_id number Index of graph
title string Title for graph

(static) SetLineStyle(curve, colour, styleopt, symbolopt)

Description:
  • Sets the line style of a curve
Source:
Example
// Set style on one curve
THisHelper.SetLineStyle(curve, Colour.BLACK);

// Set style on multiple curves at the same time
THisHelper.SetLineStyle([curve1, curve2, curve3], Colour.BLACK);

// Set line style as well as colour on one curve
THisHelper.SetLineStyle(curve, Colour.BLACK, LineStyle.DASH);
Parameters:
Name Type Attributes Default Description
curve Curve | Array.<Curve> Curve or array of curves to set line style on
colour number Colour to set line to, e.g. Colour.BLACK
style number <optional>
LineStyle.SOLID Line style to set, e.g. LineStyle.DASH
symbol number <optional>
Symbol.NONE Symbol, e.g. Symbol.CROSS