The Curve class gives you access to curves in T/HIS. More...
The T/HIS JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Description |
| Curve.AFTER | Insertion of curve data option. |
| Curve.BEFORE | Insertion of curve data option. |
| Curve.Y1_AXIS | Y1 axis option. |
| Curve.Y2_AXIS | Y2 axis option. |
| Name | Type | Description |
| average (read only) | real | Curve average value |
| colour | integer | The Colour of the curve |
| directory | string | Directory the curve came from |
| entity_id | integer | The ID of the entity that the curve was generated from. |
| entity_type | integer | The Entity type that the curve was generated from |
| file | string | Filename the curve came from |
| hic (read only) | real | Curve HIC value - returns 0.0 if the HIC hasn't been calculated |
| hic_tmax (read only) | real | End of HIC time windows - returns 0.0 if the HIC hasn't been calculated |
| hic_tmin (read only) | real | Start of HIC time windows - returns 0.0 if the HIC hasn't been calculated |
| hicd (read only) | real | Curve HIC(d) value - returns 0.0 if the HIC(d) hasn't been calculated |
| hicd_tmax (read only) | real | End of HIC(d) time windows - returns 0.0 if the HIC(d) hasn't been calculated |
| hicd_tmin (read only) | real | Start of HIC(d) time windows - returns 0.0 if the HIC(d) hasn't been calculated |
| id (read only) | integer | Curve ID |
| is_null (read only) | integer | Returns 1 if the curve is NULL |
| label | string | Curve label |
| model | integer | The ID of the model that a curve was read from. |
| npoints (read only) | integer | Number of curve points |
| regr_rsq (read only) | real | Pearson's R^2 value for regression curve, returns 0.0 if the curve has not come from the regression operation. |
| regr_sdgrad (read only) | real | Standard deviation of the linear regression gradient value, returns 0.0 if the curve has not come from linear regression. |
| regr_sdicpt (read only) | real | Standard deviation of the linear regression intercept value, returns 0.0 if the curve has not come from linear regression. |
| regr_sdyx (read only) | real | Standard deviation of the linear regression values 'y = bx + c', returns 0.0 if the curve has not come from linear regression. |
| rms (read only) | real | Curve RMS value |
| style | integer | The LineStyle used to draw the curve |
| symbol | integer | The Symbol style for a curve |
| tag | string | Curve tag. If a FAST-TCF script is running then this is the FAST-TCF tag |
| title | string | Curve title |
| tms (read only) | real | 3ms Clip value - returns 0.0 if the 3ms Clip value hasn't been calculated |
| tms_tmax (read only) | real | End of 3ms clip time windows - returns 0.0 if the 3ms Clip hasn't been calculated |
| tms_tmin (read only) | real | Start of 3ms clip time windows - returns 0.0 if the 3ms Clip hasn't been calculated |
| unit_system | integer | The Curve UnitSystem |
| width | integer | The LineWidth used to draw the curve |
| x_at_ymax (read only) | real | X axis value at the Y axis maximum |
| x_at_ymin (read only) | real | X axis value at the Y axis minimum |
| x_axis_label | string | Curve X axis label |
| x_axis_unit | integer | The X axis Units |
| xmax (read only) | real | X axis maximum value |
| xmin (read only) | real | X axis minimum value |
| y_axis | integer | The Y axis used by the curve (Curve.Y1_AXIS or Curve.Y2_AXIS). (Note to turn on the display of the Y2 axis you need to set the show_y2axis on the graph to Graph.ON) |
| y_axis_label | string | Curve Y axis label |
| y_axis_unit | integer | The Y axis Units |
| ymax (read only) | real | Y axis maximum value |
| ymin (read only) | real | Y axis minimum value |
Detailed DescriptionThe Curve class allows you to create, modify, edit and manipulate curves. See the documentation below for more details. |
Constructornew Curve(lcid[integer], tag (optional)[string], Line label (optional)[string], X-axis label (optional)[string], Y-axis label (optional)[string])DescriptionCreate a new Curve object. The curve will be added to all the currently active graphs. |
Curve number
Tag used to reference the curve in FAST-TCF scripts
Line label for the curve
X-axis label for the curve
Y-axis label for the curve
ReturnsCurve object Return typeCurve |
ExampleTo create a new curve with label 200 var l = new Curve(200);
|
Details of functionsAddFlaggedToGraph(flag[Flag], graph (optional)[int]) [static]DescriptionAdds flagged curves to a graph. |
Flag to check on the curve
Graph to add the curve to. If undefined then the curve is added to all graphs.
This argument can be repeated if required
Alternatively a single array argument containing the multiple values can be given
ReturnsNo return value. |
ExampleTo add curves flagged with flag f to graphs 1 and 3: Curve.AddFlaggedToGraph(f,1,3); To add curves flagged with flag to all graphs: Curve.AddToGraph(f);
|
AddPoint(xvalue[real], yvalue[real])DescriptionAdds a point at the end of the curve. |
The x value of the point.
The y value of the point.
ReturnsNo return value. |
ExampleTo add the point x=3.5, y=5.5 to curve l: l.AddPoint(3.5,5.5);
|
AddToGraph(graph (optional)[int])DescriptionAdds a curve to a graph. |
Graph to add the curve to. If undefined then the curve is added to all graphs.
This argument can be repeated if required
Alternatively a single array argument containing the multiple values can be given
ReturnsNo return value. |
ExampleTo add a curve (c) to graphs 1 and 3: c.AddToGraph(1,3); To add a curve (c) to all graphs: c.AddToGraph();
|
ClearFlag(flag[integer])DescriptionClears a flag on the curve. |
Flag to clear on the curve
ReturnsNo return value |
ExampleTo clear flag f for curve l: l.ClearFlag(f);
|
Copy(source[integer], target[integer]) [static]DescriptionCopies a curve. |
ID of curve to copy from
ID of curve to copy to
ReturnsNo return value |
ExampleTo copy curve 1 to curve 4: Curve.Copy(1,4); To copy curve a to curve b, Curve.Copy(a.id,b.id);
|
Delete(curve[integer]) [static]DescriptionDeletes a curve |
ID of curve to delete
ReturnsNo return value |
ExampleTo delete curve n Curve.Delete(n);
|
DeleteFlagged(flag[Flag]) [static]DescriptionDeletes flagged curves |
Flag to check on the curve
ReturnsNo return value |
ExampleTo delete curves flagged with flag f Curve.DeleteFlagged(f);
|
DeletePoint(ipt[integer])DescriptionDeletes a point in a curve. The input for the point number should start at 1 for the 1st point not zero. |
The point you want to insert the data before or after.
ReturnsNo return value. |
ExampleTo delete the 3rd point in curve l: l.DeletePoint(3);
|
Exists(curve[integer]) [static]DescriptionChecks if a curve exists |
ID of curve to check
ReturnsTRUE if the curve exists, otherwise FALSE Return typeBoolean |
ExampleTo check if a curve n exists var exists = Curve.Exists(n);
|
First() [static]DescriptionReturns the first curve. |
No arguments
ReturnsCurve object (or null if there are no more curves in the model). Return typeCurve |
ExampleTo get the 1st curve var curve = Curve.First();
|
FirstFreeID() [static]DescriptionReturns the ID of the first free curve. |
No arguments
ReturnsID of first unsued curve. Return typeNumber |
ExampleTo get the ID of the first free curve: var curve = Curve.FirstFreeID();
|
FirstID() [static]DescriptionReturns the ID of the first curve. |
No arguments
ReturnsID of the first curve defined. Return typeNumber |
ExampleTo get the 1st curve var curve = Curve.FirstID();
|
FlagAll(flag[integer]) [static]DescriptionFlags all of the curves with a defined flag |
Flag to set on the curves
ReturnsNo return value |
ExampleTo flag all of the curves with flag f: Curve.FlagAll(f);
|
Flagged(flag[integer])DescriptionChecks if the curve is flagged or not. |
Flag to check on the curve
Returnstrue if flagged, false if not. Return typeBoolean |
ExampleTo check if curve d has flag f set on it: if (d.Flagged(f) ) do_something...
|
Freeze(graph[integer], Freeze option[integer])DescriptionFreezes an unblanked curve on one or all graphs. |
Graph number to freeze curve on or 0 for all graphs.
No argument or 1 to freeze the curve, 0 to unfreeze.
ReturnsNo return value |
ExampleTo freeze a curve c on graph 3: c.Freeze(3,1)
|
GetFlagged(flag[Flag]) [static]DescriptionReturns an array of all curves flagged with a given flag. |
Flag for which to return flagged objects.
ReturnsArray of Curve objects (or null if no curves are flagged) Return typeArray |
ExampleTo get the curves flagged with flag f: var curve_array = Curve.GetFlagged(f);
|
GetFromID(ID[integer]) [static]DescriptionReturns the curve object for a curve ID. |
ID of curve to return object for
ReturnsCurve object (or null if the curve does not exist. Return typeCurve |
ExampleTo get the curve n var curve = Curve.GetFromID(n);
|
GetFromTag(TAG[string]) [static]DescriptionFinds a curve from it's Tag. This function is only available when running a Javascript from within a FAST-TCF script |
TAG of curve to return object for
ReturnsCurve object (or null if there are no free curves). Return typeCurve |
ExampleTo get the curve with a tag "tag" var curve = Curve.GetFromTag(tag);
|
The point you want the data for.
ReturnsArray of point values Return typearray |
ExampleTo get the curve data for the 3rd point for curve l: if (l.npoints >= 3)
{
var point_data = l.GetPoint(3);
}
|
HighestID() [static]DescriptionReturns the ID of the highest curve currently being used |
No arguments
ReturnsID of highest curve currently being used. Return typeNumber |
ExampleTo get the highest curve ID var id= Curve.HighestID();
|
InsertPoint(ipt[integer], xvalue[real], yvalue[real], position[integer])DescriptionInserts a new point before or after the specified point. |
The point you want to insert the data before or after.
The x value of the point.
The y value of the point.
Specify either before or after the selected pioint. Use 'Curve.BEFORE' for before, and 'Curve.AFTER' for after.
ReturnsNo return value. |
ExampleTo insert the values after the 3rd row to x=3, y=5 for curve l: l.InsertPoint(3, 3, 5, Curve.AFTER);
|
Next()DescriptionReturns the next curve in the model. |
No arguments
ReturnsCurve object (or null if there are no more curves in the model). Return typeCurve |
ExampleTo get the curve in model m after curve l: var curve = l.Next();
|
Pick(prompt[string], modal (optional)[boolean]) [static]DescriptionPicks a single curve. |
Text to display as a prompt to the user
If selection is modal (blocks the user from doing anything else in T/HIS until this window is dismissed). If omitted the selection will be modal.
ReturnsCurve object (or null if the user cancels the pick operation). Return typeCurve |
ExampleTo pick a curve, giving the prompt 'Pick curve': var curve = Curve.Pick('Pick curves');
|
Previous()DescriptionReturns the previous curve in the model. |
No arguments
ReturnsCurve object (or null if there are no more curves in the model). Return typeCurve |
ExampleTo get the curve in model m before this one: var curve = curve.Previous();
|
RemoveFlaggedFromGraph(flag[Flag], graph (optional)[int]) [static]DescriptionRemoves flagged curves from a graph. |
Flag to check on the curve
Graph to remove the curve from. If undefined then the curve is removed from all graphs.
This argument can be repeated if required
Alternatively a single array argument containing the multiple values can be given
ReturnsNo return value. |
ExampleTo remove curves flagged with flag f from graphs 1 and 3: Curve.RemoveFlaggedFromGraph(f,1,3); To remove curves flagged with flag f from all graphs: Curve.RemoveFlaggedFromGraph(f);
|
RemoveFromGraph(graph (optional)[int])DescriptionRemoves a curve from a graph. |
Graph to remove the curve from, If undefined then the curve is removed from all graphs.
This argument can be repeated if required
Alternatively a single array argument containing the multiple values can be given
ReturnsNo return value. |
ExampleTo remove a curve (c) from graphs 1 and 3: c.RemoveFromGraph(1,3); To remove a curve (c) from all graphs: c.RemoveFromGraph();
|
Select(flag[integer], prompt[string], modal (optional)[boolean]) [static]DescriptionAllows the user to select curves. |
Flag to use when selecting curves
Text to display as a prompt to the user
If selection is modal (blocks the user from doing anything else in T/HIS until this window is dismissed). If omitted the selection will be modal.
ReturnsNumber of items selected or null if menu cancelled Return typeNumber |
ExampleTo select curves, flagging those selected which flag f, giving the prompt 'Select curves': var num = Curve.Select(f, 'Select curves');
|
SetFlag(flag[integer])DescriptionSets a flag on the curve. |
Flag to set on the curve
ReturnsNo return value |
ExampleTo set flag f for curve l: l.SetFlag(f);
|
SetPoint(ipt[integer], xvalue[real], yvalue[real])DescriptionSets the x and y values for a specified point in a curve. |
The point to set the data for.
The x value of the point.
The y value of the point.
ReturnsNo return value. |
ExampleTo set the values for the 3rd point to x=3, y=5 for curve l: l.SetPoint(3, 3, 5);
|
UnflagAll(flag[integer]) [static]DescriptionUnsets a defined flag on all of the curves. |
Flag to unset on the curves
ReturnsNo return value |
ExampleTo unset the flag f on all of the curves: Curve.UnflagAll(f);
|
Update()DescriptionUpdates a curve properties (min,max, average values etc). |
No arguments
ReturnsNo return value. |
ExampleTo update the properties of curve l: l.Update();
|
YatX(xvalue[real])DescriptionReturns the y value of the curve at a given x value, interpolating if requested x value lies between data points. |
The x value.
ReturnsY value Return typereal |
ExampleTo get the y value of curve c when x=1.4: var y = c.YatX(1.4);
|