Time Series Database Cache Module by Automation Professionals
E-Mail Support

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

PropertyData TypeDescription
boundDateSpanReturns the smallest DateSpan that contains all of the columns "present" information.
createdDateA timestamp initialized from now() when the object was created.
expiresDateA 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.
spansList<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)
ArgumentData TypeDescription
arg0DateSpanSubject datespan
returnsvoidMerge the subject datespan into all columns "present" information.
seriesdata.addSpans(arg0)
ArgumentData TypeDescription
arg0ColumnSpans
List<ColumnSpans>
Subject column(s) with "present" information
returnsvoidMerge the subject "present" for the corresponding column. Ignore data for column names that aren't present in the dataset.
seriesdata.addSpans(col, spans)
ArgumentData TypeDescription
colStringColumn name
spansDateSpansData "present" information
returnsvoidMerge the "present" information for the corresponding column.
seriesdata.compareTo(arg0)
ArgumentData TypeDescription
arg0SeriesFragmentComparison subject
returnsintImplements natural ordering for SeriesFragment objects, which will sort by creation timestamp, newest first.
seriesdata.getMissing(arg0)
ArgumentData TypeDescription
arg0DateSpanSubject datespan
returnsList<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)
ArgumentData TypeDescription
arg0int
String
Column selector
returnsColumnSpansThe 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)
ArgumentData TypeDescription
arg0DateSpanSubject datespan
returnsbooleanTrue 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.