Skip to content

Commit

Permalink
Added description for the Apply Voltage page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahsoka committed Jul 14, 2021
1 parent 2f20644 commit 35d9423
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
7 changes: 7 additions & 0 deletions beskar/desc/apply-voltage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h2>About Applying Voltage</h2>
<p>The Apply Voltage page allows you to apply a voltage using the SEAL kit.</p>

<p>Applying voltage is as simple as dragging the slider or typing a value and clicking the <b>Apply</b> button. In most situations you will want to apply 0.1 volts. Once you click <b>Apply</b>, the applied voltage should appear on the multimeter you have connected to the SEAL kit. If the <b>Apply</b> button is grayed out this means the given value is the current voltage applied. Additionally, when trying to apply voltages on either extreme of slider, a message will appear indicating that the SEAL kit may not be able to apply voltages at the given extreme accurately.</p>

<p>Applying voltage is important for initiating an experiment. Applying a voltage can help "push" along reactions.</p>
<!-- If possible elaborate more on this, don't really know what I'm talking about -->
21 changes: 11 additions & 10 deletions beskar/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ def __init__(self, main_window):
self.interactable_layout = QtWidgets.QVBoxLayout()
self.interactable_layout.contentsMargins().setLeft(1000)
self.interactable_layout.contentsMargins().setRight(1000)
self.interactable_layout.setContentsMargins(
self.interactable_layout.contentsMargins()
)
self.interactable_layout.setContentsMargins(10, 10, 0, 0)
self.interactable_layout.addWidget(self.apply_voltage_label, 0, QtCore.Qt.AlignmentFlag.AlignHCenter)
self.interactable_layout.addItem(spacer1)
self.interactable_layout.addLayout(interaction_hbox)
Expand All @@ -70,16 +68,19 @@ def __init__(self, main_window):
self.interactable_layout.addWidget(self.apply_button, 0, QtCore.Qt.AlignmentFlag.AlignRight)
self.interactable_layout.addItem(spacer1)

self.help_tab_header = QtWidgets.QLabel("<h1>About Apply Voltage</h1>")

self.help_tab_desc = QtWidgets.QLabel(lorem.text())
self.help_tab_desc.setWordWrap(True)
with get_file('apply-voltage.md', 'desc', path=True).open() as file:
# NOTE: Currently if the user compress the window vertically the text
# will not be fully visualable. Might want to add limitations so that
# this can't happen.
self.help_tab = QtWidgets.QLabel(file.read())
self.help_tab.setFixedWidth(275)
self.help_tab.setTextFormat(QtCore.Qt.TextFormat.RichText)
self.help_tab.setWordWrap(True)

self.desc_layout = QtWidgets.QVBoxLayout()
self.desc_layout.addWidget(self.help_tab_header)
# self.desc_layout.addItem(spacer1)
self.desc_layout.addWidget(self.help_tab_desc)
self.desc_layout.addWidget(self.help_tab)
self.desc_layout.addItem(spacer1)
self.desc_layout.setContentsMargins(0, 10, 10, 0)

screen_size = QtWidgets.QApplication.primaryScreen().size()
if Fraction(screen_size.width(), screen_size.height()) >= Fraction(64, 27):
Expand Down

0 comments on commit 35d9423

Please sign in to comment.