Beispiel #1
0
	def __init__(self):
		super(DOE2py_Utility,self).__init__('DOE2py Utility')

		self._Input 	= ControlFile('Input file')
		self._Weather 	= ControlFile('Weather file')
		self._Library 	= ControlFile('User Library')
		self._Version	= ControlCombo('DOE-2 Version')
		#self._Status_1	= ControlLabel('Simulation Status:')
		#self._Status_2	= ControlLabel('-')
		self._Run		= ControlButton('Run Simulation')
		self._Close		= ControlButton('Close')

		self._formset = ['',('  ','_Input','  '),
		                    ('', '_Weather', '' ),
							('', '_Library', '' ),
							('','_Version', '' ),
							('', '_Run', '' ),
							('','_Close',''),''] #('','_Status_1','','_Status_2', '' )
	
		self._Run.value = self.__RunAction
		self._Close.value = self.__CloseAction	
		
		with open('settings-gui.json') as data_file:    
			data = json.load(data_file)
			self._Input.value = data["lastinput"]
			self._Weather.value = data["lastweather"]
			self._Library.value = data["lastlibrary"]
		for i in range(0,len(data["doe2versions"])):
			self._Version.add_item(data["doe2versions"][i])
    def __init__(self):

        super(VehTrajAnalytics, self).__init__('Vehicle Trajectory Analytics')

        #Definition of the forms fields
        self._firstname = ControlText('First name', 'Default value')
        self._middlename = ControlText('Middle name')
        self._lastname = ControlText('Lastname name')
        self._fullname = ControlText('Full name')
        self._button = ControlButton('Press this button')
        self._button2 = ControlButton('Press this button2')

        self._outputDir = ControlDir("Output Directory")
        self._inputFile = ControlFile("Input Trajectory File")

        self._load = ControlButton("Load")
        self._save = ControlButton("Save")

        self._vehicleId = ControlCombo("Vehicle id")
        self._time = ControlCombo("Time(sec)")
        self._positionX = ControlCombo("PositionX (feet)")
        self._positionY = ControlCombo("PositionY (feet)")

        # Instrumented vehicle trajectories
        self._radarRange = ControlCombo("Radar range (feet)")
        self._radarAngle = ControlCombo("Radar angle (degrees)")
        self._centerline = ControlFile("CenterlineFile")

        #all traffic stream
        self._lane = ControlCombo("Lane")
        self._vLength = ControlCombo("Vehicle Length")
        self._distanceAlong = ControlCombo("Distance Along Corridor")

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

        self.data = None
        self.outFolder = None

        self.formset = [[('_inputFile', '_load'), '_vehicleId', "_time",
                         '_positionX', "_positionY", "_distanceAlong"], "=", {
                             'All Vehicle Trajectories': ['_lane', '_vLength'],
                             'Instrumented Vehicle Trajectories':
                             ['_radarAngle', '_radarRange']
                         }, '=', ('_outputDir', '_save')]

        self._load.value = self.__loadAction
        self._save.value = self.__saveAction
Beispiel #3
0
	def __init__(self, timeline=None):
		super(ImportWindow, self).__init__('Import file', parent_win=timeline)
		self.setContentsMargins(10, 10, 10, 10)
		self._timeline = timeline

		# Definition of the forms fields
		self._filetype = ControlCombo('Please select the type of file you would like to import:')
		self._importButton = ControlButton('Import')
		self._panel = ControlEmptyWidget('Panel')
		self._file = ControlFile('File to import')

		self._panel.value = self._file
		self._filetype.add_item('Events file', 0)
		self._filetype.add_item('Graph file', 1)
		self._filetype.add_item('Bonsai events file', 2)

		self._formset = [
			('_filetype', ' '),
			'_panel',
			(' ', '_importButton'), ' ']

		self._filetype.changed_event = self.__fileTypeChanged
		self._importButton.value = self.__importData

		from pyforms.gui.dialogs.csv_parser import CsvParserDialog
		self._graphCsvParserDlg = CsvParserDialog()
		self._graphCsvParserDlg.xField.label = "Value column"
		self._graphCsvParserDlg.yField.hide()
		self._graphCsvParserDlg.zField.hide()
		self._graphCsvParserDlg.loadButton.hide()

		self._bonsaiImportDlg = BonsaiImportFileDlg()
Beispiel #4
0
	def __init__(self, timeline=None):
		super(BonsaiImportFileDlg, self).__init__('Import file')

		self._file = ControlFile('File to import')
		self._fps = ControlNumber('Video FPS', 30)

		self._formset = [('_fps', '_file')]
Beispiel #5
0
    def __init__(self, columns, parent=None):
        super(GenericCsvParserDialog, self).__init__('CSV Choose the columns',
                                                     parent_win=parent)

        self._filename = None
        self._columns = columns
        self._columns_indexes = []
        self._rownum = 0

        # Definition of the forms fields
        self._filename = ControlFile('CSV File')
        self._separator = ControlText('Separator', 'auto')
        self._startingrow = ControlNumber('Starting row', 0)

        for index, column in enumerate(columns):
            setattr(self, '_col_{0}'.format(index),
                    ControlNumber(column, index, -1, 1000))

        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        form_row = ['_separator'] + [
            '_col_{0}'.format(index) for index, column in enumerate(columns)
        ] + ['_loadButton']

        self._formset = [('_filename', '_startingrow'),
                         tuple(form_row), '_filePreview']
        self._separator.changed_event = self.__refreshPreview
        self._filename.changed_event = self.__refreshPreview
        self._startingrow.changed_event = self.__refreshPreview
        self._loadButton.value = self.load

        self._load_event = None
Beispiel #6
0
    def __init__(self):
        super().__init__('Open oogstlijst')
        self._file = ControlFile('Project')
        self._file.filter = "OLM files (*.olm)"
        self._button_continue = ControlButton('Kies')

        self._button_continue.value = self.open_file
	def __init__(self, name):
		OTModulePlugin.__init__(self, name, iconFile = tools.getFileInSameDirectory(__file__, 'iconvi.jpg'))
		TypeColorVideo.__init__(self)
	
		self._file      = ControlFile("File")
		self._player    = ControlPlayer("Video")

		self._formset = [ "_file", "_player"]
		
		self._file.changed_event = self.__videoSelected
Beispiel #8
0
    def __init__(self):
        super(CsvParserDialog, self).__init__('CSV Choose the columns')
        self._filename = None

        # Definition of the forms fields
        self._filename = ControlFile('CSV File')
        self._separator = ControlText('Separator', ';')
        self._frameCol = ControlNumber('Frame column', 0, 0, 100)
        self._xCol = ControlNumber('X column', 1, 0, 100)
        self._yCol = ControlNumber('Y column', 2, 0, 100)
        self._zCol = ControlNumber('Z column', 3, 0, 100)
        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        self._formset = ['_filename', ('_separator', '_frameCol', '_xCol', '_yCol', '_zCol', '_loadButton'), '_filePreview']
        self._separator.changed = self.__refreshPreview
        self._filename.changed  = self.__refreshPreview
Beispiel #9
0
    def __init__(self, update_function=None):
        super().__init__("Saved Points")

        self._update_function = update_function

        self._open_file = ControlFile(label="Saved Points File")
        self._open_file.changed_event = self._on_open_file

        self._save_file = ControlButton(label="Save")
        self._save_file.value = self._on_save_file

        self._saved_points_list = ControlList(
            label="Saved Points",
            add_function=self._add_saved_point,
            remove_function=self._remove_saved_point)
        self._saved_points_list.data_changed_event = self._change_point

        self._saved_points_list.horizontal_headers = ["Name", "Value"]

        self.formset = [('_open_file', '_save_file'), '_saved_points_list']
Beispiel #10
0
    def __init__(self, columns, parent=None):
        super(GenericCsvParserDialog, self).__init__('CSV Choose the columns',
                                                     parent_win=parent)

        self._filename = None
        self._columns = columns
        self._columns_indexes = []
        self._rownum = 0

        # Definition of the forms fields
        self._filename = ControlFile('CSV File')
        self._separator = ControlCombo('Separator', default='auto')
        self._startingrow = ControlNumber('Starting row', default=0)

        for index, column in enumerate(columns):
            setattr(
                self, '_col_{0}'.format(index),
                ControlNumber(column, default=index, minimum=-1, maximum=1000))

        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        form_row = ['_separator'] + [
            '_col_{0}'.format(index) for index, column in enumerate(columns)
        ] + ['_loadButton']

        self._formset = [('_filename', '_startingrow'),
                         tuple(form_row), '_filePreview']
        self._separator.changed_event = self.__refreshPreview
        self._filename.changed_event = self.__refreshPreview
        self._startingrow.changed_event = self.__refreshPreview
        self._loadButton.value = self.load

        self._load_event = None

        self._separator.add_item('auto', 'auto')
        self._separator.add_item(';', ';')
        self._separator.add_item(',', ',')
        self._separator.add_item('TAB', '\t')
        self._separator.add_item('Excel', csv.excel)
        self._separator.add_item('Excel TAB', csv.excel_tab)
Beispiel #11
0
    def __init__(self):
        super(ChooseColumnsWindow, self).__init__('CSV Choose the columns')
        self._filename = None

        # Definition of the forms fields
        self._filename = ControlFile('File')
        self._separator = ControlText('Separator', ';')
        self._frameCol = ControlNumber('Frame column', 0, 0, 100)
        self._xCol = ControlNumber('X column', 1, 0, 100)
        self._yCol = ControlNumber('Y column', 2, 0, 100)
        self._showZ = ControlCheckBox('Import Z value')			# Not being used yet
        self._zCol = ControlNumber('Z column', 0, 0, 100)		# Not being used yet
        self._filePreview = ControlList('Preview')
        self._loadButton = ControlButton('Load')

        self._formset = ['_filename', ('_separator', '_frameCol', '_xCol', '_yCol', '_loadButton'), '_filePreview']
        self._separator.changed = self.__refreshPreview
        self._filename.changed = self.__refreshPreview

        self._zCol.hide()
        self._showZ.changed = self.__showZChanged
    def __init__(self):
        super(VideoAnnotationEditor, self).__init__('Video annotation editor')

        self._video = ControlFile('Video')
        self._player = ControlPlayer("Player")
        self._time = ControlEventTimeline('Time')

        self._dock = ControlDockWidget("Timeline", side='bottom')

        self._formset = ['_video', '_player']

        self._dock.value = self._time

        self._video.changed = self.__video_changed
        self._player.processFrame = self.process_frame
        self._player.onClick = self.onPlayerClick

        self.mainmenu.insert(0,
                             {'File': [
                                 {'Exit': Exit}
                             ]
                             }
                             )
Beispiel #13
0
    def __init__(self, update_function=None):
        super().__init__("Points")

        self._update_function = update_function

        self._open_file = ControlFile(
            label="Points File: "
        )
        self._open_file.changed_event = self._on_open_file

        self._save_file = ControlButton(
            label="Save"
        )
        self._save_file.value = self._save_points

        self._points_list = ControlList(
            label="Points",
            add_function=self._add_point,
            remove_function=self._remove_point,
            auto_resize=False
        )
        self._points_list.data_changed_event = self._change_point
        self._points_list.horizontal_headers = [
            axis.get_name() for axis in self._axis]

        self._pre_delay_time = ControlNumber(
            label="Pre Delay Time (s)",
            default=1,
            minimum=0,
            maximum=float('inf'),
            decimals=5
        )

        self._measure_time = ControlNumber(
            label="Measure Time (s)",
            default=5,
            minimum=0,
            maximum=float('inf'),
            decimals=5
        )

        self._post_delay_time = ControlNumber(
            label="Post Delay Time (s)",
            default=1,
            minimum=0,
            maximum=float('inf'),
            decimals=5
        )

        self._scan_frequency = ControlNumber(
            label="Scan Frequency (Hz)",
            default=10,
            minimum=0,
            maximum=float('inf'),
            decimals=5
        )

        self._out_file = ControlDir(
            label="Output Folder: "
        )

        self._scan_button = ControlButton(
            label="Scan"
        )
        self._scan_button.value = self._begin_scan

        self.formset = [
            ('_open_file', '_save_file'),
            '_points_list',
            ('_pre_delay_time', '_post_delay_time'),
            ('_measure_time', '_scan_frequency'),
            '_out_file',
            '_scan_button',
        ]
Beispiel #14
0
    def __init__(self):
        super(MultipleBlobDetection, self).__init__(
            'Multiple Blob Detection')

        # Definition of the forms fields
        self._videofile = ControlFile('Video')
        self._outputfile = ControlText('Results output file')

        self._threshold_box = ControlCheckBox('Threshold')
        self._threshold = ControlSlider('Binary Threshold', 114, 0, 255)

        self._roi_x_min = ControlSlider('ROI x top', 0, 0, 1000)
        self._roi_x_max = ControlSlider('ROI x bottom', 1000, 0, 1000)

        self._roi_y_min = ControlSlider('ROI y left', 0, 0, 1000)
        self._roi_y_max = ControlSlider('ROI y right', 1000, 0, 1000)

        # self._blobsize = ControlSlider('Minimum blob size', 100, 100, 2000)
        self._player = ControlPlayer('Player')
        self._runbutton = ControlButton('Run')
        self._start_frame = ControlText('Start Frame')
        self._stop_frame = ControlText('Stop Frame')

        self._color_list = ControlCombo('Color channels')
        self._color_list.add_item('Red Image Channel', 2)
        self._color_list.add_item('Green Image Channel', 1)
        self._color_list.add_item('Blue Image Channel', 0)

        self._clahe = ControlCheckBox('CLAHE      ')
        self._dilate = ControlCheckBox('Morphological Dilation')
        self._dilate_type = ControlCombo('Dilation Kernel Type')
        self._dilate_type.add_item('RECTANGLE', cv2.MORPH_RECT)
        self._dilate_type.add_item('ELLIPSE', cv2.MORPH_ELLIPSE)
        self._dilate_type.add_item('CROSS', cv2.MORPH_CROSS)
        self._dilate_size = ControlSlider('Dilation Kernel Size', 3, 1, 10)

        self._erode = ControlCheckBox('Morphological Erosion')
        self._erode_type = ControlCombo('Erode Kernel Type')
        self._erode_type.add_item('RECTANGLE', cv2.MORPH_RECT)
        self._erode_type.add_item('ELLIPSE', cv2.MORPH_ELLIPSE)
        self._erode_type.add_item('CROSS', cv2.MORPH_CROSS)
        self._erode_size = ControlSlider('Erode Kernel Size', 5, 1, 10)

        self._open = ControlCheckBox('Morphological Opening')
        self._open_type = ControlCombo('Open Kernel Type')
        self._open_type.add_item('RECTANGLE', cv2.MORPH_RECT)
        self._open_type.add_item('ELLIPSE', cv2.MORPH_ELLIPSE)
        self._open_type.add_item('CROSS', cv2.MORPH_CROSS)
        self._open_size = ControlSlider('Open Kernel Size', 19, 1, 40)

        self._close = ControlCheckBox('Morphological Closing')
        self._close_type = ControlCombo('Close Kernel Type')
        self._close_type.add_item('RECTANGLE', cv2.MORPH_RECT)
        self._close_type.add_item('ELLIPSE', cv2.MORPH_ELLIPSE)
        self._close_type.add_item('CROSS', cv2.MORPH_CROSS)
        self._close_size = ControlSlider('Close Kernel Size', 19, 1, 40)

        self._LoG = ControlCheckBox('LoG - Laplacian of Gaussian')
        self._LoG_size = ControlSlider('LoG Kernel Size', 30, 1, 60)

        self._progress_bar = ControlProgress('Progress Bar')

        # 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
        # Define the event called before showing the image in the player
        self._player.process_frame_event = self.__processFrame

        # Define the organization of the Form Controls
        self.formset = [
            ('_videofile', '_outputfile'),
            ('_start_frame', '_stop_frame'),
            ('_color_list', '_clahe', '_roi_x_min', '_roi_y_min'),
            ('_threshold_box', '_threshold', '_roi_x_max', '_roi_y_max'),
            ('_dilate', '_erode', '_open', '_close'),
            ('_dilate_type', '_erode_type', '_open_type', '_close_type'),
            ('_dilate_size', '_erode_size', '_open_size', '_close_size'),
            ('_LoG', '_LoG_size'),
            '_runbutton',
            '_progress_bar',
            '_player'
        ]
    def __init__(self, update_function=None):
        super().__init__("Axis Tab")

        self._update_function = update_function

        self._axis_list = ControlList(label='Axis List',
                                      default='',
                                      add_function=self._on_add_axis,
                                      remove_function=self._on_remove_axis)

        self._axis_list.item_selection_changed_event = self._on_selection_changed
        self._axis_list.data_changed_event = self._on_data_changed
        self._axis_list.select_entire_row = True

        self._axis_hw_type = ControlLabel()

        self._min = ControlNumber(label="Minimum",
                                  minimum=-float('inf'),
                                  maximum=float('inf'),
                                  decimals=5)

        self._min.changed_event = self._on_min_changed
        self._min.visible = False

        self._max = ControlNumber(label="Maximum",
                                  minimum=-float('inf'),
                                  maximum=float('inf'),
                                  decimals=5)

        self._max.changed_event = self._on_max_changed
        self._max.visible = False

        self._norm_min = ControlNumber(label="  0%",
                                       minimum=-float('inf'),
                                       maximum=float('inf'),
                                       decimals=5)

        self._norm_min.changed_event = self._on_norm_min_changed
        self._norm_min.visible = False

        self._norm_max = ControlNumber(label="100%",
                                       minimum=-float('inf'),
                                       maximum=float('inf'),
                                       decimals=5)

        self._norm_max.changed_event = self._on_norm_max_changed
        self._norm_max.visible = False

        self._special_axis = ControlEmptyWidget()

        self._axis_custom = ControlEmptyWidget()

        self._load_button = ControlFile(label="Load Axis")
        self._load_button.changed_event = self._on_load_axis

        self._save_button = ControlButton(label="Save Axis")
        self._save_button.value = self._on_save_axis
        self._save_button.visible = False

        self.formset = [
            '_axis_list', ('_axis_hw_type', '_special_axis'), ('_min', '_max'),
            ('_norm_min', '_norm_max'), '_axis_custom',
            ('_load_button', '_save_button')
        ]