Commit c77848c0 authored by Benjamin Jakimow's avatar Benjamin Jakimow
Browse files
parent e3bb7207
......@@ -991,13 +991,15 @@ class EOTimeSeriesViewer(QgisInterface, QObject):
else:
print('Unsupported moveTo action')
def setCurrentDate(self, tsd: TimeSeriesDate):
def setCurrentDate(self, tsd: TimeSeriesDate, show_if_hidden: bool =True) :
"""
Moves the viewport of the scroll window to a specific TimeSeriesDate
:param tsd: TimeSeriesDate or numpy.datetime64
"""
tsd = self.timeSeries().findDate(tsd)
if isinstance(tsd, TimeSeriesDate):
if show_if_hidden:
self.mTimeSeries.showTSDs([tsd], b=True)
self.ui.mMapWidget.setCurrentDate(tsd)
def mapCanvases(self) -> typing.List[MapCanvas]:
......
......@@ -1377,7 +1377,7 @@ class TimeSeries(QAbstractItemModel):
self.mSensorMatchingFlags = SensorMatching.PX_DIMS
self.mLUT_Path2TSD = {}
self.mVisibleDate = []
self.mVisibleDates: typing.Set[TimeSeriesDate] = set()
self.mCurrentSpatialExtent = None
self.cnDate = 'Date'
......@@ -1490,8 +1490,8 @@ class TimeSeries(QAbstractItemModel):
Sets the TimeSeriesDates currently shown
:param tsds: [list-of-TimeSeriesDate]
"""
self.mVisibleDate.clear()
self.mVisibleDate.extend(tsds)
self.mVisibleDates.clear()
self.mVisibleDates.update(tsds)
for tsd in tsds:
assert isinstance(tsd, TimeSeriesDate)
if tsd in self:
......@@ -1708,6 +1708,7 @@ class TimeSeries(QAbstractItemModel):
idx0 = self.tsdToIdx(tsds[0])
idx1 = self.tsdToIdx(tsds[-1])
for i, tsd in enumerate(tsds):
assert isinstance(tsd, TimeSeriesDate)
for tss in tsd:
......@@ -2303,7 +2304,7 @@ class TimeSeries(QAbstractItemModel):
print(ext)
return None
if role == Qt.BackgroundColorRole and tsd in self.mVisibleDate:
if role == Qt.BackgroundColorRole and tsd in self.mVisibleDates:
return QColor('yellow')
if isinstance(node, TimeSeriesDate):
......@@ -2318,7 +2319,7 @@ class TimeSeries(QAbstractItemModel):
if role == Qt.CheckStateRole and index.column() == 0:
return node.checkState()
if role == Qt.BackgroundColorRole and tsd in self.mVisibleDate:
if role == Qt.BackgroundColorRole and tsd in self.mVisibleDates:
return QColor('yellow')
return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment