Beispiel #1
0
    def createMessageWidget(self):
        '''create message box widget. return group
		'''
        GridStartVal = '2'
        vbox = QtGui.QVBoxLayout()
        hbox = QtGui.QHBoxLayout()
        hbox2 = QtGui.QHBoxLayout()
        self.lbl = QtGui.QLineEdit("Step 1) Open configuration file", self)
        self.lbl2 = QtGui.QLineEdit()
        self.lbl2.setText(os.getcwd())
        self.directoryButton = QtGui.QPushButton("Change Directory")
        hbox.addWidget(QtGui.QLabel("Message"))
        hbox.addWidget(self.lbl)
        hbox2.addWidget(QtGui.QLabel("Set Directory"))
        hbox2.addWidget(self.lbl2)
        hbox2.addWidget(self.directoryButton)
        vbox.addLayout(hbox)
        vbox.addLayout(hbox2)
        messageGroup = QtGui.QGroupBox("Message Box")
        messageGroup.setLayout(vbox)

        if self.tab_widget.currentIndex() == 1:
            self.lbl.setText("click hotspot, press n or press S to skip frame")
        else:
            self.lbl.setText("")
        return messageGroup
Beispiel #2
0
    def createSinoWidget(self):
        '''create a sinogram group for sinogram tab. returns sinogram group
		'''
        self.sino = QSelect2()
        self.sinoView = SinoWidget()

        sinoBox = QtGui.QHBoxLayout()
        sinoBox.addWidget(self.sino)
        sinoBox.addWidget(self.sinoView, 10)
        sinoGroup = QtGui.QGroupBox("Sinogram")
        sinoGroup.setLayout(sinoBox)
        return sinoGroup
Beispiel #3
0
    def createImageProcessWidget(self):
        '''create an Image process group. returns the group
		'''
        self.imgProcessControl = imageProcess()
        self.imgProcess = IView3()

        imgProcessBox = QtGui.QHBoxLayout()
        imgProcessBox.addWidget(self.imgProcessControl)
        imgProcessBox.addWidget(self.imgProcess, 10)
        imgProcessGroup = QtGui.QGroupBox("Image Process")
        imgProcessGroup.setLayout(imgProcessBox)
        return imgProcessGroup
Beispiel #4
0
    def createProjWidget(self):
        '''create a projection group for projection tab. returns projection group
		'''

        self.projection = QSelect2()
        self.projectionView = pg.ImageView()

        projectionBox = QtGui.QHBoxLayout()
        projectionBox.addWidget(self.projection)
        projectionBox.addWidget(self.projectionView, 10)
        projectionGroup = QtGui.QGroupBox("Projections")
        projectionGroup.setLayout(projectionBox)
        return projectionGroup
Beispiel #5
0
    def createSaveHotspotWidget(self):
        '''create a saving hotspot position group. returns the group
		'''
        self.projViewControl = QSelect4()
        self.projView = IView3()

        self.boxSize = 20
        projViewBox = QtGui.QHBoxLayout()
        projViewBox.addWidget(self.projViewControl)
        projViewBox.addWidget(self.projView, 10)
        projViewGroup = QtGui.QGroupBox(" HotSpot")
        projViewGroup.setLayout(projViewBox)
        return projViewGroup
Beispiel #6
0
    def createReconWidget(self):
        '''create a reconstruction group for reconstruction tab. returns reconstruction group
		'''
        self.recon = QSelect3()
        self.recon.sld.setVisible(False)
        self.reconView = IView3()

        self.reconView.view.ROI.setVisible(False)
        reconBox = QtGui.QHBoxLayout()
        reconBox.addWidget(self.recon)
        reconBox.addWidget(self.reconView, 10)
        reconGroup = QtGui.QGroupBox("Reconstruction")
        reconGroup.setLayout(reconBox)
        return reconGroup
Beispiel #7
0
    def widget(self):
        return self._widget

        w = QtGui.QGroupBox()
        w.setTitle(self.name)

        l = QtGui.QGridLayout()
        l.addWidget(self.bar, 0, 0)
        l.addWidget(self.slider, 0, 1)

        l.addWidget(self.button, 1, 0, 1, 2)

        w.setLayout(l)
        w.block = self

        return w
Beispiel #8
0
    def initUI(self):
        horizontalLayout = QtGui.QHBoxLayout()
        verticalLayout = QtGui.QVBoxLayout()

        # Menu ----------------------------------
        # Creates the first groupBox to hold all the radioButtons;
        groupBox1 = QtGui.QGroupBox('Algorithms')
        groupBox1Layout = QtGui.QVBoxLayout()
        groupBox1.setLayout(groupBox1Layout)
        # radioButtons;
        self.bubbleSort_RBtn1 = QtGui.QRadioButton('Unflagged BubbleSort')
        self.bubbleSort_RBtn2 = QtGui.QRadioButton('Flagged BubbleSort')
        self.quickSort_RBtn1 = QtGui.QRadioButton(
            'QuickSort (Leftmost Elem. as Pivot)')
        self.quickSort_RBtn2 = QtGui.QRadioButton(
            'QuickSort (Middle Elem. as Pivot)')
        self.insertionSort_RBtn1 = QtGui.QRadioButton('Insertion Sort')
        self.shellSort_RBtn1 = QtGui.QRadioButton('Shell Sort')
        self.selectionSort_RBtn1 = QtGui.QRadioButton('Selection Sort')
        self.heapSort_RBtn1 = QtGui.QRadioButton('Heap Sort')
        self.mergeSort_RBtn1 = QtGui.QRadioButton('Merge Sort')

        # Creates the second groupBox to hold all the pushButtons;
        groupBox2 = QtGui.QGroupBox('Execution')
        groupBox2Layout = QtGui.QVBoxLayout()
        groupBox2.setLayout(groupBox2Layout)
        # pushButtons;
        self.startBtn = QtGui.QPushButton('Start')
        self.stopBtn = QtGui.QPushButton('Stop')

        # Plot Area -----------------------------
        # Creates the plotWidget that will display the data being sorted;
        self.initPlot()

        # Adds all the Widgets and Layouts;
        groupBox1Layout.addWidget(self.bubbleSort_RBtn1)
        groupBox1Layout.addWidget(self.bubbleSort_RBtn2)
        groupBox1Layout.addWidget(self.quickSort_RBtn1)
        groupBox1Layout.addWidget(self.quickSort_RBtn2)
        groupBox1Layout.addWidget(self.insertionSort_RBtn1)
        groupBox1Layout.addWidget(self.shellSort_RBtn1)
        groupBox1Layout.addWidget(self.selectionSort_RBtn1)
        groupBox1Layout.addWidget(self.heapSort_RBtn1)
        groupBox1Layout.addWidget(self.mergeSort_RBtn1)

        groupBox2Layout.addWidget(self.startBtn)
        groupBox2Layout.addWidget(self.stopBtn)

        verticalLayout.addWidget(groupBox1)
        verticalLayout.addWidget(groupBox2)

        verticalLayout.addStretch()

        horizontalLayout.addLayout(verticalLayout)
        horizontalLayout.addWidget(self.plotWidget)

        # Adds all the Events;
        self.startBtn.clicked.connect(self.clickedStart)
        self.stopBtn.clicked.connect(self.clickedStop)

        # Sets the main window;
        self.setLayout(horizontalLayout)
        self.setGeometry(100, 100, 800, 600)
        self.setWindowTitle('VisualSorting')

        # Checks a default sorting algorithm;
        self.bubbleSort_RBtn1.setChecked(True)
        self.stopBtn.setEnabled(False)

        self.show()
        sys.exit(self.app.exec_())
Beispiel #9
0
    def initUI(self):
        self.xSize = 20
        self.ySize = 20

        self.bgBtn = QtGui.QPushButton("Bg Value")
        self.delHotspotBtn = QtGui.QPushButton("Delete HS")
        self.normalizeBtn = QtGui.QPushButton("Normalize")
        self.cutBtn = QtGui.QPushButton("Cut")
        self.gaussian33Btn = QtGui.QPushButton("3*3 gauss")
        self.gaussian55Btn = QtGui.QPushButton("5*5 gauss")
        self.xUpBtn = QtGui.QPushButton("x: +")
        self.xUpBtn.clicked.connect(self.xUp)
        self.xDownBtn = QtGui.QPushButton("x: -")
        self.xDownBtn.clicked.connect(self.xDown)
        self.yUpBtn = QtGui.QPushButton("y: +")
        self.yUpBtn.clicked.connect(self.yUp)
        self.yDownBtn = QtGui.QPushButton("y: -")
        self.yDownBtn.clicked.connect(self.yDown)

        self.xSizeLbl = QtGui.QLabel("x Size")
        self.ySizeLbl = QtGui.QLabel("y Size")

        self.xSizeTxt = QtGui.QLineEdit(str(self.xSize))
        self.ySizeTxt = QtGui.QLineEdit(str(self.ySize))

        self.combo1 = QtGui.QComboBox()
        self.combo2 = QtGui.QComboBox()

        hb1 = QtGui.QHBoxLayout()
        hb1.addWidget(self.xUpBtn)
        hb1.addWidget(self.xDownBtn)
        hb2 = QtGui.QHBoxLayout()
        hb2.addWidget(self.xSizeLbl)
        hb2.addWidget(self.xSizeTxt)
        hb3 = QtGui.QHBoxLayout()
        hb3.addWidget(self.yUpBtn)
        hb3.addWidget(self.yDownBtn)
        hb4 = QtGui.QHBoxLayout()
        hb4.addWidget(self.ySizeLbl)
        hb4.addWidget(self.ySizeTxt)

        vb1 = QtGui.QVBoxLayout()
        vb1.addLayout(hb1)
        vb1.addLayout(hb2)
        vb2 = QtGui.QVBoxLayout()
        vb2.addLayout(hb3)
        vb2.addLayout(hb4)
        xSG = QtGui.QGroupBox("x Size")
        xSG.setLayout(vb1)
        ySG = QtGui.QGroupBox("y Size")
        ySG.setLayout(vb2)
        vb3 = QtGui.QVBoxLayout()
        vb3.addWidget(self.combo1)
        vb3.addWidget(self.combo2)
        vb3.addWidget(xSG)
        vb3.addWidget(ySG)

        hb6 = QtGui.QHBoxLayout()
        hb6.addWidget(self.bgBtn, stretch=0)
        hb6.addWidget(self.delHotspotBtn, stretch=0)

        hb7 = QtGui.QHBoxLayout()
        hb7.addWidget(self.normalizeBtn, stretch=0)
        hb7.addWidget(self.cutBtn, stretch=0)

        hb8 = QtGui.QHBoxLayout()
        hb8.addWidget(self.gaussian33Btn, stretch=0)
        hb8.addWidget(self.gaussian55Btn, stretch=0)

        vb3.addLayout(hb6)
        vb3.addLayout(hb7)
        vb3.addLayout(hb8)

        self.setLayout(vb3)
Beispiel #10
0
    def getparameters(self):
        #creating user input boxes
        self.enterobserver = QtGui.QLineEdit('VLB')
        self.enterobserver.setMaxLength(3)
        self.enterdatamode = QtGui.QComboBox()
        self.enterdatamode.addItems(
            ['Error', 'Raw', 'Filtered SQ1 Feedback', 'Debugging', 'Mixed Mode (25:7)','Mixed Mode (22:10)','Mixed Mode (24:8)','Mixed mode (18:14)'])
        self.enterreadoutcard = QtGui.QComboBox()
        for i in range(8):
            if i < 4:
                self.enterreadoutcard.addItem('MCE 1 RC %s' % (i % 4 + 1))
            else:
                self.enterreadoutcard.addItem('MCE 2 RC %s' % (i % 4 + 1))
        self.enterreadoutcard.addItem('All')
        self.enterframenumber = QtGui.QLineEdit('1350000')
        self.enterframenumber.setMaxLength(9)
        self.enterdatarate = QtGui.QLineEdit('45')
        self.entertimeinterval = QtGui.QLineEdit('120')
        self.enterchanneldelete = QtGui.QComboBox()
        self.enterchanneldelete.addItems(['No', 'Yes'])
        self.entershowmcedata = QtGui.QComboBox()
        self.entershowmcedata.addItems(['Yes', 'No'])
        self.submitbutton = QtGui.QPushButton('Submit')

        self.mceGroupBox = QtGui.QGroupBox("MCE Parameters")
        self.parameters = QtGui.QFormLayout()
        self.mcetitle = QtGui.QLabel(self)
        self.mcetitle.setAlignment(QtCore.Qt.AlignCenter)
        self.mcetitle.setText('MCE Parameters')
        self.parameters.addRow(self.mcetitle)
        self.parameters.addRow('Observer', self.enterobserver)
        self.parameters.addRow('Datamode', self.enterdatamode)
        self.parameters.addRow('Readout Card', self.enterreadoutcard)
        self.parameters.addRow('Frame Number', self.enterframenumber)
        self.parameters.addRow('Data Rate', self.enterdatarate)
        self.parameters.addRow('Delete Old Columns', self.enterchanneldelete)
        self.parameters.addRow('Time Interval (s)', self.entertimeinterval)
        self.parameters.addRow('Show MCE Data', self.entershowmcedata)
        self.parameters.addRow(self.submitbutton)
        self.mceGroupBox.setLayout(self.parameters)

        # telescope options =================================================
        self.telescan = QtGui.QComboBox()
        self.telescan.addItems(['1D','2D','BowTie (constant el)'])

        self.tel_delay = QtGui.QLineEdit('0')

        self.init_tel = QtGui.QComboBox()
        self.init_tel.addItems(['No','Yes'])



        self.telGroupBox = QtGui.QGroupBox("Telescope Parameters")
        self.telparams = QtGui.QFormLayout()
        self.teltitle = QtGui.QLabel(self)
        self.teltitle.setAlignment(QtCore.Qt.AlignCenter)
        self.teltitle.setText('Telescope Parameters')
        self.telparams.addRow(self.teltitle)
        self.telparams.addRow('Activate Telescope', self.init_tel)
        self.telparams.addRow('Scan Strategy', self.telescan)
        self.telparams.addRow('Delayed Start (sec)', self.tel_delay)
        self.starttel = QtGui.QPushButton('Initialize Telescope')
        self.telparams.addRow(self.starttel)
        self.telGroupBox.setLayout(self.telparams)
        # =====================================================================
        self.parametersquit = QtGui.QVBoxLayout()
        self.parametersquit.setAlignment(QtCore.Qt.AlignCenter)
        self.parametersquit.addWidget(self.telGroupBox)
        self.parametersquit.addWidget(self.mceGroupBox)
        self.quitbutton = QtGui.QPushButton('Quit')
        self.parametersquit.addWidget(self.quitbutton)

        self.readoutcardselect = QtGui.QComboBox()
        self.selectchannel = QtGui.QComboBox()
        self.selectrow = QtGui.QComboBox()
Beispiel #11
0
    def initUI(self):
        """Initialise the GUI."""
        self.usemock = False
        hbmain = QtGui.QHBoxLayout()
        
        self.plt1 = pg.PlotWidget()
        self.plt1.setLabel('left', "y (mm)")
        self.plt1.setLabel('bottom', "x (mm)")
        self.plt1.showGrid(x=True, y=True)
        self.plt_headposition_x = pg.InfiniteLine(angle=90, movable=False)
        self.plt_headposition_y = pg.InfiniteLine(angle=0, movable=False)
        self.plt1.addItem(self.plt_headposition_x)
        self.plt1.addItem(self.plt_headposition_y)
        self.plt_gcode = self.plt1.plot(pen=pg.mkPen('r', width=2))
        self.plt1.setAspectLocked(True,ratio=1)
        
        hbmain.addWidget(self.plt1)
        
        
        vbconsole = QtGui.QVBoxLayout()
        gb = QtGui.QGroupBox('console:')
        gbvb = QtGui.QVBoxLayout()
        
        gbvbhb = QtGui.QHBoxLayout()
        self.gui_console_date_cb = QtGui.QCheckBox('show date', self, checkable=True, checked=False)
        self.gui_console_time_cb = QtGui.QCheckBox('show time', self, checkable=True, checked=False)
        gbvbhb.addWidget(self.gui_console_date_cb)
        gbvbhb.addWidget(self.gui_console_time_cb)
        gbvb.addLayout(gbvbhb)

        self.gui_consoletext = QtGui.QTextEdit()
        gbvb.addWidget(self.gui_consoletext)
        
        self.gui_command = QtGui.QLineEdit('', self)
        self.gui_command.returnPressed.connect(self.respond_gui_command)
        gbvb.addWidget(self.gui_command)
        
        gb.setLayout(gbvb)
        vbconsole.addWidget(gb)

        hbmain.addLayout(vbconsole)


        vbcontrols = QtGui.QVBoxLayout()
        
        gb = QtGui.QGroupBox('connection:')
        gbvb = QtGui.QVBoxLayout()
        hbox = QtGui.QHBoxLayout()
        pb = QtGui.QPushButton("Scan")
        pb.clicked.connect(self.scan)
        self.scanbtn = pb
        hbox.addWidget(pb)
        cb=QtGui.QComboBox()
        self.port_list=cb
        self.port_list.setMinimumWidth(200)
        hbox.addWidget(cb)
        cb=QtGui.QCheckBox("Open")
        self.opened=cb
        cb.stateChanged.connect(self.toggle_connection)
        hbox.addWidget(cb)
        gbvb.addLayout(hbox)
        gb.setLayout(gbvb)
        vbcontrols.addWidget(gb)

        # gb = QtGui.QGroupBox('controls:')
        # gbvb = QtGui.QVBoxLayout()
        # gbvbhb = QtGui.QHBoxLayout()
        # btn = QtGui.QPushButton('unlock')
        # btn.clicked.connect(self.unlock)
        # gbvbhb.addWidget(btn)
        # btn = QtGui.QPushButton('FEED HOLD')
        # btn.clicked.connect(self.feed_hold)
        # gbvbhb.addWidget(btn)
        # btn = QtGui.QPushButton('RESUME')
        # btn.clicked.connect(self.feed_resume)
        # gbvbhb.addWidget(btn)
        # gbvb.addLayout(gbvbhb)
        # gb.setLayout(gbvb)
        # vbcontrols.addWidget(gb)

        gb = QtGui.QGroupBox('main:')
        gbvb = QtGui.QVBoxLayout()
        
        
        gbvbhb = QtGui.QHBoxLayout()
        btn = QtGui.QPushButton('unlock')
        btn.clicked.connect(self.unlock)
        gbvbhb.addWidget(btn)
        
        self.motorlock_enable_cb = QtGui.QCheckBox('motorlock', self, checkable=True, checked=True)
        self.motorlock_enable_cb.clicked.connect(self.motorlock_toggle)
        gbvbhb.addWidget(self.motorlock_enable_cb)
        
        btn = QtGui.QPushButton('set MCS zero (home)!')
        btn.clicked.connect(self.gui_set_mcs_zero)
        gbvbhb.addWidget(btn)
        btn = QtGui.QPushButton('set WCS zero!')
        btn.clicked.connect(self.gui_set_wcs_zero)
        gbvbhb.addWidget(btn)
        gbvb.addLayout(gbvbhb)
        
        gbvbhb = QtGui.QHBoxLayout()
        btn = QtGui.QPushButton('G0 go to MCS origin')
        btn.clicked.connect(self.go_to_mcs_origin)
        gbvbhb.addWidget(btn)
        btn = QtGui.QPushButton('G0 go to WCS origin')
        btn.clicked.connect(self.go_to_wcs_origin)
        gbvbhb.addWidget(btn)
        gbvb.addLayout(gbvbhb)

        gb.setLayout(gbvb)
        vbcontrols.addWidget(gb)

        gb = QtGui.QGroupBox('position:')
        gbvb = QtGui.QVBoxLayout()
        gbvbhb = QtGui.QHBoxLayout()
        btn = QtGui.QPushButton('get state')
        btn.clicked.connect(self.gui_get_state)
        gbvbhb.addWidget(btn)
        self.gui_get_state_online_cb = QtGui.QCheckBox('online', self, checkable=True, checked=False)
        self.gui_get_state_online_cb.clicked.connect(self.gui_get_state_online_cb_clicked)
        gbvbhb.addWidget(self.gui_get_state_online_cb)
        
        
        
        gbvb.addLayout(gbvbhb)
        
        gbvbhb = QtGui.QHBoxLayout()
        self.gui_info_state1 = QtGui.QLabel('state', self)
        self.gui_info_state2 = QtGui.QLabel('state', self)
        self.gui_info_mcs_x = QtGui.QLabel('MCS x', self)
        self.gui_info_mcs_y = QtGui.QLabel('MCS y', self)
        self.gui_info_wcs_x = QtGui.QLabel('WCS x', self)
        self.gui_info_wcs_y = QtGui.QLabel('WCS y', self)        
        
        gbvb.addWidget(self.gui_info_state1)
        gbvb.addWidget(self.gui_info_state2)
        
        gbvbhb = QtGui.QHBoxLayout()
        gbvbhb.addWidget(self.gui_info_mcs_x)
        gbvbhb.addWidget(self.gui_info_mcs_y)
        # gbvb.addLayout(gbvbhb)
        
        #gbvbhb = QtGui.QHBoxLayout()
        gbvbhb.addWidget(self.gui_info_wcs_x)
        gbvbhb.addWidget(self.gui_info_wcs_y)
        gbvb.addLayout(gbvbhb)

        gbvb.addLayout(gbvbhb)
        
        gb.setLayout(gbvb)
        vbcontrols.addWidget(gb)
        
        

        

        gb = QtGui.QGroupBox('jogging controls:')
        gbvb = QtGui.QVBoxLayout()
        
        gbvbhb = QtGui.QHBoxLayout()
        #btn = QtGui.QPushButton('1')
        #btn.clicked.connect(self.unlock)
        #gbvbhb.addWidget(btn)
        self.gui_jog_stepsize = Spinner('jog step size (mm):', 1, step=1, guic=gbvbhb)
        self.gui_jog_feedrate = Spinner('feed rate (mm/min):', 5000, step=100, guic=gbvbhb)
        gbvb.addLayout(gbvbhb)

        horizontalGroupBox = QtGui.QGroupBox("")
        layout = QtGui.QGridLayout()
        layout.setColumnStretch(0, 1)
        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(2, 1)
        
        def set_jogfun(what):
            def fun():
                self.jog(what)
            return fun
        
        
        #d = {'what': '-x +y', 'n': 0, 'm': 0}
        
        def makebutton(d):
            btn = QtGui.QPushButton(d['what'])
            btn.clicked.connect(set_jogfun(d['what']))
            layout.addWidget(btn,d['n'],d['m'])
            
        makebutton({'what': '-x +y', 'n': 0, 'm': 0})   
        makebutton({'what': '+y',    'n': 0, 'm': 1})   
        makebutton({'what': '+x +y', 'n': 0, 'm': 2})   

        makebutton({'what': '-x',    'n': 1, 'm': 0})   
        # makebutton({'what': '',      'n': 1, 'm': 1})   
        makebutton({'what': '+x',    'n': 1, 'm': 2})   

        makebutton({'what': '-x -y', 'n': 2, 'm': 0})   
        makebutton({'what': '-y',    'n': 2, 'm': 1})   
        makebutton({'what': '+x -y', 'n': 2, 'm': 2})        
        
        horizontalGroupBox.setLayout(layout)
        gbvb.addWidget(horizontalGroupBox)
        
        gb.setLayout(gbvb)
        vbcontrols.addWidget(gb)
        
        
        gb = QtGui.QGroupBox('absolute positioning:')
        gbvb = QtGui.QVBoxLayout()
        
        
        
        gbvbhb = QtGui.QHBoxLayout()
        self.gui_g1_xpos_mm = Spinner('x (mm):', 0, step=1, guic=gbvbhb)
        self.gui_g1_ypos_mm = Spinner('y (mm):', 0, step=1, guic=gbvbhb)
        gbvb.addLayout(gbvbhb)
        self.gui_g1_feedrate = Spinner('feed rate (mm/min):', 5000, step=100, guic=gbvb)
        
        gbvbhb = QtGui.QHBoxLayout()
        btn = QtGui.QPushButton('G0 GO')
        btn.clicked.connect(self.g0_go_to_position)
        gbvbhb.addWidget(btn)
        btn = QtGui.QPushButton('G1 GO')
        btn.clicked.connect(self.g1_go_to_position)
        gbvbhb.addWidget(btn)
        gbvb.addLayout(gbvbhb)
        
        gb.setLayout(gbvb)
        vbcontrols.addWidget(gb)
        
        
        gb = QtGui.QGroupBox('spindle control:')
        gbvb = QtGui.QVBoxLayout()
        
        gbvbhb = QtGui.QHBoxLayout()
        self.gui_spindlespeed = Spinner('spindle / servo:', 600, step=50, bounds=[0, 1000], guic=gbvbhb, fun=self.set_spindle_speed)
        
        self.gui_spindle_enable_cb = QtGui.QCheckBox('Spindle', self, checkable=True, checked=False)
        self.gui_spindle_enable_cb.clicked.connect(self.gui_spindle_enable_cb_clicked)
        gbvbhb.addWidget(self.gui_spindle_enable_cb)
        
        #btn = QtGui.QPushButton('ON')
        #btn.clicked.connect(self.set_spindle_on)
        #gbvbhb.addWidget(btn)
        #btn = QtGui.QPushButton('OFF')
        #btn.clicked.connect(self.set_spindle_off)
        #gbvbhb.addWidget(btn)
        
        gbvb.addLayout(gbvbhb)
        gb.setLayout(gbvb)
        vbcontrols.addWidget(gb)
        
        
        
        gb = QtGui.QGroupBox('G-code streaming:')
        gbvb = QtGui.QVBoxLayout()
        
        gbvbhb = QtGui.QHBoxLayout()
        l = QtGui.QLabel('file:')
        gbvbhb.addWidget(l)
        self.gcodefile_text = QtGui.QTextEdit(os.path.join(os.path.expanduser('~'), 'test.gcode'))
        self.gcodefile_text.setMinimumWidth(150)
        self.gcodefile_text.setMaximumHeight(30)
        gbvbhb.addWidget(self.gcodefile_text)
        btn = QtGui.QPushButton('...')
        btn.clicked.connect(self._browse_gcodefile)
        gbvbhb.addWidget(btn)
        btn = QtGui.QPushButton('load')
        btn.clicked.connect(self.gcode_load_file)
        gbvbhb.addWidget(btn)
        gbvb.addLayout(gbvbhb)
        
        gbvbhb = QtGui.QHBoxLayout()
        self.gcode_stream_progressbar = QtGui.QProgressBar(self)
        gbvbhb.addWidget(self.gcode_stream_progressbar)
        
        
        btn = QtGui.QPushButton('start streaming')
        btn.clicked.connect(self.gcode_stream_start)
        gbvbhb.addWidget(btn)
        btn = QtGui.QPushButton('stop streaming')
        btn.clicked.connect(self.gcode_stream_stop)
        gbvbhb.addWidget(btn)
        gbvb.addLayout(gbvbhb)
        
        self.gui_eta_info = QtGui.QLabel('--- streaming ETA info ---', self)
        gbvb.addWidget(self.gui_eta_info)
        
        gbvb.addLayout(gbvbhb)
        gb.setLayout(gbvb)
        vbcontrols.addWidget(gb)
        
        gb = QtGui.QGroupBox('')
        gbhb = QtGui.QHBoxLayout()
        
        btn = QtGui.QPushButton('FEED HOLD')
        btn.clicked.connect(self.feed_hold)
        btn.setMinimumHeight(60)
        gbhb.addWidget(btn)
        btn = QtGui.QPushButton('RESUME')
        btn.clicked.connect(self.feed_resume)
        btn.setMinimumHeight(60)
        gbhb.addWidget(btn)
        
        gb.setLayout(gbhb)
        vbcontrols.addWidget(gb)
        
        
        
        hbmain.addLayout(vbcontrols)
        hbmain.setStretch(0,2)
        hbmain.setStretch(1,1)
        hbmain.setStretch(2,1)
        
        self.setLayout(hbmain)
        self.setGeometry(20, 40, 1400, 900)
        self.setWindowTitle('Vplotter Controller')
        self.setStyleSheet("font-size: 12pt")
        self.show()
        self.scan()
        
        self.get_state_timer = QtCore.QTimer()
        self.get_state_timer.timeout.connect(self.gui_get_state)
        self.serial_active = False
        self.gcode_stream_running = False