Exemplo n.º 1
0
    def _widgets(self):
        """Insight GUI items for operation and status display"""
        # Action and error log from parent Controller class
        Controller._widgets(self)

        # Emission and shutter operation
        self.emission_button = ControlButton('Laser Off')
        self.emission_button.value = self._emission
        self.main_shutter_button = ControlButton('Main Shutter Closed')
        self.main_shutter_button.value = self._main_shutter_control
        self.fixed_shutter_button = ControlButton('1040 nm Shutter Closed')
        self.fixed_shutter_button.value = self._fixed_shutter_control

        # OPO Tuning
        self.tune_wl_val = ControlText('Set Wavelength (nm):')
        self.tune_wl_button = ControlButton('Set')
        self.tune_wl_button.value = self._tune_wl
        self._main_wl_label = ControlLabel('Main Wavelength (nm): %s' \
                                                            % str(self.opo_wl))

        # Define statistics displays
        self._stats_labels()

        self._state_label = ControlLabel('%s' % (self.state))

        # Stored buffer with fault codes
        self._code_history = ControlTextArea('Status Buffer History')
        self._code_history.readonly = True
Exemplo n.º 2
0
    def __init__(self):
        super(FundCalculatorGUI, self).__init__('FundCalculatorGUI')

        self.daily_report = ControlLabel()

        self.current_fund = ControlLabel('Current Fund:')
        self.fund_code = ControlText('Fund Code:')
        self.fund_amount = ControlText('Fund Amount:')
        self.add_fund_button = ControlButton('Add Fund')
        self.add_fund_button.value = self.add_fund

        self.sender_address = ControlText('Sender Address:')
        self.sender_password = ControlText('Sender Password:'******'Receiver Address:')

        self.current_status_label = ControlLabel('Current Status:')
        self.current_status = ControlLabel(
            time.strftime('%Y-%m-%d %H:%M', time.localtime(time.time())) +
            ' Program is not running...' + ' ' * 10)

        self.button = ControlButton('OK')
        self.button.value = self.button_action

        self.set_margin(15)
        self.formset = [{
            'Daily Report': ['daily_report'],
            'Fund List':
            ['current_fund', ('fund_code', 'fund_amount'), 'add_fund_button'],
            'Settings': [('sender_address', 'sender_password'),
                         'receiver_address',
                         ('current_status_label', 'current_status'), 'button']
        }]
Exemplo n.º 3
0
    def __init__(self):
        super(MainWindow, self).__init__('PABLOPOLY')
        print()
        # Setting defaults settings
        self._board = ControlList(label='Tabuleiro')
        self._playDice = ControlButton('Jogar Dado')
        self.mylabel = ControlLabel('One')
        self._teste = ControlWeb()
        self._teste.value = 'https://github.com/UmSenhorQualquer/pyforms'
        self._myMoney = ControlProgress(label='Your Money is on %p%',
                                        default=15,
                                        min=0,
                                        max=100)
        self._informations = ControlLabel(
            'Inital Money: $ 1500,00 | Max Money: $ 10000,00')

        self._board.value = returnBoad()

        self.formset = [
            (('_teste', '=', '_myMoney'), '_playDice'),
            '_informations',
        ]
        print(self.formset)

        self._playDice.value = self.__playDices
Exemplo n.º 4
0
    def __init__(self):
        super().__init__('DiceRoller')
        #PYFORMS_STYLESHEET = 'style.css'

        self._resultlabel = ControlLabel('Last 3 Results: ')
        self._resultDisplay0 = ControlLabel()
        self._resultDisplay1 = ControlLabel()
        self._resultDisplay2 = ControlLabel()

        self._1d4img = ControlImage('img\1d4a.jpg')
        self._1d4 = ControlButton('1d4')
        self._1d6 = ControlButton('1d6')
        self._1d8 = ControlButton('1d8')
        self._1d10 = ControlButton('1d10')
        self._1d12 = ControlButton('1d12')
        self._1d20 = ControlButton('1d20')

        #Define the Button Actions

        self._1d4.value = self._1d4Action

        #Define the organization of the Form Controls
        self._formset = [
            '_1d4', '_1d6', '_1d8', '_1d10', '_1d12', '_1d20',
            ('_resultlabel', '_resultDisplay0', '_resultDisplay1',
             '_resultDisplay2')
        ]
Exemplo n.º 5
0
    def __init__(self):
        super().__init__('DiceRoller')
        #PYFORMS_STYLESHEET = 'style.css'
        self._resultlabel = ControlLabel('Last Result: ')
        self._results = ControlLabel()


        self._1d4   = ControlButton('1d4')
        self._1d6   = ControlButton('1d6')
        self._1d8   = ControlButton('1d8')
        self._1d10  = ControlButton('1d10')
        self._1d12  = ControlButton('1d12')
        self._1d20  = ControlButton('1d20')
        #Define the Button Actions

        self._1d4.value = self._1d4Action
        self._1d6.value = self._1d6Action
        self._1d8.value = self._1d8Action
        self._1d10.value = self._1d10Action
        self._1d12.value = self._1d12Action
        self._1d20.value = self._1d20Action

        #Define the organization of the Form Controls
        self._formset = [
            '_1d4',
            '_1d6',
            '_1d8', 
            '_1d10',
            '_1d12',
            '_1d20',
            ('_resultlabel','_results')
        ]
Exemplo n.º 6
0
    def build(self):
        # Definition of the forms fields
        # self._mouseWeight = ControlText(label="Current weight for {}:")

        self._mouse_name = ControlLabel(
            f"Subject: {self.session_dict['mouse_name']}")
        self._mouse_projects = ControlLabel(
            f"Projects: {self.session_dict['mouse_projects']}")
        if len(self.session_dict["mouse_projects"]) > 1:
            self._mouse_project = ControlText(
                label="Latest project:",
                default=ast.literal_eval(
                    self.session_dict["mouse_projects"])[0],
            )
        elif len(self.session_dict["mouse_projects"]) == 1:
            self._mouse_project = ControlLabel(
                f"Selected project: {list(self.session_dict['mouse_projects'])[0]}"
            )
        elif len(self.session_dict["mouse_projects"]) < 1:
            self._mouse_project = ControlLabel(
                f"Selected project: {self.session_dict['mouse_projects']}")
        self._mouse_weight = ControlText(
            label=f"Current weight for {self.session_dict['mouse_name']}:")
        self._session_is_mock = ControlText(
            label="Is this a MOCK session?",
            default=self.session_dict["session_is_mock"],
        )
        self._session_index = ControlText(
            label="Session number:",
            default=str(int(self.session_dict["session_index"]) + 1),
        )
        self._session_delay = ControlText(
            label="Delay session initiation by (min):",
            default=self.session_dict["session_delay"],
        )

        self._button = ControlButton("Submit")

        # Define the organization of the forms
        self.formset = [
            (" ", " ", " "),
            ("_mouse_name"),
            ("_mouse_projects"),
            ("_mouse_project"),
            ("_mouse_weight"),
            ("_session_is_mock"),
            ("_session_index"),
            ("_session_delay"),
            (" ", " ", " "),
            (" ", "_button", " "),
            (" ", " ", " "),
        ]
        # The ' ' is used to indicate that a empty space should be placed at the bottom of the win
        # If you remove the ' ' the forms will occupy the entire window

        # Define the button action
        self._button.value = self.__buttonAction

        self.form_data: dict = {}
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self._user_request_app = kwargs.get('user_request_app')

        self._requirements = ControlLabel('Requirements', visible=False)

        self.resource.changed_event = self.__resource_changed_evt
Exemplo n.º 8
0
    def __init__(self):
        super(SessionForm, self).__init__('Session info')
        # Definition of the forms fields
        self._mouseWeight = ControlText(
            label='Please insert the name of the mouse:')
        self._probeLeftLabel = ControlLabel('Probe LEFT')
        self._probeRightLabel = ControlLabel('Probe RIGHT')
        self._probeLeftX = ControlText('X:', default='0')
        self._probeLeftY = ControlText('Y:', default='0')
        self._probeLeftZ = ControlText('Z:', default='0')
        self._probeLeftD = ControlText('D:', default='0')
        self._probeLeftAngle = ControlText('Angle:', default='0')
        self._probeLeftOrigin = ControlCombo('Origin:')
        self._probeLeftOrigin.add_item('', None)
        self._probeLeftOrigin.add_item('Bregma', 'bregma')
        self._probeLeftOrigin.add_item('Lambda', 'lambda')

        self._probeRightX = ControlText('X:', default='0')
        self._probeRightY = ControlText('Y:', default='0')
        self._probeRightZ = ControlText('Z:', default='0')
        self._probeRightD = ControlText('D:', default='0')
        self._probeRightAngle = ControlText(label='Angle:', default='0')
        self._probeRightOrigin = ControlCombo('Origin:')
        self._probeRightOrigin.add_item('', None)
        self._probeRightOrigin.add_item('Bregma', 'bregma')
        self._probeRightOrigin.add_item('Lambda', 'lambda')

        self._button = ControlButton('Submit')

        # Define the organization of the forms
        self.formset = [(' ', ' ', ' ', ' ', ' '),
                        (' ', '_mouseWeight', ' ', ' ', ' '),
                        (' ', '_probeLeftLabel', ' ', '_probeRightLabel', ' '),
                        (' ', '_probeLeftX', ' ', '_probeRightX', ' '),
                        (' ', '_probeLeftY', ' ', '_probeRightY', ' '),
                        (' ', '_probeLeftZ', ' ', '_probeRightZ', ' '),
                        (' ', '_probeLeftD', ' ', '_probeRightD', ' '),
                        (' ', '_probeLeftAngle', ' ', '_probeRightAngle', ' '),
                        (' ', '_probeLeftOrigin', ' ',
                         '_probeRightOrigin', ' '), (' ', '_button', ' '),
                        (' ', ' ', ' ', ' ', ' ')]
        # The ' ' is used to indicate that a empty space should be placed at the bottom of the win
        # If you remove the ' ' the forms will occupy the entire window

        # Define the button action
        self._button.value = self.__buttonAction

        self.form_data: dict = {}
        self.valid_form_data: bool = False
class UserRequestForm(ModelFormWidget):

    TITLE = 'Access request'

    MODEL = AccessRequest

    FIELDSETS = [
        'resource',
        '_requirements',
        'reason'
    ]

    CREATE_BTN_LABEL = '<i class="plus icon"></i> Submit request'
    HAS_CANCEL_BTN_ON_ADD = False
    HAS_CANCEL_BTN_ON_EDIT = False

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self._user_request_app = kwargs.get('user_request_app')

        self._requirements = ControlLabel('Requirements', visible=False)

        self.resource.changed_event = self.__resource_changed_evt


    def __resource_changed_evt(self):

        if self.resource.value:
            resource = Resource.objects.get(pk=self.resource.value)
            self._requirements.value = f'<h3>{resource.name}</h3>{resource.access_req}'
            self._requirements.show()
        else:
            self._requirements.hide()


    def validate_object(self, obj):
        obj.requested_by = PyFormsMiddleware.user()
        return obj

    def save_object(self, obj, **kwargs):
        self._user_request_app.populate_list()
        return super().save_object(obj, **kwargs)

    def delete_event(self):
        res = super().delete_event()
        self._user_request_app.populate_list()
        return res
Exemplo n.º 10
0
    def __init__(self,
                 user=None,
                 connection=None,
                 timestamp='',
                 symbol='',
                 price='',
                 message='',
                 flag='',
                 key=''):
        super(NotificationWidget, self).__init__(timestamp, symbol, price,
                                                 message, key)
        BaseWidget.__init__(self, 'Notification')
        self._user = user
        self._connection = connection
        if timestamp != '':
            self._timestamp_field = ControlLabel(timestamp)
        else:
            ts = datetime.now().timestamp()
            self._timestamp_field = ControlLabel(
                datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
        self._symbol_field = ControlText('Company Symbol')
        self._price_field = ControlText('Current Price (Optional)')
        self._message_field = ControlTextArea('Advisory')
        if symbol != '':
            self._symbol_field.value = symbol
        if price != '':
            self._price_field.value = price
        if message != '':
            self._message_field.value = message
        if flag == 'new':
            self._sendButton = ControlButton('Send')
            self._sendButton.value = self.__sendNotification
        elif flag == 'view':
            self._sendButton = ControlButton('Close')
            self._sendButton.value = self._close
        elif flag == 'edit':
            self._sendButton = ControlButton('Save')
            self._sendButton.value = self.__sendUpdate
        else:
            self._sendButton = ControlButton('Close')
            self._sendButton.value = self._close

        self._formset = [
            ' ', ('||', '_timestamp_field', '||', ' '),
            ('||', '_symbol_field', '||', ' '), '=',
            ('||', '_price_field', '||', ' '), ('||', '_message_field', '||'),
            ('||', '_sendButton', '||')
        ]
Exemplo n.º 11
0
    def __init__(self):
        super(youPyDownloader, self).__init__('youtube downloader')

        #definatino of forms fields
        self._videoUrl = ControlText('Video Url')
        self._button = ControlButton('View Details')
        self._details = ControlTextArea("Details")
        self._downloadButton = ControlButton("Download")

        self._downloadCompleted = ControlLabel(" ")

        self._button.value = self.__buttonAction
        self._downloadButton.value = self.__downloadAction

        self.formset = [('_videoUrl'), '_button', '_details',
                        '_downloadButton', '_downloadCompleted']
        #The ' ' is used to indicate that a empty space should be placed at the bottom of the window
        #If you remove the ' ' the forms will occupy the entire window
        self.mainmenu = [{
            'File': [{
                "Downloaded Files": self.__viewDownloaded
            }, {
                'About': self.__about
            }, '-', {
                'Quit': self.__quit
            }]
        }]
Exemplo n.º 12
0
    def _get_param_label(self, param_name: str) -> ControlLabel:
        curr_label = ControlLabel(param_name)
        # place for setting style
        label_font = QFont("Calibri", 10, QFont.Decorative)
        curr_label._form.label.setFont(label_font)

        return curr_label
Exemplo n.º 13
0
    def __init__(self, *args, **kwargs):
        super().__init__('Astrocat GUI')
        self._input_file = ControlFile('Imaging record (*.lsm or *.tiff)')
        #self._json_file = ControlFile('Parameter JSON file')
        self._flags = ControlCheckBoxList('Flags')
        self._morphology_channel = ControlNumber("Morphology channel",
                                                 minimum=0,
                                                 maximum=5,
                                                 default=0)
        self._ca_channel = ControlNumber("Ca channel",
                                         minimum=0,
                                         maximum=5,
                                         default=1)
        self._suff = ControlText("Name suffix", default='astrocat004')
        self._fps = ControlNumber("Movie fps", default=25)
        self._codec = ControlText('Movie codec', default='libx264')

        self._detection_label = ControlLabel('Detection')
        self._detection_loc_nhood = ControlNumber('Nhood', default=5)
        self._detection_loc_stride = ControlNumber('Stride', default=2)
        self._detection_spatial_filter = ControlNumber('Spatial filter',
                                                       default=3)

        self._run_button = ControlButton('Process')
        self._run_button.value = self.__run_button_fired

        self._formset = [
            '_input_file', '=',
            [
                '_detection_label', '_detection_loc_nhood',
                '_detection_loc_stride'
            ], ('_codec', '_fps'), ('_run_button')
        ]
Exemplo n.º 14
0
    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)
Exemplo n.º 15
0
    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'
        ]
Exemplo n.º 16
0
 def __init__(self, *args, **kwargs):
     super().__init__('Youtube Downloader')
     self._url = ControlText('Link')
     self._runbutton = ControlButton('Download')
     self._progress = ControlProgress(max=100)
     self._actualLabel = ControlLabel("Progess:")
     self._status = ControlLabel("Idle")
     self._eta = ControlLabel("")
     self.pattern = re.compile(
         r"^(https?\:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$")
     # self._thumbnail = ControlImage()
     self._formset = [('_url', '_runbutton'), ('_actualLabel', '_status'),
                      ('_progress', '_eta'), ' ']
     # self._url.finishEditing = self.__downloadImage
     self._runbutton.value = self.__buttonAction
     self.disabled = False
Exemplo n.º 17
0
    def __init__(self):
        super(Main, self).__init__('Snake Machine Learning')
        self.selection_rate = ControlText("Selection Rate (0.001-0.999)",
                                          default="0.1")
        self.mutation_rate = ControlText("Mutation Rate (0.001-0.999)",
                                         default="0.01")
        self.population_size = ControlText("Population Size (20-1000)",
                                           default="100")
        self.random_weight_range = ControlText(
            "Random Weight Range (0.1 - 1.0)", default="1.0")
        self.max_generations = ControlText("Max Generations (1 - ...)",
                                           default="100")

        self.show_graphics = ControlCheckBox("Show Graphics", default=True)
        self.games_to_show = ControlText("Games to Show", default="25")
        self.grid_count = ControlText("Grid Count", default="30")
        self.grid_size = ControlText("Grid Size", default="5")

        self.save_population = ControlCheckBox("Save Population")
        self.save_best = ControlCheckBox("Save Best")
        self.save_graph = ControlCheckBox("Save Graph", default=True)

        self.error = ControlLabel("")
        self.start_button = ControlButton('Start Simulation')
        self.start_button.value = self.start_simulation

        self.formset = [
            'h1:Snake Machine Learning', 'h3:Machine Learning Parameters',
            'selection_rate', 'mutation_rate', 'population_size',
            'random_weight_range', 'max_generations', 'h3:Graphics Parameters',
            'show_graphics', 'games_to_show', 'grid_count', 'grid_size',
            'h3:Save Parameters', ('save_population', 'save_graph',
                                   'save_best'), 'error', 'start_button'
        ]
Exemplo n.º 18
0
def returnBoad():
    _list = []
    for i in range(1, 9):
        _tuple = ()
        for j in range(1, 9):
            _tuple += (ControlLabel(f'{i} - {j}'), )
        _list.append(_tuple)
    return _list
    def __init__(self, object2d=None):
        DatasetGUI.__init__(self)
        Path.__init__(self, object2d)
        BaseWidget.__init__(self, '2D Object', parent_win=object2d)

        self.create_tree_nodes()
        
        self._mark_pto_btn        = ControlButton('&Mark point',   checkable=True, icon=conf.ANNOTATOR_ICON_MARKPLACE )
        self._sel_pto_btn         = ControlButton('&Select point', default=self.__sel_pto_btn_event, icon=conf.ANNOTATOR_ICON_SELECTPOINT)
        self._del_path_btn        = ControlButton('Delete path',   default=self.__del_path_btn_event, icon=conf.ANNOTATOR_ICON_DELETEPATH, visible=False)
        self._del_point_btn       = ControlButton('Delete point',  default=self.__del_point_btn_event, icon=conf.ANNOTATOR_ICON_SELECTPOINT, visible=False)
        self._use_referencial     = ControlCheckBox('Apply')
        self._referencial_pt      = ControlText('Referencial',     changed_event=self.__referencial_pt_changed_event)

        self._interpolation_title = ControlLabel('Interpolation',  default='INTERPOLATION', visible=False)
        self._interpolation_mode  = ControlCombo('Mode',           changed_event=self.__interpolation_mode_changed_event, visible=False)
        self._interpolate_btn     = ControlButton('Apply',         default=self.__interpolate_btn_event, icon=conf.ANNOTATOR_ICON_INTERPOLATE, visible=False)
        self._remove_btn          = ControlButton('Remove dataset',default=self.__remove_path_dataset, icon=conf.ANNOTATOR_ICON_REMOVE)

        self._pickcolor   = ControlButton('Pick a color', default=self.__pick_a_color_event)

        self._show_object_name = ControlCheckBox('Show object name', default=False)
        self._show_name = ControlCheckBox('Show name', default=False)

        self._formset = [ 
            '_name',
            ('_show_name', '_show_object_name'),
            ('_referencial_pt', '_use_referencial'),
            '_remove_btn',            
            ' ',
            '_pickcolor',
            ' ',
            ('_mark_pto_btn', '_sel_pto_btn'),
            '_del_path_btn',
            '_del_point_btn',
            '_interpolation_title',
            ('_interpolation_mode', '_interpolate_btn'),
            ' '
        ]

        #### set controls ##############################################
        self._interpolation_mode.add_item("Auto", -1)
        self._interpolation_mode.add_item("Linear", 'slinear')
        self._interpolation_mode.add_item("Quadratic", 'quadratic')
        self._interpolation_mode.add_item("Cubic", 'cubic')
Exemplo n.º 20
0
    def __init__(self):
        super(FluorescencePredictor,
              self).__init__('Предсказатель Флуоресенции')

        #Definition of the forms fields
        self._answer = ControlLabel('Ответ')
        self._load = ControlFile(label='Загрузить снимок')

        self._load.changed_event = self._fileOpen
Exemplo n.º 21
0
    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']
        }]
Exemplo n.º 22
0
 def __init__(self):
     super(MainWindow, self).__init__('Maze Solver')
     self._fileInput = ControlFile("Input file")
     self._cbAlgo = ControlCombo("Algorithm")
     self._cbAlgo.add_item('Brute force', 1)
     self._cbAlgo.add_item('Depth First Search', 2)
     self._cbAlgo.add_item('Breadth First Search', 3)
     self._btnRun = ControlButton("Run")
     self._btnRun.value = self.__btnRunAction
     self._lblStatus = ControlLabel('STATUS: IDLE')
Exemplo n.º 23
0
    def __init__(self, *args, **kwargs):
        super().__init__('Computer vision algorithm example')

        self.set_margin(10)

        #Definition of the forms fields

        self._indir = ControlText(label="Choose Dir:", value=self.INDIR)
        self._indir.value = self.INDIR

        self._outdir = ControlText(label="Choose Output Dir:",
                                   value=self.OUTDIR)
        self._outdir.value = self.OUTDIR

        self._infiles = []
        self._filescount = ControlLabel("Total Files Selected: ")

        self._selectfiles = ControlButton('Select Files')
        self._selectfiles.value = self.__loadFiles

        # self._videofile  = ControlFile('Video')
        # self._outputfile = ControlText('Results output file')
        # self._threshold  = ControlSlider('Threshold', default=114, minimum=0, maximum=255)
        # self._blobsize   = ControlSlider('Minimum blob size', default=110, minimum=100, maximum=2000)
        # self._player     = ControlPlayer('Player')
        self._runbutton = ControlButton('Run')

        # #Define the function that will be called when a file is selected
        # self._videofile.changed_event     = self.__videoFileSelectionEvent
        # #Define the event that will be called when the run button is processed
        self._runbutton.value = self.__runEvent

        self._progress_label = ControlLabel("Progress:")
        self._progress = ControlProgress("%")
        # #Define the event called before showing the image in the player
        # self._player.process_frame_event    = self.__process_frame

        self._image_tbls = controls.ControlList()

        #Define the organization of the Form Controls
        self._formset = [('_indir', '_outdir'),
                         ('_filescount', '_selectfiles'), '_image_tbls',
                         '_runbutton', ('_progress_label', '_progress'), '']
Exemplo n.º 24
0
    def __init__(self):
        super(KaryML_Main, self).__init__(self.APP_NAME)
        self._app_title = ControlLabel(self.APP_NAME)
        self._input_image_path = ControlFile('Input image')
        self._pairs_path = ControlFile('Expected karyotype (optional)')

        self._features_label = ControlLabel("Chose features to be extracted")

        self._f1_check_box = ControlCheckBox(label=self.LENGTH_FEATURE, default=True)
        self._f1_check_box.changed_event = self._f1_check_box_changed
        self._f2_check_box = ControlCheckBox(label=self.CENTROMERIC_INDEX_FEATURE, default=True)
        self._f2_check_box.changed_event = self._f2_check_box_changed
        self._f3_check_box = ControlCheckBox(label=self.BANDING_PATTERN_FEATURE, default=True)
        self._f3_check_box.changed_event = self._f3_check_box_changed
        self._f4_check_box = ControlCheckBox(label=self.AREA_FEATURE, default=True)
        self._f4_check_box.changed_event = self._f4_check_box_changed

        self._eu_dist = ControlButton(EUCLIDEAN_DISTANCE)
        self._we_eu_dist = ControlButton(WEIGHTED_EUCLIDEAN_DISTANCE)
        self._man_dist = ControlButton(MANHATTAN_DISTANCE)

        self._dist_label = ControlLabel(label="Distance to use: " + EUCLIDEAN_DISTANCE.upper(),
                                        default="Distance to use: " + EUCLIDEAN_DISTANCE)

        self._f1_w = ControlSlider(label="Chromosome length", default=25, minimum=0, maximum=100, visible=False)
        self._f2_w = ControlSlider(label="  Centromeric Index", default=25, minimum=0, maximum=100, visible=False)
        self._f3_w = ControlSlider(label="      Banding pattern", default=25, minimum=0, maximum=100, visible=False)
        self._f4_w = ControlSlider(label="Chromosome area", default=25, minimum=0, maximum=100, visible=False)

        self._epochs_no = ControlSlider(label="    Epochs Nr.", default=200000, minimum=50000, maximum=400000)
        self._rows = ControlSlider(label="     Map rows", default=50, minimum=10, maximum=100)
        self._cols = ControlSlider(label="Map columns", default=50, minimum=10, maximum=100)

        self.errors_label_text = ControlLabel(label="Errors:", default="Errors:", visible=True)
        self.errors_label = ControlLabel(label="Errors", default="", visible=False)
        self.info_label_text = ControlLabel(label="Info:", default="Info:", visible=True)
        self.info_label = ControlLabel(label="Info", default="", visible=False)
        self._button = ControlButton('Start {}'.format(self.APP_NAME))
        self._button.value = self._runKarySomAction

        self._eu_dist.value = self.__dist_changed_eu
        self._we_eu_dist.value = self.__dist_changed_we_eu
        self._man_dist.value = self.__dist_changed_man
        self.t = None
Exemplo n.º 25
0
 def __init__(self, *args, **kwargs):
     global settings_json
     BaseWidget.__init__(self, "Settings")
     self._settingslabel = ControlLabel("Settings")
     self._outputfolder = ControlText("SD Card Path")
     self._outputfolder.value = settings_json["outputfolder"]
     self._hmackey = ControlText("Capsrv HMAC Secret")
     self._hmackey.value = settings_json["hmackey"]
     self._customgameid = ControlText("Custom Game ID")
     self._customgameid.value = settings_json["customgameid"]
     self._typelabel = ControlLabel("Type")
     self._imagecheckbox = ControlCheckBox("Image")
     self._imagecheckbox.value = (settings_json["type"] == "image")
     self._imagecheckbox.changed_event = self.imageCheckbox
     self._mangacheckbox = ControlCheckBox("Manga")
     self._mangacheckbox.value = (settings_json["type"] == "manga")
     self._mangacheckbox.changed_event = self.mangaCheckbox
     self._comiccheckbox = ControlCheckBox("Comics")
     self._comiccheckbox.value = (settings_json["type"] == "comics")
     self._comiccheckbox.changed_event = self.comicCheckbox
     self._directionlabel = ControlLabel("Direction")
     self._directionlabel.hide()
     self._lefttoright = ControlCheckBox("From left to right")
     self._lefttoright.hide()
     self._lefttoright.value = (settings_json["direction"] == "ltr")
     self._lefttoright.changed_event = self.fromLeftToRight
     self._righttoleft = ControlCheckBox("From right to left")
     self._righttoleft.hide()
     self._righttoleft.value = (settings_json["direction"] == "rtl")
     self._righttoleft.changed_event = self.fromRightToLeft
     self._savebutton = ControlButton("Save")
     self._savebutton.value = self.saveButton
     self.formset = [("_settingslabel"), ("_outputfolder"), ("_hmackey"),
                     ("_customgameid"), ("_typelabel"),
                     ("_imagecheckbox", "_mangacheckbox", "_comiccheckbox"),
                     ("_directionlabel"), ("_lefttoright", "_righttoleft"),
                     (" "), (" ", " ", "_savebutton")]
     self._typerequested = False
     self._directionrequested = False
	def __init__(self, project):
		IModelGUI.__init__(self)
		Video.__init__(self, project)
		BaseWidget.__init__(self, 'Video window', parent_win=project)

		self._file 			= ControlFile('Video')
		self._addobj 		= ControlButton('Add object')
		self._addimg 		= ControlButton('Add Image')
		self._removevideo  	= ControlButton('Remove')
		self._fps_label 	= ControlLabel('Frames per second')
		self._width_label 	= ControlLabel('Width')
		self._height_label 	= ControlLabel('Height')
		

		self.formset = [
			'_name',
			'_file',
			'_removevideo',
			'_fps_label',
			('_width_label', '_height_label'),
			' '
		]

		self._name.enabled = False

		self._addobj.icon 	 	= conf.ANNOTATOR_ICON_ADD
		self._addimg.icon 	 	= conf.ANNOTATOR_ICON_ADD
		self._removevideo.icon 	= conf.ANNOTATOR_ICON_REMOVE

		self._addobj.value   	 = self.create_object
		self._addimg.value   	 = self.create_image
		

		self._removevideo.value  = self.__remove_video_changed_event
		self._file.changed_event = self.__file_changed_event

		self.treenode = self.tree.create_child('Video', icon=conf.ANNOTATOR_ICON_VIDEO)
		self.treenode.win = self
Exemplo n.º 27
0
    def _widgets(self):
        """Delay stage GUI items for operation and status display"""
        # Action and error log from parent Controller class
        Controller._widgets(self)

        # Home, Enable and Disable stage buttons
        self._home_button = ControlButton('Home')
        self._home_button.value = self._home
        self._disable_button = ControlButton('Disable')
        self._disable_button.value = self._disable
        self._enable_button = ControlButton('Enable')
        self._enable_button.value = self._enable

        # Motion widgets
        self._pos_label = ControlLabel('%f' % (self.pos))
        self.gotopos_text = ControlText('Move to position:')
        self.absmov_button = ControlButton('>')
        self.absmov_button.value = self._absmov

        self._movfor_button = ControlButton('>>')
        self._movfor_button.value = self._movfor
        self._relmov_text = ControlText()
        self._movrev_button = ControlButton('<<')
        self._movrev_button.value = self._movrev

        # Velocity and acceleration widgets
        self._vel_button = ControlButton('Set')
        self._vel_button.value = self._set_vel
        self._vel_text = ControlText('Set velocity:')
        self._vel_label = ControlLabel('%f' % (self.vel))

        self._accel_button = ControlButton('Set')
        self._accel_button.value = self._set_accel
        self._accel_text = ControlText('Set acceleration:')
        self._accel_label = ControlLabel('%f' % (self.accel))

        # State of the stage
        self._state_label = ControlLabel('%s' % (self.state))
Exemplo n.º 28
0
    def __init__(self, su2_config):
        super(CFGEditorWidget, self).__init__(
            label='Placeholder for config settings operations',
            initial_min_width=900,
            initial_max_width=1000)
        # super(ConfigEditorWidget, self).__init__('Sample config editor')
        self.su2_config = su2_config

        self._loaded_config_path_label = ControlLabel(
            'Load path not specified yet')
        self._saved_config_path_label = ControlLabel(
            'Save path not specified yet')

        self._curr_case_label = ControlLabel(self.su2_config.current_case)

        self._set_combo_values()
        tab_dict = self._get_tabs()
        # print(self.physical_problem_values)

        self.formset = [
            ('Currently loaded config path: ', '_loaded_config_path_label',
             ' '),
            ('Currently loaded config path: ', '_saved_config_path_label',
             ' '),
            # tab_dict
            # {
            #     'Problem definition': self._get_problem_definition_formset(),
            #     'Gas Constants': []}
        ]
        # print('self.form.tabs')
        # print(self.form.tabs)
        # print(self.form.__dict__)
        # self.form._tabs = ['one', 'two']
        self.ex_wid_1 = QWidget()
        self.ex_wid_2 = QWidget()
        # self.form.addTab(self.ex_wid, 'one')
        self.form._tabs.append(self.ex_wid_1)
        self.form._tabs.append(self.ex_wid_2)
Exemplo n.º 29
0
    def __init__(self, sender, date, subject, body, id, total):
        BaseWidget.__init__(self, 'Email View')

        # Define email view
        self._senderLabel = ControlLabel("Sent from:")
        self._senderField = ControlLabel(sender)
        self._dateLabel = ControlLabel("Date sent:")
        self._dateField = ControlLabel(date)
        self._subjectLabel = ControlLabel("Subject:")
        self._subjectField = ControlLabel(subject)
        self._bodyField = ControlLabel(body)

        # Define indexing stuff
        self._indexLabel = ControlLabel(id + " of " + total)
        self._prevButton = ControlButton('Previous')
        self._nextButton = ControlButton('Next')
Exemplo n.º 30
0
    def __init__(self):
        super(BlackInkBE, self).__init__('BlackInk Backend')
        self._display_name = ControlLabel('')
        self._accounts_admin = ControlToolButton('Accounts Panel',
                                                 maxheight=100,
                                                 maxwidth=100)
        self._accounts_admin.hide()
        self._accounts_admin.value = self._Accounts

        self._user = None
        self._connection = db_connect()

        self._panel = ControlEmptyWidget()
        self._login()