Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cal Poly Solar Irradiance Microforecasting
SIMF Python GUI
Commits
e149a9a3
Unverified
Commit
e149a9a3
authored
Nov 08, 2018
by
AJ Fite
🛫
Browse files
All currently planned UI elements sorta working
parent
2164da79
Changes
4
Hide whitespace changes
Inline
Side-by-side
simf-python-gui/AboutDialog.ui
View file @
e149a9a3
...
...
@@ -3,7 +3,7 @@
<class>
aboutDialog
</class>
<widget
class=
"QDialog"
name=
"aboutDialog"
>
<property
name=
"windowModality"
>
<enum>
Qt::
N
onModal
</enum>
<enum>
Qt::
Applicati
onModal
</enum>
</property>
<property
name=
"geometry"
>
<rect>
...
...
@@ -34,6 +34,9 @@
<property
name=
"windowTitle"
>
<string>
About SIMF
</string>
</property>
<property
name=
"modal"
>
<bool>
true
</bool>
</property>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"geometry"
>
<rect>
...
...
simf-python-gui/MainWindow.ui
View file @
e149a9a3
...
...
@@ -152,14 +152,14 @@
<property
name=
"title"
>
<string>
Fi
&
le
</string>
</property>
<addaction
name=
"action
Capture_
Settings"
/>
<addaction
name=
"actionSettings"
/>
<addaction
name=
"actionExit"
/>
</widget>
<widget
class=
"QMenu"
name=
"menuFile"
>
<property
name=
"title"
>
<string>
Abo
&
ut
</string>
</property>
<addaction
name=
"actionSource
_
Code"
/>
<addaction
name=
"actionSourceCode"
/>
<addaction
name=
"actionLicense"
/>
<addaction
name=
"actionAbout"
/>
</widget>
...
...
@@ -167,17 +167,23 @@
<addaction
name=
"menuFile"
/>
</widget>
<widget
class=
"QStatusBar"
name=
"statusbar"
/>
<action
name=
"action
Capture_
Settings"
>
<action
name=
"actionSettings"
>
<property
name=
"text"
>
<string>
&
Capture Settings
</string>
</property>
<property
name=
"iconText"
>
<string>
Settings
</string>
</property>
<property
name=
"toolTip"
>
<string>
Settings
</string>
</property>
</action>
<action
name=
"actionExit"
>
<property
name=
"text"
>
<string>
&
Exit
</string>
</property>
</action>
<action
name=
"actionSource
_
Code"
>
<action
name=
"actionSourceCode"
>
<property
name=
"text"
>
<string>
&
Source Code
</string>
</property>
...
...
simf-python-gui/about.py
0 → 100644
View file @
e149a9a3
from
PyQt5
import
uic
from
PyQt5.QtCore
import
Qt
from
PyQt5.QtWidgets
import
QDialog
class
AboutDialog
(
QDialog
):
def
__init__
(
self
):
super
().
__init__
(
flags
=
Qt
.
WindowStaysOnTopHint
)
uic
.
loadUi
(
'AboutDialog.ui'
,
self
)
self
.
show
()
simf-python-gui/main.py
View file @
e149a9a3
#!/usr/bin/env python
import
os
import
sys
import
webbrowser
from
PyQt5
import
uic
from
PyQt5.QtCore
import
QProcess
,
QProcessEnvironment
,
Qt
from
PyQt5.QtWidgets
import
QMainWindow
,
QApplication
from
watchdog.observers
import
Observer
import
filehandlers
,
sudo
from
config
import
Config
from
about
import
AboutDialog
from
config
import
Config
,
ConfigEditor
class
MainWindow
(
QMainWindow
):
...
...
@@ -19,16 +21,47 @@ class MainWindow(QMainWindow):
self
.
show
()
self
.
passprompt
=
None
self
.
configdialog
=
None
self
.
aboutdialog
=
None
# Register Events
self
.
startCapButton
.
clicked
.
connect
(
self
.
start_capture
)
self
.
stopCapButton
.
clicked
.
connect
(
self
.
stop_capture
)
self
.
actionSourceCode
.
triggered
.
connect
(
lambda
:
MainWindow
.
open_link
(
"https://git.nclf.net/SIMF/simf-python-gui"
)
)
self
.
actionLicense
.
triggered
.
connect
(
lambda
:
MainWindow
.
open_link
(
"https://git.nclf.net/SIMF/simf-python-gui/"
"blob/master/LICENSE.md"
)
)
self
.
actionExit
.
triggered
.
connect
(
self
.
close
)
self
.
actionSettings
.
triggered
.
connect
(
self
.
show_settings
)
self
.
actionAbout
.
triggered
.
connect
(
self
.
show_about
)
# Process setup
self
.
simfProcess
.
readyRead
.
connect
(
self
.
console_write
)
self
.
simfProcess
.
started
.
connect
(
self
.
process_started
)
self
.
simfProcess
.
finished
.
connect
(
self
.
process_finished
)
# Opens a link
@
staticmethod
def
open_link
(
link
):
webbrowser
.
open
(
link
)
# Triggered when window closes, I know it isn't PEP8 compliant but thats
# the way pyqt5 is
def
closeEvent
(
self
,
QCloseEvent
):
self
.
simfProcess
.
kill
()
self
.
close
()
def
show_about
(
self
):
self
.
aboutdialog
=
AboutDialog
()
def
show_settings
(
self
):
self
.
configdialog
=
ConfigEditor
()
def
process_started
(
self
):
self
.
startCapButton
.
setDisabled
(
True
)
self
.
stopCapButton
.
setEnabled
(
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment