Commit b2f67e03 authored by Domanski, Marian M.'s avatar Domanski, Marian M.
Browse files

set ras start/end time limits

parent 97ac3d87
......@@ -9,7 +9,7 @@ import numpy as np
from PyQt5.QtWidgets import QMainWindow, QMessageBox, QDialog, \
QDesktopWidget, QFileDialog, QProgressBar
from PyQt5.QtGui import QDoubleValidator, QIntValidator, QDesktopServices
from PyQt5.QtCore import QTimer, QThread, QUrl, pyqtSignal
from PyQt5.QtCore import QDateTime, QTimer, QThread, QUrl, pyqtSignal
from fluegg.ras import RASProject
from fluegg.simulation import SimulationParameters
from fluegg.hydraulics import RoughBottomSeriesOfHydraulicCells, from_csv
......@@ -70,6 +70,20 @@ class HecrasDialog(QDialog):
def _ras_to_qdatetime(ras_time):
months = ['x', 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN',
'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
ras_day = int(ras_time[:2])
ras_month = months.index(ras_time[2:5])
ras_year = int(ras_time[5:9])
ras_hour = int(ras_time[10:12])
ras_minute = int(ras_time[12:15])
return QDateTime(ras_year, ras_month, ras_day, ras_hour, ras_minute)
def setup(self):
"""Initial setup of dialog"""
......@@ -164,6 +178,18 @@ class HecrasDialog(QDialog):
self.logger.debug("Set project to unsteady")
file_path = self.ui.lineEdit_project.text()
with RASProject(file_path) as ras_project:
profile_names = ras_project.profile_names()
self.logger.debug("RAS start time: {}".format(profile_names[1]))
min_datetime = self._ras_to_qdatetime(profile_names[1])
max_datetime = self._ras_to_qdatetime(profile_names[-1])
def populate_plans(self):
"""Populates the plans combo box"""
# Populate plans using current project
Supports Markdown
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