Skip to content
Snippets Groups Projects
Commit e54b9511 authored by Daniel Meißner's avatar Daniel Meißner Committed by Daniel Meißner
Browse files

moved Su class into lib directory and added more data about SU

parent 2a85f50c
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ import re
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from lib.hardware import Hardware
from lib.version import __version__
from lib.su import Su
class SuGui(QtWidgets.QMainWindow):
"""
......@@ -24,6 +24,7 @@ class SuGui(QtWidgets.QMainWindow):
uic.loadUi("lib/gui/su_mainwindow.ui", self)
self.show()
# setting some defaults
self.setWindowTitle(Su.name_and_version())
self.lineEdit_dump_file.setText(self._get_default_dump_file_path())
self.lineEdit_dump_file.setCursorPosition(0)
self.refresh_hw_button()
......@@ -69,11 +70,10 @@ class SuGui(QtWidgets.QMainWindow):
"""
Show about widget.
"""
QtWidgets.QMessageBox.about(self, \
"About", \
"SU - Spectrum Usage v"+ __version__ + "\n\n" \
"Contact: daniel.meissner@smail.inf.h-brs.de\n" \
"Source: https://git.fslab.de/dmeiss2s/su")
QtWidgets.QMessageBox.about(self, "About", \
Su.name_and_version() + "\n\n" \
"Contact: daniel.meissner@smail.inf.h-brs.de\n" \
"Source: https://git.fslab.de/dmeiss2s/su")
def _get_default_dump_file_path(self):
......
......@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>SU - Spectrum Usage</string>
<string/>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="button_start">
......
# -*- coding: utf-8 -*-
from lib.version import __version__
class Su(object):
"""
Prgramm class to store some information about the programm.
"""
@staticmethod
def version():
"""
Get programm version in Semantic Versioning format.
"""
return __version__
@staticmethod
def name():
"""
Programm name.
"""
return "Spectrum Usage"
@staticmethod
def short_name():
"""
Short programm name.
"""
return "SU"
@staticmethod
def name_and_version():
"""
Return handy string containing short name, name and version.
Example:
SU - Spectrum Usage v0.0.1
"""
return Su.short_name() + " - " + Su.name() + " v" + Su.version()
......@@ -10,22 +10,9 @@ from PyQt5 import QtCore, QtGui, QtWidgets
import lib.gui.gui as gui
from lib.version import __version__
from lib.su import Su
from lib.dependencies import check_dependencies
class Su(object):
"""
"""
@staticmethod
def version():
return __version__
@staticmethod
def name():
return "Spectrum Usage (su)"
def parse_arguments():
parser = argparse.ArgumentParser()
# verbose
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment