Skip to content

Commit

Permalink
Created BaseInteractable class
Browse files Browse the repository at this point in the history
This class will be the base class for all pages and popups
  • Loading branch information
Ahsoka committed Jul 11, 2021
1 parent cee694a commit 51309fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions beskar/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import Generator, Tuple, Union, Literal, List
from PyQt6.QtDataVisualization import QBarDataItem
from nidaqmx._lib import DaqNotFoundError
from contextlib import contextmanager
from PyQt6.QtCore import QMetaObject
from nidaqmx.system import System
from .constants import offset

Expand Down Expand Up @@ -89,3 +91,13 @@ def last_values_zero(self):

return (all(map(lambda item: item == 0, self.last_values_written[-4:]))
and len(self.last_values_written[-4:]) >= 4)


class BaseInteractable:
@contextmanager
def init(self, main_window):
self.main_window = main_window
self.super_()
yield
self.setLayout(self.main_layout)
QMetaObject.connectSlotsByName(self)

0 comments on commit 51309fb

Please sign in to comment.