Skip to content

Commit

Permalink
Added description for the mocked mode popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahsoka committed Jul 14, 2021
1 parent 43229fc commit 2f20644
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions beskar/desc/mocked-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h2>Mocked Mode</h2>

<p>Mocked mode allows you to use this software without needing to connect a SEAL kit to your computer. The program will generate fake values in place of the values that would normally be received from the SEAL kit.<p>

<b>You don't need ANY drivers</b> to run this program when using mocked mode.
15 changes: 8 additions & 7 deletions beskar/popups.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from .utils import BaseInteractable, apply_voltage, get_number_of_devices
from .utils import BaseInteractable, apply_voltage, get_number_of_devices, get_file
from PyQt6 import QtCore, QtWidgets, QtTest
from nidaqmx.system import System
from .constants import offset

import sys
import lorem
import random


Expand Down Expand Up @@ -183,10 +182,13 @@ def __init__(self, main_window):
with self.init(main_window):
self.show_again = True

self.header = QtWidgets.QLabel('<h1>Mocked Mode</h1>')
self.setFixedSize(350, 225)

self.description = QtWidgets.QLabel(lorem.text())
self.description.setWordWrap(True)
# NOTE: This file must exist or the program will crash
with get_file('mocked-mode.md', 'desc', path=True).open() as file:
self.text = QtWidgets.QLabel(file.read())
self.text.setWordWrap(True)
self.text.setTextFormat(QtCore.Qt.TextFormat.RichText)

self.dont_show_again = QtWidgets.QCheckBox("Don't show this message again.")
self.dont_show_again.setObjectName('check_box')
Expand All @@ -195,8 +197,7 @@ def __init__(self, main_window):
self.ok_button.setObjectName('ok_button')

self.main_layout = QtWidgets.QVBoxLayout()
self.main_layout.addWidget(self.header, alignment=QtCore.Qt.AlignmentFlag.AlignCenter)
self.main_layout.addWidget(self.description)
self.main_layout.addWidget(self.text)
self.main_layout.addWidget(self.dont_show_again, alignment=QtCore.Qt.AlignmentFlag.AlignRight)
self.main_layout.addWidget(self.ok_button, alignment=QtCore.Qt.AlignmentFlag.AlignRight)

Expand Down

0 comments on commit 2f20644

Please sign in to comment.