SeriesFragment
This composite type extends Ignition's Dataset type to include
cache metadata that is likely to be useful to the end-user. In
particular, the cache supplies the status of the data successfully
delivered as a list of ColumnSpans.
The first column of a SeriesFragment must have non-null java.util.Date
values, and must be sorted in ascending order. The remaining columns
may be any data type, and are referred to as the value columns.
If a user creates their own instances from native Datasets without
ensuring supported data in the first column, the results are undefined.
Syntax
from com.automation_pros.tsdbcache import SeriesFragment
seriesdata = SeriesFragment(sourcedata)
for columnpresent in seriesdata.spans:
print columnpresent
Properties
Property | Data Type | Description |
bound | DateSpan | Returns the smallest DateSpan
that contains all of the columns "present" information. |
created | Date | A timestamp initialized from
now() when the object was created. |
expires | Date | A timestamp initialized from
now() plus an expiration time when the object was created, and
updated in the cache whenever the time frame & one or more
columns satisfy a cache consumer. |
spans | List<ColumnSpans> | A list of
ColumnSpans timelines, one for each value column, indicating
what time spans have data "present". When a SeriesFragment is
initialized from a simple dataset, the spans are all set to the
span of the timestamp column. When the cache engine delivers a
SeriesFragment, its spans will cover all successfully queried time
frames, whether there were rows returned or not. |
Methods
seriesdata.addSpan(arg0) |
Argument | Data Type | Description |
arg0 | DateSpan | Subject datespan |
returns | void | Merge the subject datespan
into all columns "present" information. |
seriesdata.addSpans(arg0) |
Argument | Data Type | Description |
arg0 | ColumnSpans List<ColumnSpans> |
Subject column(s) with "present" information |
returns | void | Merge the subject "present"
for the corresponding column. Ignore data for column names
that aren't present in the dataset. |
seriesdata.addSpans(col, spans) |
Argument | Data Type | Description |
col | String | Column name |
spans | DateSpans | Data "present" information |
returns | void | Merge the "present" information
for the corresponding column. |
seriesdata.compareTo(arg0) |
Argument | Data Type | Description |
arg0 | SeriesFragment | Comparison subject |
returns | int | Implements natural ordering for
SeriesFragment objects, which will sort by creation timestamp,
newest first. |
seriesdata.getMissing(arg0) |
Argument | Data Type | Description |
arg0 | DateSpan | Subject datespan |
returns | List<ColumnSpans> | Reverse the
sense of the data "present" time spans in reference to the subject time
span. The resulting list details the gaps in the data. |
seriesdata.getSpans(arg0) |
Argument | Data Type | Description |
arg0 | int String | Column selector |
returns | ColumnSpans | The selected column's
data "present" information. Note that an integer selector is
the dataset's column index, but column zero doesn't have a
ColumnSpans object. The selector must be >0. |
seriesdata.hasMissing(arg0) |
Argument | Data Type | Description |
arg0 | DateSpan | Subject datespan |
returns | boolean | True if any column's
data "present" time spans have a gap in reference to the subject time
span. |
See the documentation for the built-in Dataset class in the
User Manual,
for more detail on using datasets in scripts.