The Read class allows the user to read CSV, Curve and other filetypes into 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:
Detailed DescriptionThe Read class allows the user to read CSV, Curve and other filetypes into T/HIS. |
Details of functionsBulk(Filename[String], Options (optional)[object]) [static]DescriptionReads a Bulk Data file into T/HIS. |
Name of Bulk Data file to read
Options which give you greater control of reading a Bulk file:
Object has the following properties:
| Name | Type | Description |
| outputOpt (optional) | integer/string | Allows you to control which curve ID number the file will begin to read at. This can either be a whole number greater than 0 or specified as a string like "#3" for curve 3. There are also the special string characters "%", standing for highest free curve as well as "#", standing for the lowest free curve. By default, this will be set to the highest free curve. |
ReturnsNo return value |
CSV(Filename[String], Options (optional)[object]) [static]DescriptionReads a CSV file into T/HIS. |
Name of CSV file to read.
Options which give you greater control of reading a CSV file:
Object has the following properties:
| Name | Type | Description |
| csvType (optional) | integer | CSV file type. Can be Read.CSV_XYXY or Read.CSV_XYYY |
| outputOpt (optional) | integer/string | Allows you to control which curve ID number the file will begin to read at. This can either be a whole number greater than 0 or specified as a string like "#3" for curve 3. There are also the special string characters "%", standing for highest free curve as well as "#", standing for the lowest free curve. By default, this will be set to the highest free curve. |
| rowAxisLabel (optional) | integer | Index of the row containing axis labels. This is row 2 by default, so should be set to 0 if no axis labels are present. |
| rowCurveLabel (optional) | integer | Index of the row containing curve labels. This is row 1 by default, so should be set to 0 if no curve labels are present. |
| separator (optional) | integer | Separator. Can be Read.CSV_COMMA, Read.CSV_SPACE or Read.CSV_TAB |
| xColIndex (optional) | integer | Index of the column containing X-values. This is column 1 by default. |
| xInterval (optional) | real | User defined X-interval between points, to use together with xStartVal |
| xStartVal (optional) | real | Instead of taking X-values from the CSV file, this allows the user to define a value for the start of the X-axis. |
ReturnsNo return value |
Name of CSV file to read.
CSV file type. Can be Read.CSV_XYXY or Read.CSV_XYYY
Index of the row containing curve labels. This is row 1 by default, so should be set to 0 if no curve labels are present.
Index of the row containing axis labels. This is row 2 by default, so should be set to 0 if no axis labels are present.
Separator. Can be Read.CSV_COMMA, Read.CSV_SPACE or Read.CSV_TAB
Index of the column containing X-values. This is column 1 by default.
Instead of taking X-values from the CSV file, this allows the user to define a value for the start of the X-axis.
User defined X-interval between points, to use together with the previous argument.
ReturnsNo return value |
ExampleTo read an XYYY CSV file with X-values in column 3, named "example.csv" Read.CSV("example.csv", Read.CSV_XYYY, 0, 0, Read.CSV_COMMA, 3);
|
Cur(Filename[String], Options (optional)[object]) [static]DescriptionReads a Curve file into T/HIS. |
Name of Curve file to read
Options which give you greater control of reading a Curve file:
Object has the following properties:
| Name | Type | Description |
| outputOpt (optional) | integer/string | Allows you to control which curve ID number the file will begin to read at. This can either be a whole number greater than 0 or specified as a string like "#3" for curve 3. There are also the special string characters "%", standing for highest free curve as well as "#", standing for the lowest free curve. |
ReturnsNo return value |
DIAdem(Filename[String], X-axis channel[integer], Options (optional)[object]) [static]DescriptionReads a DIAdem file into T/HIS. |
Name of DIAdem header file to read.
Index of the channel to use as X-axis values. If this is 0 then the X-values can be generated from a start value and an interval in the following two arguments.
Options which give you greater control of reading the Diadem file:
Object has the following properties:
| Name | Type | Description |
| filter (optional) | String | String to filter channel names/comments. Only channels whose names/comments contain the filter string will be read. |
| outputOpt (optional) | integer/string | Allows you to control which curve ID number the file will begin to read at. This can either be a whole number greater than 0 or specified as a string like "#3" for curve 3. There are also the special string characters "%", standing for highest free curve as well as "#", standing for the lowest free curve. By default, this will be set to the highest free curve. |
| showChannelName (optional) | real | Option to select what is written to the curve tag. Can be Read.DIADEM_COMMENT or Read.DIADEM_NAME |
| xAxisInterval (optional) | real | User defined interval between points on the X-axis, to use together with the previous argument. |
| xAxisStartVal (optional) | real | Instead of taking X-values from a DIAdem channel, this allows the user to define a value for the start of the X-axis. |
ReturnsNo return value |
Name of DIAdem header file to read.
Index of the channel to use as X-axis values. If this is 0 then the X-values can be generated from a start value and an interval in the following two arguments.
Instead of taking X-values from a DIAdem channel, this allows the user to define a value for the start of the X-axis.
User defined interval between points on the X-axis, to use together with the previous argument.
Option to select what is written to the curve tag. Can be Read.DIADEM_COMMENT or Read.DIADEM_NAME
String to filter channel names/comments. Only channels whose names/comments contain the filter string will be read.
ReturnsNo return value |
ExampleTo read DIAdem channels from "EXAMPLE.DAT", with channel comments filtered by "EXAMPLE" and X-values taken from channel 1: Read.DIAdem("EXAMPLE.DAT",1,0,0,Read.DIADEM_COMMENT,"EXAMPLE");
|
Equation(Formula[String], Options (optional)[object]) [static]DescriptionCreate a curve from a user-defined equation. |
Equation string.
Options which give you greater control of reading the Diadem file:
Object has the following properties:
| Name | Type | Description |
| curveID (optional) | integer | Allows you to control which curve ID the file will begin to read into. By default, this will be set to the highest free curve by default if the option is not selected. |
| xEndVal (optional) | real | Right endpoint of the x range. Default 1.0. |
| xInterval (optional) | real | Interval between points. Default 0.01. |
| xStartVal (optional) | real | Left endpoint of the x range. Default 0.0. |
| xValOpt (optional) | integer | Option to select how x values are determined for the given equation. Read.EQUATION_X_VALS, requires the xStartVal, xEndVal and xInterval options to also be set however these default to 0, 1 and 0.01 respectively. Read.EQUATION_CURVE_VARS will calculate it's x values from the curve variables that are used in the equation. This is the default if curve variables are used and no xValOpt has been provided. Read.EQUATION_X_OR_CURVE will use Rea.EQUATION_X_VALS if there are no curve variables in the equation otherwise Read.EQUATION_CURVE_VARS if there are. -ID to take x values from Curve #ID (e.g. -5 for curve ID 5) |
ReturnsNo return value |
Equation string.
Option to select what is written to the curve tag. Can be Read.EQUATION_X_VALS, Read.EQUATION_CURVE_VARS, Read.EQUATION_X_OR_CURVE or -ID to take x values from Curve #ID
Left endpoint of the x range. Default 0.0.
Right endpoint of the x range. Default 1.0.
Interval between points. Default 0.01.
ReturnsNo return value |
ExampleTo plot the line y = x^2+2 for x in [-1,1] and an interval between points of 0.02: Read.Equation("x^2+2",0,-1,1,0.02);
|
ISO(Filename[String], Options (optional)[object]) [static]DescriptionReads an ISO file into T/HIS. |
Name of ISO file to read
Options which give you greater control of reading an ISO file:
Object has the following properties:
| Name | Type | Description |
| fileFormat (optional) | integer | Format of ISO file. Can be Read.MULTIPLE_CHANNELS, Read.ISO_SINGLE_CHANNEL |
| labelType (optional) | integer | Label type to use. Can be Read.ISO_CHANNEL_LABEL, Read.ISO_CHANNEL_CODE |
| outputOpt (optional) | integer/string | Allows you to control which curve ID the file will begin to read to. This can either be a whole number greater than 0 or specified as a string like "#3" for curve 3. There are also the special string characters "%", standing for highest free curve as well as "#", standing for the lowest free curve. By default, this will be set to the highest free curve. |
ReturnsNo return value |
Name of ISO file to read
Format of ISO file. Can be Read.MULTIPLE_CHANNELS, Read.ISO_SINGLE_CHANNEL
Label type to use. Can be Read.ISO_CHANNEL_LABEL, Read.ISO_CHANNEL_CODE
ReturnsNo return value |
ExampleTo read a single channel ISO file named "example.001" Read.ISO("example.001", Read.ISO_SINGLE_CHANNEL);
|
Key(Filename[String], Options (optional)[object]) [static]DescriptionReads a Keyword file into T/HIS. |
Name of Keyword file to read
Options which give you greater control of reading a Keyword file:
Object has the following properties:
| Name | Type | Description |
| outputOpt (optional) | integer/string | Allows you to control which curve ID number the file will begin to read at. This can either be a whole number greater than 0 or specified as a string like "#3" for curve 3. There are also the special string characters "%", standing for highest free curve as well as "#", standing for the lowest free curve. |
ReturnsNo return value |
LSPP(Filename[String], Options (optional)[object]) [static]DescriptionReads an LS-PREPOST file into T/HIS. |
Name of LS-PREPOST file to read
Options which give you greater control of reading a Keyword file:
Object has the following properties:
| Name | Type | Description |
| fileFormat (optional) | integer | LSPP file format. Can be Read.LSPP_CURVE_FILE or Read.LSPP_XY_PAIRS |
| outputOpt (optional) | integer/string | Allows you to control which curve ID number the file will begin to read at. This can either be a whole number greater than 0 or specified as a string like "#3" for curve 3. There are also the special string characters "%", standing for highest free curve as well as "#", standing for the lowest free curve. By default, this will be set to the highest free curve. |
ReturnsNo return value |
ExampleTo read an LS-PREPOST XY pairs file named "example.xy" var options = new Object();
options.fileFormat = Read.LSPP_XY_PAIRS;
Read.LSPP("example.xy", options);
|
Name of LS-PREPOST file to read
LSPP file format. Can be Read.LSPP_CURVE_FILE or Read.LSPP_XY_PAIRS
ReturnsNo return value |
ExampleTo read an LS-PREPOST XY pairs file named "example.xy" Read.LSPP("example.xy", Read.LSPP_XY_PAIRS);
|