TransientSeriesFragment
This composite type extends the SeriesFragment
type to omit its data during serialization. Final data
delivered by the system.db.getSeriesCache() script function and by the
timeSeriesCache() expression function use this type. The cache subsystem
can deliver very large datasets, which are troublesome if the designer
saves the entire content with the windows that contain them.
serialization behavior varies by scope. Native java serialization
will always omit the row data. This includes network messaging in
Ignition. In the designer, these datasets' content will not be stored
in the project.
Syntax
from com.automation_pros.tsdbcache import TransientSeriesFragment
seriesdata = TransientSeriesFragment(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. |
seriesdata.persistent() |
returns | SeriesFragment | Provides the
reverse of toTransient() for this dataset, while retaining the
other features of a series fragment. |
WARNING: Datasets converted from transient to persistent
by the persistent() method can be very
large. If you do so, avoid saving the project when
large datasets are present, or you will suffer from long
serialization delays.
See the documentation for the built-in Dataset class in the
User Manual,
for more detail on using datasets in scripts.