def __init__(self, session: Session): BaseWidget.__init__(self, session.name) self.set_margin(5) self.session = session self._reload = ControlButton('Reload') self._graph = ControlMatplotlib('Value') self._timer = QTimer() self._timer.timeout.connect(self.update) self._read = 0 self._deltas = None self._last_trial_end = None self._states_dict = {} self._trials_list = [] self.formset = ['_graph'] self.colors = list(mcolors.CSS4_COLORS.values()) self._graph.on_draw = self.__on_draw_evt self._reload.value = self.__reload_evt
def __init__(self, setup=None): BaseWidget.__init__(self, 'Session') self.layout().setContentsMargins(5, 10, 5, 5) self._name = ControlText('Session') self._setup_name = ControlText('Setup') self._board_name = ControlText('Board') self._task_name = ControlText('Task') self._started = ControlText('Started on') self._ended = ControlText('Ended on') self._subjects = ControlList('Subjects') self._board_serial_port = ControlText('Serial port') self._variables = ControlList('Variables') Session.__init__(self, setup) self._formset = [ '_name', '_started', '_ended', '_setup_name', '_task_name', '_board_name', '_board_serial_port', '_subjects', '_variables', ] self._subjects.readonly = True self._subjects.enabled = False self._variables.readonly = True self._variables.enabled = False self._setup_name.enabled = self._board_name.enabled = self._task_name.enabled = False self._board_serial_port.enabled = self._started.enabled = self._ended.enabled = False self._name.changed_event = self.__name_edited_evt
def __init__(self, project): # type: (Project) -> None """ :param project: project where this experiment belongs :type project: pycontrolgui.models.project.Project """ BaseWidget.__init__(self, 'Experiment') self.layout().setContentsMargins(5, 10, 5, 5) self._name = ControlText('Exp. name') # self._task = ControlCombo('Protocol', changed_event=self.__task_changed_evt) self._runsetup = ControlButton('Run all') self._formset = [ '_name', # '_task', '_runsetup', ' ' ] Experiment.__init__(self, project) # self.reload_tasks() self._name.changed_event = self.__name_changed_evt self._runsetup.value = self.__run_all
def __init__(self): BaseWidget.__init__(self, 'Email List') self._list_of_emails = list() self._emailList = ControlList( 'Emails', item_selection_changed_event=self.__get_body) self._emailList.horizontal_headers = ['Sender', 'Date', 'Subject'] self._emailList.readonly = True self._emailList.select_entire_row = True self._email = '*****@*****.**' self._pass = '******' self._panel = EmailWindow() self._panel.parent = self # Get a connection to your email account try: include_seen = True self._myCon = MyCon(self._email, self._pass) self._myCon._con.select('inbox') self._email_ids = self._myCon.get_email_ids(include_seen) self._email_index = 0 # initialize index to first element except ValueError as e: print(e) index = 0 for email in self._email_ids: sender, date, subject, body = self._myCon.extract_info(email) mail = Email(index, sender, date, subject, body) self._list_of_emails.append(mail) self._emailList.__add__( [mail.get_sender(), mail.get_date(), mail.get_subject()]) self._emailList.resize_rows_contents()
def __init__(self, checkedList): Player.__init__(self, '', '', '') BaseWidget.__init__(self, 'Add New Player') # Init local vars self.__checked = checkedList # Init UI Elements self._txtPlayerName = ControlText('Player Name') self._cboCharacterName = ControlCombo('Character Name') self._cboStarterDeck = ControlCombo('Starter Deck') self._btnAddPlayer = ControlButton('Add Player') # Set up properties of UI elements, attach callbacks, etc. self._btnAddPlayer.value = self.__onAddPlayerClick # Populate Character Names and Starter Decks characters = loader.getFilteredList(MBType.CHARACTER, self.__checked) decks = loader.getFilteredList(MBType.STARTER, self.__checked) for char in characters: self._cboCharacterName.add_item(char, char) for deck in decks: self._cboStarterDeck.add_item(deck, deck) # set up flow of components self.formset = [ '_txtPlayerName', '_cboCharacterName', '_cboStarterDeck', '_btnAddPlayer' ]
def __init__(self, _project): BaseWidget.__init__(self, self.TITLE) AlyxModule.__init__(self) User.__init__(self, _project) self.project = _project self._namebox = ControlText('User:'******'Password:'******'Connect',default = self._connect) self._status_lbl = ControlLabel('Status: Not Connected') self._getsubjects_btn = ControlButton('Get Subjects', default = self._get_subjects) self.set_margin(10) self._namebox.value = self._name self._namebox.changed_event = self.__name_changed_evt self._password.form.lineEdit.setEchoMode(QLineEdit.Password) self.formset = [ '_namebox', '_password', '_connect_btn', '_status_lbl', '_getsubjects_btn' ] self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
def __init__(self, parent_win, event): BaseWidget.__init__(self, 'Edit frame', parent_win=parent_win) self.event = event self._widget = parent_win self.set_margin(5) self._applybtn = ControlButton('Apply', default=self.__apply_evt) self._label = ControlText('Label', default=event.title) self._begin = ControlNumber( 'Begin', default=event.begin, minimum=0, maximum=100000000000000, changed_event=self.__begin_changed_event ) self._end = ControlNumber( 'End', default=event.end, minimum=0, maximum=100000000000000, changed_event=self.__end_changed_event ) self._color = ControlButton(str(event.color.name()), default=self.__pick_color_evt) self._lock = ControlCheckBox('Locked', default=event.lock) self.formset = [ '_label', ('_begin', '_end'), ('_color', '_lock'), '_applybtn' ]
def __init__(self, _project=None): BaseWidget.__init__(self, self.TITLE, parent_win=_project) AlyxModule.__init__(self) self.project = _project self._addressbox = ControlText('Address') self._username = ControlText('User:'******'Password:'******'User:'******'Password:'******'Connect', default=self._connect) self._status_lbl = ControlLabel('Status: Not Connected') self._getsubjects_btn = ControlButton('Get Subjects', default=self._get_subjects) self._getsubjects_btn.enabled = False self.set_margin(10) self._addressbox.value = conf.ALYX_PLUGIN_ADDRESS self._addressbox.changed_event = self.setaddr if self.project.loggeduser is not None: self._username.value = self.project.loggeduser.name self._password.form.lineEdit.setEchoMode(QLineEdit.Password) self.formset = [ '_addressbox', '_username', '_password', '_connect_btn', '_status_lbl', '_getsubjects_btn' ]
def __init__(self, video): IModelGUI.__init__(self) Object2D.__init__(self, video) BaseWidget.__init__(self, '2D Object', parent_win=video) self._addpath = ControlButton('Add path') self._addcontours = ControlButton('Add contours') self._addvalues = ControlButton('Add values') self._removeobj = ControlButton('Remove') self.formset = [ '_name', #('_addpath', '_addcontours'), #'_addvalues', '_removeobj', ' ' ] self._addpath.icon = conf.ANNOTATOR_ICON_ADD self._removeobj.icon = conf.ANNOTATOR_ICON_REMOVE self._addcontours.icon = conf.ANNOTATOR_ICON_CONTOUR self._addvalues.icon = conf.ANNOTATOR_ICON_CONTOUR self._addpath.value = self.create_path self._addcontours.value = self.create_contours self._addvalues.value = self.create_value self._removeobj.value = self.__remove_object self.create_tree_nodes()
def __init__(self): BaseWidget.__init__(self, 'Login') # Define login screen stuff self._emailField = ControlText('Email') self._passField = ControlPassword('Password') self._button = ControlButton('Login')
def __init__(self): BaseWidget.__init__(self) Organisms.__init__(self) self._list = ControlList( 'Organisms', add_function=self.__addOrganismBtnAction, remove_function=self.__removeOrganismBtnAction) self._list.horizontal_headers = [ 'Kingdom', 'Class', 'Order', 'Family', 'Name' ] self._panel = ControlEmptyWidget() self.filedialog = ControlFile() self.filedialog.hide() self.mainmenu = [{ 'File': [{ 'Open': self.__openMenuAction }, { 'Save': self.__saveMenuAction }] }] # Add by default some entities self.add(cat) self.add(human)
def __init__(self, task=None, when=None, command=None): title = "Post command editor" if when == TaskCommand.WHEN_POST else "Pre command editor" BaseWidget.__init__(self, title, parent_win=task) self.command = command self.task = task self.when = when self.set_margin(5) self._type = ControlCombo('Type of command', changed_event=self.__type_changed_evt) self._cancelbtn = ControlButton('Cancel', default=self.__cancel_evt) self._okbtn = ControlButton('Ok', default=self.__ok_evt) self._command = ControlText('External command', visible=False) self._filesbrowser = ControlTreeView('Files browser') self._type.add_item('Execute a gui script', 'script') self._type.add_item('Execute a external command', 'external') self.formset = [ '_type', '_command', '_filesbrowser', (' ', '_cancelbtn', '_okbtn'), ' ' ] root_path = os.path.abspath(task.path if task else '/') self.syspath_model = QFileSystemModel(self) self.syspath_model.setRootPath(root_path) self.syspath_model.setNameFilters(['*.py']) self.syspath_model.setNameFilterDisables(False) self._filesbrowser.value = self.syspath_model root_index = self.syspath_model.index(root_path) self._filesbrowser.setRootIndex(root_index) for i in range(1, 4): self._filesbrowser.hideColumn(i)
def __init__(self, project=None): BaseWidget.__init__(self, 'Task') self.layout().setContentsMargins(5, 10, 5, 5) self.precmdwin = None self.postcmdwin = None self._namefield = ControlText('Task name', changed_event=self.__name_edited_evt) self._use_server = ControlCheckBox('Trigger soft codes using a UDP port') self._precmds = ControlList( 'Pre commands', add_function=self.__add_pre_command, remove_function=self.__remove_pre_command, readonly=True ) self._postcmds = ControlList( 'Post commands', add_function=self.__add_post_command, remove_function=self.__remove_post_command, readonly=True ) self._formset = [ '_namefield', '_use_server', '_precmds', '_postcmds', ' ' ] Task.__init__(self, project) self.update_commands()
def __init__(self, parent=None, video=None): BaseWidget.__init__(self, 'Simple workflow editor', parent_win=parent) self._parent = parent self._player = ControlPlayer('Player') self._imgfilters = ControlList('Image filters') self._imageflows = ControlCombo('Image workflows') self._blobsflows = ControlCombo('Blobs workflows') self._blobsfilters = ControlList('Blobs filters') self.formset = [ '_player', '=', [{ 'a:Image filter': ['_imageflows', '_imgfilters'], 'b:Blobs filter': ['_blobsflows', '_blobsfilters'] }] ] self.load_order = [ '_imageflows', '_blobsflows', '_imgfilters', '_blobsfilters' ] self._imgfilters.select_entire_row = True self._blobsfilters.select_entire_row = True self._imageflows.changed_event = self.__imageflows_changed_event self._blobsflows.changed_event = self.__blobsflows_changed_event self._player.process_frame_event = self.__process_frame self.video_capture = video self._pipelines = {} # dictinary with all the available pipelines self._pipeline = None # active pipeline class
def __init__(self): BaseWidget.__init__(self, 'Video window') self._player = ControlPlayer('Player') self.formset = ['_player']
def __init__(self, board): BaseWidget.__init__(self, board.name) self.board = board self.layout().setContentsMargins(5, 5, 5, 5) self._code = ControlCodeEditor('Code', self.__get_code()) self._code.changed_event = self.__code_changed_evt
def __init__(self, parent_win=None): BaseWidget.__init__(self, 'Videos selector', parent_win=parent_win) self._videos = ControlCheckBoxList('Videos filter') Dialog.__init__(self) self.formset = ['_videos'] self._videos.selection_changed_event = self.__selection_changed_event
def __init__(self): People.__init__(self) BaseWidget.__init__(self, 'People window') AddMenuFuntionality.__init__(self) self._panel = ControlDockWidget() self._peopleList = ControlList('People', add_function=self.__addPersonBtnAction, remove_function=self.__rmPersonBtnAction) self._peopleList.horizontalHeaders = ['First name', 'Middle name', 'Last name']
def __init__(self): BaseWidget.__init__(self, 'E-Mail Machine') self._panel = ControlEmptyWidget() """ load login screen on startup """ self._panel.value = self.make_login_view()
def __init__(self): # Class Vars: self.__players = [] # List of players # Player Setup Tab -- Init UI Elements #super(MBUI, self).__init__("Millennium Blades Helper") BaseWidget.__init__(self, "Millennium Blades Helper") self._lstPlayers = ControlList('Player List') self._btnAddPl = ControlButton('Add Player') self._btnRemPl = ControlButton('Remove Selected Player') self._btnGenPl = ControlButton('Generate Player Setup') # Player Setup Tab -- Set up properties of UI elements, attach callbacks, etc. self._lstPlayers.horizontal_headers = [ 'Name', 'Character', 'Starter Deck' ] self._btnAddPl.value = self.__onAddPlayerClick self._btnRemPl.value = self.__onRemoveSelectedPlayerClick self._btnGenPl.value = self.__onGeneratePlayerSetupClick # Store Setup Tab -- Init UI Elements self._lstStore = ControlList('Store Components') self._ckAreaLabel = ControlLabel('Sets To Use') self._btnGenerateSt = ControlButton('Generate Store') # Store Setup Tab -- Set up properties of UI elements, attach callbacks etc. self._lstStore.horizontal_headers = ['Category', 'Sets'] self._btnGenerateSt.value = self.__onGenerateStoreClick # Scoring Tab -- Init UI Components self._scoringPanel = ControlEmptyWidget() self._btnGetScoring = ControlButton('Generate Score Sheet') # Scoring Tab -- Set up properties of UI elements, attach callbacks etc. self._btnGetScoring.value = self.__onGenerateScoringClick # Set Selection Tab -- Init UI Components self._chkArea = ControlCheckBoxList('Sets To Use') # Set Selection Tab -- Set up properties of UI elements, attach callbacks etc. self._chkArea += ('Base Set', True) self._chkArea += ('Set Rotation', True) self._chkArea += ('MX #1: Crossover', True) self._chkArea += ('MX #2: Sponsors', True) self._chkArea += ('MX #3: Fusion Chaos', True) self._chkArea += ('MX #4: Final Bosses', True) self._chkArea += ('MX #5: Futures', True) self._chkArea += ('MX #6: Professionals', True) # Set up tabs and component flow for UI self.formset = [{ '1. Player Setup': ['_lstPlayers', ' ', ('_btnAddPl', '_btnRemPl', '_btnGenPl')], '2. Store Setup': ['_lstStore', ' ', '_btnGenerateSt'], '3. Scoring': ['_scoringPanel', '_btnGetScoring'], '4. Set Selection': ['_chkArea'] }]
def __init__(self, **kwargs): BaseWidget.__init__(self, 'Sort paths') Class.__init__(self, **kwargs) try: self.layout().setContentsMargins(10, 5, 10, 5) self.setMinimumHeight(55) except: pass
def __init__(self): # SU2Config.__init__( # self, path_to_cfg='parsed_cfgs/083708_10372018_su2_cfg.yaml') BaseWidget.__init__(self, title='Welcome to SU2 config GUI') # 'parsed_cfgs/083708_10372018_su2_cfg.yaml' su2_cfg = \ SU2Config(path_to_cfg='parsed_cfgs/152721_22272019_su2_cfg.yaml') self.su2_home_win_ctrl = \ SU2GUIHomeWindowCtrl(su2_home_win=self, su2_cfg=su2_cfg)
def __init__(self, **kwargs): BaseWidget.__init__(self, 'Order by position') Class.__init__(self, **kwargs) try: self.layout().setContentsMargins(10, 5, 10, 5) self.setMinimumHeight(65) except: pass self.formset = ['info:Order the blobs by their last position.']
def __init__(self, parent_win=None): BaseWidget.__init__(self, 'Images selector', parent_win=parent_win) self._videos = ControlCheckBoxList('Videos filter') self._images = ControlCheckBoxList('Images filter') Dialog.__init__(self) self.formset = [('_videos', '||', '_images')] self._videos.selection_changed_event = self.__selection_changed_event self._videos.changed_event = self.__update_images
def __init__(self, **kwargs): BaseWidget.__init__(self, 'Track path') Class.__init__(self, **kwargs) try: self.layout().setContentsMargins(10, 5, 10, 5) self.setMinimumHeight(65) except: pass self.formset = ['info:Saves the blobs paths.']
def __init__(self, board): BaseWidget.__init__(self, board.name) self.board = board self.layout().setContentsMargins(5, 5, 5, 5) self.setWindowIcon(QIcon(conf.BOARD_SMALL_ICON)) self._autoscroll_checkbox = ControlCheckBox( 'Auto-scroll', default=True, changed_event=self.__auto_scroll_evt) self._clear_btn = ControlButton('Clear', default=self.__clear_log_evt) self._log = ControlTextArea(readonly=True, autoscroll=False) self.formset = [(' ', '_autoscroll_checkbox', '_clear_btn'), '_log']
def __init__(self, client: Client): BaseWidget.__init__(self, 'Login') # Definition of the forms fields self._client = client self._nameField = ControlText("Name:") self._surnameField = ControlText("Surname:") self._peselField = ControlText("PESEL:") self._passwordField = ControlPassword("Password:"******"Confirm password:"******"Register") # Define the button action self._registerButton.value = self._registerAction
def __init__(self, **kwargs): BaseWidget.__init__(self, 'Polygons Mask') Class.__init__(self, **kwargs) try: self.layout().setContentsMargins(10, 5, 10, 5) self.setMinimumHeight(150) except: pass self._panel = ControlEmptyWidget('Panel', default=ObjectsDialog()) self._panel.value.objects_filter = lambda x: isinstance(x, Geometry) self._panel.value.objects_changed_event = self.__objects_changed_event
def __init__(self, project=None): """ :param project: project where this board belongs :type project: pycontrolgui.models.project.Project """ BaseWidget.__init__(self, 'Board') self.layout().setContentsMargins(5, 10, 5, 5) self._name = ControlText('Box name') self._serial_port = ControlCombo('Serial port') self._refresh_serials = ControlButton( '', icon=QtGui.QIcon(conf.REFRESH_SMALL_ICON), default=self.__refresh_serials_pressed, helptext="Press here to refresh the list of available devices.") self._log_btn = ControlButton('Console') self._active_bnc = ControlCheckBoxList('BNC') self._active_wired = ControlCheckBoxList('Wired') self._active_behavior = ControlCheckBoxList('Behavior') self._loadports_btn = ControlButton('Load board info') self._netport = ControlNumber('Net port', default=36000 + len(project.boards), minimum=36000, maximum=36100) self._events = ControlList('Events', readonly=True) self._inputchannels = ControlList('Input channels', readonly=True) self._outputchannels = ControlList('Output channels', readonly=True) self._saved_serial_port = None Board.__init__(self, project) self._formset = [ '_name', ('_serial_port', '_refresh_serials'), '_netport', '_log_btn', '=', '_loadports_btn', { 'Ports': [ 'Enabled or disable ports', '_active_bnc', '_active_wired', '_active_behavior', ], 'Events': ['_events'], 'Input ch.': ['_inputchannels'], 'Output ch.': ['_outputchannels'] } ] self._name.changed_event = self.__name_changed_evt self._loadports_btn.value = self.__load_bpod_ports self._fill_serial_ports()
def __init__(self, parent=None): BaseWidget.__init__(self, 'Motion counter', parent_win=parent) self.set_margin(5) self.setMinimumHeight(300) self.setMinimumWidth(500) self._player = ControlPlayer('Player') self._datasets = ControlEmptyWidget('Paths', default=DatasetsDialog()) self._backgrounds = ControlEmptyWidget('Backgrounds', default=ObjectsDialog()) self._show_diff = ControlCheckBox('Show diffs boxes') self._threshold = ControlSlider('Threshold', default=5, minimum=1, maximum=255) self._radius = ControlSlider('Radius', default=30, minimum=1, maximum=200) self._apply = ControlButton('Apply', checkable=True) self._compare = ControlCombo('Compare with') self._progress = ControlProgress('Progress') self._formset = [ '_datasets', '=', '_compare', '_backgrounds', ('_threshold', '_radius', '_show_diff'), '_player', '_apply', '_progress' ] self._compare.add_item('Last frame', 1) self._compare.add_item('First frame', 2) self._compare.add_item('Background image', 3) self.load_order = ['_threshold', '_radius', '_show_diff'] self._backgrounds.value.datasets_filter = lambda x: isinstance( x, Image) self._datasets.value.datasets_filter = lambda x: isinstance( x, (Contours, Path)) self._player.process_frame_event = self.__process_frame_event self._datasets.value.video_selection_changed_event = self.__video_selection_changed_event self._compare.changed_event = self.__compare_changed_event self._apply.value = self.__apply_btn_event self._apply.icon = conf.ANNOTATOR_ICON_MOTION self._progress.hide() self._backgrounds.hide()