Closed ZedeN1 closed 3 years ago
Quick google search suggested the following changes in tuflowqgis_turesults2d.py.
(change line 908 and remove following indent. Seems to work but I have no idea what I am doing!)
if firstTime is not None:
if firstTime == 0:
continue # move onto next result dataset
else: # find time 0 values and change to firstTime
for resultType in results[result]:
#if '_ts' not in resultType and '_lp' not in resultType:
if TuResults.isMapOutputType(resultType):
if len(results[result][resultType]['times']) == 1:
for i in [x for x in results[result][resultType]['times'] if x == 0]:
timeKey = '{0:.6f}'.format(firstTime)
dataType = results[result][resultType]['times'][i][1]
meshIndex = results[result][resultType]['times'][i][2]
results[result][resultType]['times'][timeKey] = (firstTime, dataType, meshIndex)
del results[result][resultType]['times'][i]
# also delete from dicts
a = sorted([x for x in self.tuView.tuResults.time2date.keys()])
if a[0] != firstTime:
del self.tuView.tuResults.time2date[a[0]]
a = sorted([x for x in self.tuView.tuResults.timekey2date.keys()])
del self.tuView.tuResults.timekey2date[a[0]]
a = sorted([x for x in self.tuView.tuResults.timekey2time.keys()])
del self.tuView.tuResults.timekey2time[a[0]]
a = sorted([x for x in self.tuView.tuResults.date2time.keys()])
del self.tuView.tuResults.date2time[a[0]]
a = sorted([x for x in self.tuView.tuResults.date2timekey.keys()])
del self.tuView.tuResults.date2timekey[a[0]]
Hi, thanks for letting us know. I think I already fixed this one (locally). I did something similar and iterated through a copy of the dictionary keys. I was able to load the example datasets you provided.
I'll upload a copy of the latest plugin (it has a bunch of fixes if you're using QGIS 3.14).
I keep getting an error loading in specific 2D map results, available on Google Drive. The layer gets added to Layer's panel but not TUFLOW Viewer. I am still able to view the results and change times/ datasets using QGIS in-built styling / properties but not through the viewer.
Same results files open fine on Windows. Other model result files get opened without any issues on Windows and Linux.
This is using TUFLOW Viewer v3.1.1 directly from QGIS repository.
The same issue also happens on a different Linux machine running same TUFLOW Viewer but QGIS 3.10 LTR