time_series_model_fixed_resolution
¶
A model for fixed resolution time series, used by the parameter value editors.
authors: |
|
---|---|
date: | 4.7.2019 |
Module Contents¶
-
class
time_series_model_fixed_resolution.
TimeSeriesModelFixedResolution
(series)[source]¶ Bases:
indexed_value_table_model.IndexedValueTableModel
A model for fixed resolution time series type parameter values.
-
series
¶ a time series
Type: TimeSeriesFixedResolution
-
data
(self, index, role=Qt.DisplayRole)[source]¶ Returns the time stamp or the corresponding value at given model index.
Column index 0 refers to time stamps while index 1 to values.
Parameters: - index (QModelIndex) – an index to the model
- role (int) – a role
-
insertRows
(self, row, count, parent=QModelIndex())[source]¶ Inserts new values to the series.
The new values are set to zero. Start time or resolution are left unchanged.
Parameters: - row (int) – a numeric index to the first stamp/value to insert
- count (int) – number of stamps/values to insert
- parent (QModelIndex) – index to a parent model
Returns: True if the operation was successful
-
removeRows
(self, row, count, parent=QModelIndex())[source]¶ Removes values from the series.
Parameters: - row (int) – a numeric index to the series where to begin removing
- count (int) – how many stamps/values to remove
- parent (QModelIndex) – an index to the parent model
Returns: True if the operation was successful.
-
setData
(self, index, value, role=Qt.EditRole)[source]¶ Sets a given value in the series.
Column index 1 refers to values. Note it does not make sense to set the time stamps in fixed resolution series.
Parameters: - index (QModelIndex) – an index to the model
- value (numpy.datetime64, float) – a new stamp or value
- role (int) – a role
Returns: True if the operation was successful
-