Maintenance scheduled for Thursday, September 24th at 15:00 MDT. Expected downtime <1 hour.

Change usage of "Asian carp" and add menu buttons

parent 6aa8e0a8
......@@ -9,7 +9,7 @@ Domanski, M.M., 2019, FluEgg, U.S. Geological Survey software release, https://d
## References
Garcia, Tatiana, Jackson, P.R., Murphy, E.A., Valocchi, A.J., and Garcia, M.H., 2013, Development of
a fluvial egg drift simulator to evaluate the transport and dispersion of asian carp eggs in Rivers:
a fluvial egg drift simulator to evaluate the transport and dispersion of invasive carp eggs in Rivers:
Ecological Modelling, v. 263, p. 211–22, [https://doi.org/10.1016/j.ecolmodel.2013.05.005](https://doi.org/10.1016/j.ecolmodel.2013.05.005)
## Getting started
......
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fluegggui/hecras_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_HecrasDialog(object):
def setupUi(self, HecrasDialog):
HecrasDialog.setObjectName("HecrasDialog")
HecrasDialog.resize(258, 295)
self.verticalLayout_2 = QtWidgets.QVBoxLayout(HecrasDialog)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label_project = QtWidgets.QLabel(HecrasDialog)
self.label_project.setObjectName("label_project")
self.horizontalLayout.addWidget(self.label_project)
self.lineEdit_project = QtWidgets.QLineEdit(HecrasDialog)
self.lineEdit_project.setObjectName("lineEdit_project")
self.horizontalLayout.addWidget(self.lineEdit_project)
self.pushButton_browse = QtWidgets.QPushButton(HecrasDialog)
self.pushButton_browse.setObjectName("pushButton_browse")
self.horizontalLayout.addWidget(self.pushButton_browse)
self.verticalLayout.addLayout(self.horizontalLayout)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.radioButton_steady = QtWidgets.QRadioButton(HecrasDialog)
self.radioButton_steady.setObjectName("radioButton_steady")
self.horizontalLayout_4.addWidget(self.radioButton_steady)
self.radioButton_unsteady = QtWidgets.QRadioButton(HecrasDialog)
self.radioButton_unsteady.setObjectName("radioButton_unsteady")
self.horizontalLayout_4.addWidget(self.radioButton_unsteady)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem1)
self.verticalLayout.addLayout(self.horizontalLayout_4)
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem2)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_plan = QtWidgets.QLabel(HecrasDialog)
self.label_plan.setMaximumSize(QtCore.QSize(60, 60))
self.label_plan.setObjectName("label_plan")
self.horizontalLayout_2.addWidget(self.label_plan)
self.comboBox_plan = QtWidgets.QComboBox(HecrasDialog)
self.comboBox_plan.setObjectName("comboBox_plan")
self.horizontalLayout_2.addWidget(self.comboBox_plan)
self.verticalLayout.addLayout(self.horizontalLayout_2)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem3)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.label_profile = QtWidgets.QLabel(HecrasDialog)
self.label_profile.setMaximumSize(QtCore.QSize(60, 60))
self.label_profile.setObjectName("label_profile")
self.horizontalLayout_3.addWidget(self.label_profile)
self.comboBox_profile = QtWidgets.QComboBox(HecrasDialog)
self.comboBox_profile.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.comboBox_profile.setObjectName("comboBox_profile")
self.horizontalLayout_3.addWidget(self.comboBox_profile)
self.verticalLayout.addLayout(self.horizontalLayout_3)
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem4)
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
self.horizontalLayout_5.setContentsMargins(-1, -1, -1, 0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.label_temperature = QtWidgets.QLabel(HecrasDialog)
self.label_temperature.setObjectName("label_temperature")
self.horizontalLayout_5.addWidget(self.label_temperature)
self.lineEdit_temperature = QtWidgets.QLineEdit(HecrasDialog)
self.lineEdit_temperature.setObjectName("lineEdit_temperature")
self.horizontalLayout_5.addWidget(self.lineEdit_temperature)
self.verticalLayout.addLayout(self.horizontalLayout_5)
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem5)
self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
self.label_start_time = QtWidgets.QLabel(HecrasDialog)
self.label_start_time.setObjectName("label_start_time")
self.horizontalLayout_8.addWidget(self.label_start_time)
self.dateTimeEdit_start_time = QtWidgets.QDateTimeEdit(HecrasDialog)
self.dateTimeEdit_start_time.setObjectName("dateTimeEdit_start_time")
self.horizontalLayout_8.addWidget(self.dateTimeEdit_start_time)
self.verticalLayout.addLayout(self.horizontalLayout_8)
spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem6)
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.pushButton_cancel = QtWidgets.QPushButton(HecrasDialog)
self.pushButton_cancel.setObjectName("pushButton_cancel")
self.horizontalLayout_6.addWidget(self.pushButton_cancel)
self.pushButton_ok = QtWidgets.QPushButton(HecrasDialog)
self.pushButton_ok.setObjectName("pushButton_ok")
self.horizontalLayout_6.addWidget(self.pushButton_ok)
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_6.addItem(spacerItem7)
self.verticalLayout.addLayout(self.horizontalLayout_6)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.retranslateUi(HecrasDialog)
self.radioButton_steady.toggled['bool'].connect(self.dateTimeEdit_start_time.setDisabled)
self.radioButton_steady.toggled['bool'].connect(self.label_start_time.setDisabled)
QtCore.QMetaObject.connectSlotsByName(HecrasDialog)
def retranslateUi(self, HecrasDialog):
_translate = QtCore.QCoreApplication.translate
HecrasDialog.setWindowTitle(_translate("HecrasDialog", "Dialog"))
self.label_project.setText(_translate("HecrasDialog", "Project"))
self.pushButton_browse.setText(_translate("HecrasDialog", "Browse"))
self.radioButton_steady.setText(_translate("HecrasDialog", "Steady"))
self.radioButton_unsteady.setText(_translate("HecrasDialog", "Unsteady"))
self.label_plan.setText(_translate("HecrasDialog", "Plan"))
self.label_profile.setText(_translate("HecrasDialog", "Profile"))
self.label_temperature.setText(_translate("HecrasDialog", "Temperature (C)"))
self.label_start_time.setText(_translate("HecrasDialog", "Start Time"))
self.pushButton_cancel.setText(_translate("HecrasDialog", "Cancel"))
self.pushButton_ok.setText(_translate("HecrasDialog", "Ok"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
HecrasDialog = QtWidgets.QDialog()
ui = Ui_HecrasDialog()
ui.setupUi(HecrasDialog)
HecrasDialog.show()
sys.exit(app.exec_())
......@@ -8,8 +8,8 @@ import concurrent.futures
import numpy as np
from PyQt5.QtWidgets import QMainWindow, QMessageBox, QDialog, \
QDesktopWidget, QFileDialog, QProgressBar
from PyQt5.QtGui import QDoubleValidator, QIntValidator
from PyQt5.QtCore import QTimer, QThread, pyqtSignal
from PyQt5.QtGui import QDoubleValidator, QIntValidator, QDesktopServices
from PyQt5.QtCore import QTimer, QThread, QUrl, pyqtSignal
from fluegg.ras import RASProject
from fluegg.simulation import SimulationParameters
from fluegg.hydraulics import RoughBottomSeriesOfHydraulicCells, from_csv
......@@ -225,8 +225,9 @@ class AppWindow(QMainWindow):
self.version = 'FluEgg {}'.format(fluegggui.__version__)
self.setWindowTitle(self.version)
# FluEgg help message
self.help = ''
# FluEgg menu links
self.manual_link = ''
self.project_page_link = ''
# Set labels
self._set_labels()
......@@ -253,7 +254,9 @@ class AppWindow(QMainWindow):
# Define connections between ui events and handle functions
# Menu Buttons
self.ui.actionVersion.triggered.connect(self.handle_version)
self.ui.actionHelp.triggered.connect(self.handle_help)
self.ui.actionUser_Manual.triggered.connect(self.handle_url_manual)
self.ui.actionProject_Page.triggered.connect(
self.handle_url_project_page)
# Hydraulic Channel
self.ui.radioButton_csv.clicked.connect(self.handle_hydraulic_change)
self.ui.radioButton_hecras.clicked.connect(
......@@ -412,10 +415,6 @@ class AppWindow(QMainWindow):
"""Handle function for clicking About > Version"""
QMessageBox.about(self, 'Version', self.version)
def handle_help(self):
"""Handle function for clicking About > Help"""
QMessageBox.about(self, 'Help', self.help)
def handle_hydraulic_change(self):
"""Handle function for changing the Hydraulic Channel input"""
# self.ui.pushButton_browse.setEnabled(True)
......@@ -784,6 +783,17 @@ class AppWindow(QMainWindow):
preset_time /= 3600
self.ui.lineEdit_duration.setText(str(preset_time))
def handle_url_manual(self):
url = QUrl(self.manual_link)
if not QDesktopServices.openUrl(url):
QMessageBox.warning(self, 'Open User Manual', 'Could not open url')
def handle_url_project_page(self):
url = QUrl(self.project_page_link)
if not QDesktopServices.openUrl(url):
QMessageBox.warning(self, 'Open Project Page',
'Could not open url')
def handle_validate(self, field=None):
if isinstance(field, str):
if getattr(self.ui, field).text() != '':
......
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fluegggui\gui_layout.ui'
# Form implementation generated from reading ui file 'fluegggui/gui_layout.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
#
......@@ -12,7 +12,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(501, 790)
MainWindow.resize(569, 898)
MainWindow.setMinimumSize(QtCore.QSize(0, 0))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setEnabled(True)
......@@ -363,7 +363,7 @@ class Ui_MainWindow(object):
self.verticalLayout_5.addLayout(self.verticalLayout_4)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 501, 21))
self.menubar.setGeometry(QtCore.QRect(0, 0, 569, 26))
self.menubar.setObjectName("menubar")
self.menuAbout = QtWidgets.QMenu(self.menubar)
self.menuAbout.setObjectName("menuAbout")
......@@ -375,8 +375,13 @@ class Ui_MainWindow(object):
self.actionVersion.setObjectName("actionVersion")
self.actionHelp = QtWidgets.QAction(MainWindow)
self.actionHelp.setObjectName("actionHelp")
self.actionUser_Manual = QtWidgets.QAction(MainWindow)
self.actionUser_Manual.setObjectName("actionUser_Manual")
self.actionProject_Page = QtWidgets.QAction(MainWindow)
self.actionProject_Page.setObjectName("actionProject_Page")
self.menuAbout.addAction(self.actionVersion)
self.menuAbout.addAction(self.actionHelp)
self.menuAbout.addAction(self.actionUser_Manual)
self.menuAbout.addAction(self.actionProject_Page)
self.menubar.addAction(self.menuAbout.menuAction())
self.retranslateUi(MainWindow)
......@@ -472,6 +477,8 @@ class Ui_MainWindow(object):
self.menuAbout.setTitle(_translate("MainWindow", "About"))
self.actionVersion.setText(_translate("MainWindow", "Version"))
self.actionHelp.setText(_translate("MainWindow", "Help"))
self.actionUser_Manual.setText(_translate("MainWindow", "User Manual"))
self.actionProject_Page.setText(_translate("MainWindow", "Project Page"))
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>501</width>
<height>790</height>
<width>569</width>
<height>898</height>
</rect>
</property>
<property name="minimumSize">
......@@ -886,8 +886,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>501</width>
<height>21</height>
<width>569</width>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuAbout">
......@@ -895,7 +895,8 @@
<string>About</string>
</property>
<addaction name="actionVersion"/>
<addaction name="actionHelp"/>
<addaction name="actionUser_Manual"/>
<addaction name="actionProject_Page"/>
</widget>
<addaction name="menuAbout"/>
</widget>
......@@ -910,6 +911,16 @@
<string>Help</string>
</property>
</action>
<action name="actionUser_Manual">
<property name="text">
<string>User Manual</string>
</property>
</action>
<action name="actionProject_Page">
<property name="text">
<string>Project Page</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>radioButton_csv</tabstop>
......
......@@ -263,5 +263,38 @@
</layout>
</widget>
<resources/>
<connections/>
<connections>
<connection>
<sender>radioButton_steady</sender>
<signal>toggled(bool)</signal>
<receiver>dateTimeEdit_start_time</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>18</x>
<y>64</y>
</hint>
<hint type="destinationlabel">
<x>142</x>
<y>227</y>
</hint>
</hints>
</connection>
<connection>
<sender>radioButton_steady</sender>
<signal>toggled(bool)</signal>
<receiver>label_start_time</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>46</x>
<y>69</y>
</hint>
<hint type="destinationlabel">
<x>42</x>
<y>218</y>
</hint>
</hints>
</connection>
</connections>
</ui>
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