コード例 #1
0
ファイル: sysinfo.cpp プロジェクト: 376473984/pvb
    SysInfo(QWidget *parent = NULL):
        QFrame(parent)
    {   
        QGroupBox *memBox = new QGroupBox("Memory Usage", this);
        memBox->setFont(QFont("Helvetica", 10));

        QVBoxLayout *memLayout = new QVBoxLayout(memBox);
        memLayout->setMargin(15);
        memLayout->setSpacing(5);

        Qt::Orientation o = Qt::Horizontal;
        memLayout->addWidget(new ValueBar(o, "Used", memBox, 57));
        memLayout->addWidget(new ValueBar(o, "Shared", memBox, 17));
        memLayout->addWidget(new ValueBar(o, "Cache", memBox, 30));
        memLayout->addWidget(new ValueBar(o, "Buffers", memBox, 22));
        memLayout->addWidget(new ValueBar(o, "Swap Used", memBox, 57));
        memLayout->addWidget(new QWidget(memBox), 10); // spacer

        QGroupBox *cpuBox = new QGroupBox("Cpu Usage", this);
        cpuBox->setFont(QFont("Helvetica", 10));

        QHBoxLayout *cpuLayout = new QHBoxLayout(cpuBox);
        cpuLayout->setMargin(15);
        cpuLayout->setSpacing(5);

        o = Qt::Vertical;
        cpuLayout->addWidget(new ValueBar(o, "User", cpuBox, 57));
        cpuLayout->addWidget(new ValueBar(o, "Total", cpuBox, 73));
        cpuLayout->addWidget(new ValueBar(o, "System", cpuBox, 16));
        cpuLayout->addWidget(new ValueBar(o, "Idle", cpuBox, 27));

        QHBoxLayout *layout = new QHBoxLayout(this);
        layout->setMargin(10);
        layout->addWidget(memBox, 10);
        layout->addWidget(cpuBox, 0);
    }
コード例 #2
0
ファイル: motorwidget.cpp プロジェクト: teodorxxx/test
void MotorWidget::createLabelButton()
{
	QSignalMapper *mapper = new QSignalMapper(this);

	QFont fontLine("Arial", 10);

	for (int i=0; i<m_NumberButton; ++i)
	{
		QLineEdit *tempLineEdit = new QLineEdit(this);
		tempLineEdit->setFont(fontLine);
		if (m_Motor->setVectorNameWinding().empty())
			tempLineEdit->setText(tr("Wpisz nazwę uzwojenia"));
		else
			tempLineEdit->setText(QString::fromStdString(m_Motor->returnsNameWinding(i)));

		QPushButton *tempButton = new QPushButton(tr("Dodaj dane uzwojenia"));

		m_VectorLabelButton.push_back(qMakePair(tempLineEdit, tempButton));

		QHBoxLayout *hBox = new QHBoxLayout(this);
		hBox->addWidget(m_VectorLabelButton[i].first);
		hBox->addWidget(m_VectorLabelButton[i].second);

		QGroupBox *tempGrBox = new QGroupBox(tr("Uzwojenie"), this);
		tempGrBox->setFont(QFont("Arial", 12, QFont::Bold));
		tempGrBox->setStyleSheet("QGroupBox{border:1px; border-style:outset; border-color: gray; margin:10px} "
									"QGroupBox::title{subcontrol-origin: margin; subcontrol-position:top left}");
		tempGrBox->setLayout(hBox);

		m_VectorTempWindingBox.push_back(tempGrBox);

		mapper->setMapping (m_VectorLabelButton[i].second, i);
		connect(m_VectorLabelButton[i].second, SIGNAL(clicked()), mapper, SLOT(map()));
	}

	connect(mapper, SIGNAL(mapped(int)), this, SLOT(addDateReconstruction(int)));
}
コード例 #3
0
void MainWindow::setupUpperToolBar() {

	_trackerActivator = new SwitchButton("not tracking", "tracking");
	_trackerActivator->setToolTip("Activate/Disable tracking");
	QObject::connect(_trackerActivator, &SwitchButton::emitSetEnabled, this, &MainWindow::receiveSetTracking, Qt::DirectConnection);
	//QAction* activatorAction = ui->toolBarMenu->addWidget(_trackerActivator);

	/////////////////////media groupbox
	_mediaBox = new QGroupBox("Load media");
	//style groupbox (initial red border -> no video loaded)
	_mediaBox->setStyleSheet("QGroupBox"
		" {border: 1px solid #e56262;}");
	// "QGroupBox::title {subcontrol-origin: margin;subcontrol-position: top center; padding: 0 3px;}");
	QFont font = QFont();
	font.setPointSize(8);
	font.setBold(true);
	_mediaBox->setFont(font);

	QHBoxLayout* mediaBoxLayout = new QHBoxLayout;
	mediaBoxLayout->setContentsMargins(0, 0, 0, 0);
	//mediaBoxLayout->setSpacing(0);
	QToolButton* cameraButton = new QToolButton;
	cameraButton->setIconSize(QSize(24, 24));
	cameraButton->setDefaultAction(ui->actionOpen_Camera);
	cameraButton->setAutoRaise(true);

	QToolButton* videoButton = new QToolButton;
	videoButton->setIconSize(QSize(24, 24));
	videoButton->setDefaultAction(ui->actionOpen_Video);
	videoButton->setAutoRaise(true);

	QToolButton* imageButton = new QToolButton;
	imageButton->setIconSize(QSize(24, 24));
	imageButton->setDefaultAction(ui->actionOpen_Picture);
	imageButton->setAutoRaise(true);

	mediaBoxLayout->addWidget(videoButton);
	mediaBoxLayout->addWidget(imageButton);
	mediaBoxLayout->addWidget(cameraButton);

	_mediaBox->setLayout(mediaBoxLayout);


	ui->toolBarMenu->addWidget(_mediaBox);

	////////trackerbox
	_trackerBox = new QGroupBox("Load tracker");
	//style groupbox
	_trackerBox->setStyleSheet("QGroupBox"
		" {border: 1px solid #e56262;}");
	// "QGroupBox::title {subcontrol-origin: margin;subcontrol-position: top center; padding: 0 3px;}");

	QFont font0 = QFont();
	font0.setPointSize(8);
	font0.setBold(true);
	_trackerBox->setFont(font0);

	QHBoxLayout* trackerBoxLayout = new QHBoxLayout;
	trackerBoxLayout->setContentsMargins(0, 0, 0, 0);

	QToolButton* trackerButton = new QToolButton;
	trackerButton->setIconSize(QSize(24, 24));
	trackerButton->setDefaultAction(ui->actionLoad_Tracker);
	trackerButton->setAutoRaise(true);

	trackerBoxLayout->addWidget(trackerButton);
	_trackerBox->setLayout(trackerBoxLayout);

	ui->toolBarMenu->addWidget(_trackerBox);


	////////loadSaveBox
	QGroupBox* loadSaveBox = new QGroupBox("Load/Save Data");
	//style loadSaveBox
	// loadSaveBox->setStyleSheet("QGroupBox"
	// " {border: 1px solid #e5e5e5;border-radius: 5px;margin-top: 1ex; /* leave space at the top for the title */}"
	// "QGroupBox::title {subcontrol-origin: margin;subcontrol-position: top center; padding: 0 3px;}");

	QFont font2 = QFont();
	font2.setPointSize(8);
	font2.setBold(true);
	loadSaveBox->setFont(font2);

	QHBoxLayout* loadSaveBoxLayout = new QHBoxLayout;
	loadSaveBoxLayout->setContentsMargins(5, 0, 5, 0);

	QToolButton* loadFileButton = new QToolButton;
	loadFileButton->setIconSize(QSize(24, 24));
	loadFileButton->setDefaultAction(ui->actionLoad_trackingdata);
	loadFileButton->setAutoRaise(true);

	QToolButton* saveFileButton = new QToolButton;
	saveFileButton->setIconSize(QSize(24, 24));
	saveFileButton->setDefaultAction(ui->actionSave_trackingdata);
	saveFileButton->setAutoRaise(true);

	loadSaveBoxLayout->addWidget(loadFileButton);
	loadSaveBoxLayout->addWidget(saveFileButton);
	loadSaveBox->setLayout(loadSaveBoxLayout);

	ui->toolBarMenu->addWidget(loadSaveBox);

	//////////////////choose tracker groupbox
	QGroupBox* chooseTrackerBox = new QGroupBox("Choose tracker");
	//style groupbox
	// chooseTrackerBox->setStyleSheet("QGroupBox"
	// " {border: 1px solid #e5e5e5;border-radius: 5px;margin-top: 1ex; /* leave space at the top for the title */}"
	// "QGroupBox::title {subcontrol-origin: margin;subcontrol-position: top center; padding: 0 3px;}");

	QFont font1 = QFont();
	font1.setPointSize(8);
	font1.setBold(true);
	chooseTrackerBox->setFont(font1);
	//
	QHBoxLayout* chooseTrackerBoxLayout = new QHBoxLayout;
	chooseTrackerBoxLayout->addWidget(ui->comboBox_TrackerSelect);
	chooseTrackerBoxLayout->addWidget(_trackerActivator);

	chooseTrackerBox->setLayout(chooseTrackerBoxLayout);

	ui->toolBarMenu->addWidget(chooseTrackerBox);


}
コード例 #4
0
US_EquilTime::US_EquilTime() : US_Widgets( true )
{
   astfem_rsa = new US_Astfem_RSA( model, simparams );
   
   connect( astfem_rsa, SIGNAL( new_scan   ( QVector< double >*, double* ) ),
                        SLOT(   check_equil( QVector< double >*, double* ) ) );
   
   connect( astfem_rsa, SIGNAL( new_time( double ) ),
                        SLOT(   set_time( double ) ) );
   
   setWindowTitle( tr( "Equilibrium Time Prediction" ) );
   setPalette( US_GuiSettings::frameColor() );

   init_simparams();

   QBoxLayout* main = new QHBoxLayout( this );
   main->setSpacing         ( 2 );
   main->setContentsMargins ( 2, 2, 2, 2 );

   // Left Column
   QGridLayout* left = new QGridLayout;
   int row = 0;

   QLabel* lb_sample = us_banner( tr( "Model Settings" ) ); 
   left->addWidget( lb_sample, row++, 0, 1, 2 );

   QGridLayout* buttons1 = new QGridLayout;
   int b_row = 0;

   pb_changeModel = us_pushbutton( tr( "Set / Change / Review Model") );
   connect ( pb_changeModel, SIGNAL( clicked() ) , SLOT( change_model() ) );
   buttons1->addWidget( pb_changeModel, b_row++, 0, 1, 2 );

   left->addLayout( buttons1, row, 0, 3, 2 );
   row += 3;


   QPalette p;
   p.setColor( QPalette::WindowText, Qt::white );
   p.setColor( QPalette::Shadow    , Qt::white );
   
   QFont font( US_GuiSettings::fontFamily(),
               US_GuiSettings::fontSize(),
               QFont::Bold );

   // Radius Info
   QLabel* lb_radius = us_banner( tr( "Radius Settings" ) ); 
   left->addWidget( lb_radius, row++, 0, 1, 2 );
   
   QGroupBox* channelGroupBox = new QGroupBox( tr( "Channel Type" ) );
   channelGroupBox->setContentsMargins ( 2, 2, 2, 2 );
   channelGroupBox->setPalette( p );
   channelGroupBox->setFont   ( font );
   
   QRadioButton* rb_inner;
   QRadioButton* rb_outer;
   QRadioButton* rb_center;
   QRadioButton* rb_custom;

   QGridLayout* rb5 = us_radiobutton( tr( "Inner Channel"  ), rb_inner, true );
   QGridLayout* rb6 = us_radiobutton( tr( "Outer Channel"  ), rb_outer  );
   QGridLayout* rb7 = us_radiobutton( tr( "Center Channel" ), rb_center );
   QGridLayout* rb8 = us_radiobutton( tr( "Custom"         ), rb_custom );

   // Group the buttons
   QButtonGroup* channelGroup = new QButtonGroup;
   channelGroup->addButton( rb_inner , INNER  );
   channelGroup->addButton( rb_outer , OUTER  );
   channelGroup->addButton( rb_center, CENTER );
   channelGroup->addButton( rb_custom, CUSTOM );
   connect( channelGroup, SIGNAL( buttonClicked( int ) ),
                          SLOT  ( new_channel  ( int ) ) );

   current_position = INNER;

   QGridLayout* channel = new QGridLayout;
   channel->setContentsMargins ( 2, 2, 2, 2 );
   channel->setSpacing( 0 );
   channel->addLayout( rb5, 0, 0 );
   channel->addLayout( rb6, 0, 1 );
   channel->addLayout( rb7, 1, 0 );
   channel->addLayout( rb8, 1, 1 );

   channelGroupBox->setLayout( channel );

   left->addWidget( channelGroupBox, row, 0, 2, 2 );
   row += 2;

   // Top Radius
   QLabel* lb_top = us_label( tr( "Top Radius:" ) );
   left->addWidget( lb_top, row, 0 );

   cnt_top = us_counter( 3, 5.8, 7.3, 5.9 );
   cnt_top->setSingleStep( 0.01 );
   cnt_top->setEnabled ( false );
   left->addWidget( cnt_top, row++, 1 );

   // Bottom Radius
   QLabel* lb_bottom = us_label( tr( "Bottom Radius:" ) );
   left->addWidget( lb_bottom, row, 0 );

   cnt_bottom = us_counter( 3, 5.8, 7.3, 6.2 );
   cnt_bottom->setSingleStep    ( 0.01 );
   cnt_bottom->setEnabled ( false );
   left->addWidget( cnt_bottom, row++, 1 );

   // Rotorspeed Info
   QLabel* lb_rotor = us_banner( tr( "Rotorspeed Settings" ) ); 
   left->addWidget( lb_rotor, row++, 0, 1, 2 );
   
   // Speed type buttons
   QGroupBox* rotor  = new QGroupBox( tr( "Speed Type" ) );
   rotor->setContentsMargins ( 2, 10, 2, 2 );
   rotor->setPalette( p );
   rotor->setFont   ( font );
   
   QRadioButton* rb_sigma;
   QRadioButton* rb_rpm;

   QGridLayout* rb9  = us_radiobutton( "Use Sigma", rb_sigma, true );
   QGridLayout* rb10 = us_radiobutton( "Use RPM"  , rb_rpm );

   speed_type  = SIGMA;
   sigma_start = 1;
   sigma_stop  = 4;
   rpm_start   = 18000;
   rpm_stop    = 36000;
 
   speed_count = 5;

   QButtonGroup* speedGroup = new QButtonGroup;
   speedGroup->addButton( rb_sigma, SIGMA );
   speedGroup->addButton( rb_rpm  , RPM   );
   connect( speedGroup,  SIGNAL( buttonClicked( int ) ), 
                         SLOT  ( update_speeds( int ) ) );

   QGridLayout* speedType = new QGridLayout;
   speedType->setContentsMargins( 2, 2, 2, 2 );
   speedType->setSpacing        ( 0 );

   speedType->addLayout( rb9,  0, 0 );
   speedType->addLayout( rb10, 0, 1 );

   rotor->setLayout( speedType );

   left->addWidget( rotor, row++, 0, 1, 2 );

   // Low speed
   lb_lowspeed   = us_label( tr( "Low Speed (sigma):"  ) );
   left->addWidget( lb_lowspeed, row, 0 );
   
   cnt_lowspeed = us_counter( 3, 0.01, 10.0, sigma_start );
   cnt_lowspeed->setSingleStep( 0.01 );
   left->addWidget( cnt_lowspeed, row++, 1 );
   connect( cnt_lowspeed, SIGNAL( valueChanged( double ) ),
                          SLOT  ( new_lowspeed( double ) ) );

   // High speed
   lb_highspeed  = us_label( tr( "High Speed (sigma):" ) );
   left->addWidget( lb_highspeed, row, 0 );
   
   cnt_highspeed = us_counter( 3, 0.01, 10.0, sigma_stop );
   cnt_highspeed->setSingleStep( 0.01 );
   left->addWidget( cnt_highspeed, row++, 1 );
   connect( cnt_highspeed, SIGNAL( valueChanged ( double ) ),
                           SLOT  ( new_highspeed( double ) ) );
   // Speed steps
   QLabel* lb_speedsteps = us_label( tr( "Speed Steps:"        ) );
   left->addWidget( lb_speedsteps, row, 0 );
   
   cnt_speedsteps = us_counter( 3, 1.0, 100.0, speed_count );
   cnt_speedsteps->setSingleStep( 1.0 );
   left->addWidget( cnt_speedsteps, row++, 1 );
   connect( cnt_speedsteps, SIGNAL( valueChanged ( double ) ),
                            SLOT  ( new_speedstep( double ) ) );
   // Speed list
   QLabel* lb_speedlist  = us_label( tr( "Current Speed List:" ) );
   left->addWidget( lb_speedlist, row, 0 );

   te_speedlist = us_textedit(); 
   te_speedlist->setReadOnly( true );

   left->addWidget( te_speedlist, row, 1, 3, 1 );

   left->setRowStretch ( row + 1, 99 );
   row += 3;

   // Misc Info
   QLabel* lb_sim2  = us_banner( tr( "Simulation Settings" ) );
   left->addWidget( lb_sim2, row++, 0, 1, 2 );

   // Tolerance
   QLabel* lb_tolerance  = us_label( tr( "Tolerance:" ) );
   left->addWidget( lb_tolerance, row, 0 );
   
   cnt_tolerance = us_counter( 3, 1.0e-5, 0.01, 0.0005 );
   cnt_tolerance->setSingleStep( 1.0e-5 );
   left->addWidget( cnt_tolerance, row++, 1 );

   // Time increment
   QLabel* lb_time  = us_label( tr( "Time Increment (min):" ) );
   left->addWidget( lb_time, row, 0 );
   
   cnt_timeIncrement = us_counter( 3, 1.0, 1000.0, 15.0 );
   cnt_timeIncrement->setSingleStep( 1.0 );
   left->addWidget( cnt_timeIncrement, row++, 1 );

   QGridLayout* buttons2 = new QGridLayout;
   b_row = 0;

   pb_estimate = us_pushbutton( tr( "Estimate Times" ) );
   pb_estimate->setEnabled( false );
   connect( pb_estimate, SIGNAL( clicked() ), SLOT( simulate() ) );
   buttons2->addWidget( pb_estimate, b_row++, 0, 1, 2 ); 

   QPushButton* pb_help = us_pushbutton( tr( "Help" ) );
   connect( pb_help, SIGNAL( clicked() ), SLOT( help() ) );
   buttons2->addWidget( pb_help, b_row, 0 ); 

   QPushButton* pb_close = us_pushbutton( tr( "Close" ) );
   connect( pb_close, SIGNAL( clicked() ), SLOT( close() ) );
   buttons2->addWidget( pb_close, b_row++, 1 ); 

   left->addLayout( buttons2, row, 0, 2, 2 );

   main->addLayout( left ); 

   // Right Column
   // Simulation plot
   QBoxLayout* right = new QVBoxLayout;
   
   QBoxLayout* plot = new US_Plot( equilibrium_plot, 
         tr( "Approach to Equilibrium Simulation" ),
         tr( "Radius" ), tr( "Concentration" ) );
   us_grid( equilibrium_plot );
   
   equilibrium_plot->setMinimumSize( 600, 400 );
   equilibrium_plot->setAxisScale( QwtPlot::yLeft  , 0.0, 1.5 );
   equilibrium_plot->setAxisScale( QwtPlot::xBottom, 5.9, 6.2 );

   right->addLayout( plot );

   te_info = new US_Editor( 0, true );

   QFontMetrics fm( te_info->font() );
   te_info->setFixedHeight( fm.height() * 15 );

   right->addWidget( te_info );
   right->setStretchFactor( plot   , 10 );
   right->setStretchFactor( te_info, 2 );

   main->addLayout( right ); 

   model.components.clear();
   update_speeds( speed_type );
}
コード例 #5
0
ファイル: wormsign.cpp プロジェクト: LabLouis/eLife_2015
Wormsign::Wormsign(QWidget *parent, Qt::WFlags flags)
	: QWidget(parent, flags)
{

	appVersion = "2.0";


	//Populate Camera Options
	QMainWindow * mainWin = (QMainWindow *)this->window();
	mainWin->setWindowTitle("Wormsign " + appVersion + " - RealTime Larva Tracking - Questions: Gus Lott x4632");

	expAgent = NULL;

	int height = 1000;
	int width = 1000;
	setGeometry(50,50,width,height);
	setMinimumHeight(height); setMaximumHeight(height);
	setMinimumWidth(width); setMaximumWidth(width);
	//setAutoFillBackground(true);
	//setPalette(QColor(250,250,200));

	//File Menu saves/loads config states.
	

	//Create Preview Canvas for Camera
	camThread = NULL;
	canvas = new CamViewGL;
	canvas->gui = this;
	canvas->show();

	//HARDWARE INTERFACES
	//button to show/hide hardware interfaces
	showHideHW = new QPushButton("<< Hide Config",this);
	showHideHW->setGeometry(530,10,110,20); showHideHW->setCheckable(true);
	showHideHW->setPalette(QColor(200,200,200)); showHideHW->setChecked(true);
	connect(showHideHW,SIGNAL(clicked()),this,SLOT(hideHW()));

	//Create Camera Control Interface
		QStringList camStrList = CoreCamThread::listCams();

		QGroupBox * camControlBox = new QGroupBox("Camera Control",this);
		QFont fnt = camControlBox->font(); fnt.setBold(true); camControlBox->setFont(fnt);
		camControlBox->setGeometry(645,10,350,200);
		
		//pop-up list of available cameras
		camList = new QComboBox(camControlBox);
		camList->addItems(camStrList);
		camList->setGeometry(10,20,200,20);

		//connect toggle button
		camConnect = new QPushButton("Connect",camControlBox);
		camConnect->setGeometry(220,20,100,20);
		camConnect->setCheckable(true); camConnect->setPalette(QPalette(QColor(200,200,200)));
		connect(camConnect,SIGNAL(clicked()),this,SLOT(connectCamera()));

		//ROI, Brightness, Gain, Gamma, Shutter - disabled
		QLabel * roiLabel = new QLabel("ROI (xywh):",camControlBox);
		roiLabel->setFont(fnt);
		roiLabel->setGeometry(10,50,70,20);
		for(int i=0; i<4; i++){
			roiBox[i] = new QSpinBox(camControlBox);
			roiBox[i]->setGeometry(10+80+ 65*i ,50,55,20);
			roiBox[i]->setEnabled(false);
		}
		
		QLabel * tempLabel;
		//Brightness
		tempLabel = new QLabel("Brightness: ",camControlBox); 
		brightBox = new QSpinBox(camControlBox); brightBox->setEnabled(false); 
		brightSlider = new QSlider(Qt::Horizontal,camControlBox); brightSlider->setEnabled(false);
		tempLabel->setGeometry(10,90,120,20); brightBox->setGeometry(110,90,70,20); brightSlider->setGeometry(190,90,150,20);
		//Link slider/box and connect prop update
		connect(brightBox,SIGNAL(valueChanged(int)),brightSlider,SLOT(setValue(int)));
		connect(brightSlider,SIGNAL(valueChanged(int)),brightBox,SLOT(setValue(int)));

		//Gain
		tempLabel = new QLabel("Gain: ",camControlBox); 
		gainBox = new QSpinBox(camControlBox); gainBox->setEnabled(false);
		gainSlider = new QSlider(Qt::Horizontal,camControlBox); gainSlider->setEnabled(false);
		tempLabel->setGeometry(10,110,120,20); gainBox->setGeometry(110,110,70,20); gainSlider->setGeometry(190,110,150,20);
		//Link slider/box and connect prop update
		connect(gainBox,SIGNAL(valueChanged(int)),gainSlider,SLOT(setValue(int)));
		connect(gainSlider,SIGNAL(valueChanged(int)),gainBox,SLOT(setValue(int)));
		
		//Gamma
		tempLabel = new QLabel("Gamma: ",camControlBox); 
		gammaBox = new QSpinBox(camControlBox); gammaBox->setEnabled(false);
		gammaSlider = new QSlider(Qt::Horizontal,camControlBox); gammaSlider->setEnabled(false);
		tempLabel->setGeometry(10,130,120,20); gammaBox->setGeometry(110,130,70,20); gammaSlider->setGeometry(190,130,150,20);
		//Link slider/box and connect prop update
		connect(gammaBox,SIGNAL(valueChanged(int)),gammaSlider,SLOT(setValue(int)));
		connect(gammaSlider,SIGNAL(valueChanged(int)),gammaBox,SLOT(setValue(int)));
				
		//Shutter
		shutLabel = new QLabel("Shutter (x ms): ",camControlBox); 
		shutterBox = new QSpinBox(camControlBox); shutterBox->setEnabled(false);
		shutterSlider = new QSlider(Qt::Horizontal,camControlBox); shutterSlider->setEnabled(false);
		shutLabel->setGeometry(10,150,120,20); shutterBox->setGeometry(110,150,70,20); shutterSlider->setGeometry(190,150,150,20);
		//Link slider/box and connect prop update
		connect(shutterBox,SIGNAL(valueChanged(int)),shutterSlider,SLOT(setValue(int)));
		connect(shutterSlider,SIGNAL(valueChanged(int)),shutterBox,SLOT(setValue(int)));
		
		frameInt = new QLabel("Measured Frame Interval: ",camControlBox);
		frameInt->setGeometry(10,175,200,20);
		QPalette palette = frameInt->palette();
		palette.setColor(frameInt->foregroundRole(), QColor(200,0,0));
		frameInt->setPalette(palette);

			
	//Create Network Connection Control interface, to biorules app
		//Connection to Eric Trautman's Biorules Application
		biorulesConnection = new BiorulesConnect();

		//Panel
		QGroupBox * netPanel = new QGroupBox("BioRules Network Connection",this);
		netPanel->setFont(fnt);
		netPanel->setGeometry(645,230,350,70);

		//IP/Port Controls & Connect Button
		tempLabel = new QLabel("IP:",netPanel);
		tempLabel->setGeometry(10,20,30,20);
		ipText = new QLineEdit(biorulesConnection->ip,netPanel);
		ipText->setGeometry(40,20,150,20);

		tempLabel = new QLabel("Port:",netPanel);
		tempLabel->setGeometry(10,40,40,20);
		portText = new QLineEdit(QString().sprintf("%d",biorulesConnection->port),netPanel);
		portText->setGeometry(40,40,50,20); portText->setEnabled(false);

		netConnect = new QPushButton("Connect",netPanel);
		netConnect->setGeometry(220,20,100,20); netConnect->setFont(fnt);
		netConnect->setCheckable(true); netConnect->setPalette(QColor(200,200,200));
		
		connect(netConnect,SIGNAL(clicked()),this,SLOT(connectBioRules()));
	
		

	//Create Stage Control Serial Connection Interface
		stageThread = new StageThread(this);
		stageThread->biorulesConnection = biorulesConnection;
		connect(stageThread,SIGNAL(posUpdate()),this,SLOT(update()));

		//Panel
		QGroupBox * stagePanel = new QGroupBox("Zaber Stage Serial Interface",this);
		stagePanel->setFont(fnt);
		stagePanel->setGeometry(645,310,350,120);

		tempLabel = new QLabel("Port:",stagePanel);
		tempLabel->setGeometry(10,20,30,20);
		
		stageComList = new QComboBox(stagePanel);
		QStringList comStrList = stageThread->enumeratePorts();  //Scan for available serial ports
		stageComList->insertItems(0,comStrList);
		for(int i=0; i<comStrList.size(); i++)
			if(comStrList[i] == stageThread->comName) stageComList->setCurrentIndex(i);
		stageComList->setGeometry(40,20,100,20);

		stageConnect = new QPushButton("Connect",stagePanel);
		stageConnect->setGeometry(220,20,100,20); stageConnect->setFont(fnt);
		stageConnect->setCheckable(true); stageConnect->setPalette(QColor(200,200,200));
		
		connect(stageConnect,SIGNAL(clicked()),this,SLOT(connectStage()));

		stageX = new QLabel(stagePanel);
		stageX->setGeometry(10,45,150,20);
		stageY = new QLabel(stagePanel);
		stageY->setGeometry(170,45,150,20);

		tempLabel = new QLabel("Velocity (0-4800): ",stagePanel);
		tempLabel->setGeometry(10,70,120,20);
		stageVel = new QSpinBox(stagePanel);
		stageVel->setGeometry(130,70,100,20); stageVel->setEnabled(false); stageVel->setValue(0);
		stageVel->setMinimum(0); stageVel->setMaximum(10000);

		tempLabel = new QLabel("Acceleration: ",stagePanel);
		tempLabel->setGeometry(10,90,120,20);
		stageAccel = new QSpinBox(stagePanel);
		stageAccel->setGeometry(130,90,100,20); stageAccel->setEnabled(false); stageAccel->setValue(0);
		stageAccel->setMinimum(0); stageAccel->setMaximum(10000);

	//Create Stimulus Control Serial Connection Interface, frame rate, intensity, manual stim

		stimThread = new StimThread(this);
		//Panel
		QGroupBox * stimPanel = new QGroupBox("PhotoStim + Trigger System",this);
		stimPanel->setFont(fnt);
		stimPanel->setGeometry(645,440,350,50);

		tempLabel = new QLabel("Port:",stimPanel);
		tempLabel->setGeometry(10,20,30,20);
		
		stimComList = new QComboBox(stimPanel);
		stimComList->insertItems(0,comStrList);
		for(int i=0; i<comStrList.size(); i++)
			if(comStrList[i] == stimThread->comName) stimComList->setCurrentIndex(i);
		stimComList->setGeometry(40,20,100,20);

		stimConnect = new QPushButton("Connect",stimPanel);
		stimConnect->setGeometry(220,20,100,20); stimConnect->setFont(fnt);
		stimConnect->setCheckable(true); stimConnect->setPalette(QColor(200,200,200));
		
		connect(stimConnect,SIGNAL(clicked()),this,SLOT(connectStim()));
		
		

		

	//Experiment Controls, start/stop, log, file names
		QGroupBox * expPanel = new QGroupBox("Experiment Control",this);
		expPanel->setFont(fnt);
		expPanel->setGeometry(645,500,350,160);

		fnt.setBold(false);
		dirSelect = new QPushButton("Browse...",expPanel);
		dirSelect->setGeometry(10,20,70,20); dirSelect->setFont(fnt);

		connect(dirSelect,SIGNAL(clicked()),this,SLOT(selectDir()));

		dirOpen = new QPushButton("Open Dir",expPanel);
		dirOpen->setGeometry(10,45,70,20); dirOpen->setFont(fnt);

		connect(dirOpen,SIGNAL(clicked()),this,SLOT(openDir()));


		expLoc.setFile("C:\\Data\\");
		
		expDirectory = new QLabel(expLoc.path(),expPanel);
		expDirectory->setGeometry(85,20,330,20); 
		expDirectory->setFont(fnt); 
		
		dataLog = new QCheckBox("Log Analysis Results and Stimuli",expPanel);
		dataLog->setGeometry(85,45,200,20); dataLog->setChecked(true);
		vidLog = new QCheckBox("Log Grayscale Video",expPanel);
		vidLog->setGeometry(85,65,200,20); vidLog->setChecked(true);
		markupLog = new QCheckBox("Log Video with Annotation",expPanel);
		markupLog->setGeometry(85,85,200,20); markupLog->setChecked(false);


		//list for available rules (including none) - from biorulesConnection
		tempLabel = new QLabel("BioRule:",expPanel);
		tempLabel->setGeometry(10,110,75,20);
		bioRuleList = new QComboBox(expPanel);
		bioRuleList->setGeometry(85,110,200,20);
		//bioRuleList->insertItem(0,QString("NONE"));
		
		tempLabel = new QLabel("Frame Trigger Interval (ms):",expPanel);
		tempLabel->setGeometry(10,135,180,20);
		frameIntIn = new QSpinBox(expPanel);
		frameIntIn->setGeometry(180,135,50,20); frameIntIn->setValue(33);
		frameIntIn->setRange(10,50);

		fnt.setBold(true);

	//Start/Stop Button and Experiment Ellapsed Time
	fnt.setPointSize(17);
	startStop = new QPushButton("START",this);
	startStop->setGeometry(500,950,120,40); startStop->setCheckable(true); startStop->setEnabled(false);
	startStop->setFont(fnt); startStop->setAutoFillBackground(true); startStop->setPalette(QPalette(QColor(200,0,0)));
	expTime = new QLabel("0:00:00",this);
	expTime->setGeometry(400,950,100,40);
	expTime->setFont(fnt);

	connect(startStop,SIGNAL(clicked()),this,SLOT(startStopExperiment()));


	//DATA PLOTS

	//Algorithm Performance Widget
	perfGraph = new PerformanceGraph(this);
	perfGraph->setGeometry(645,670,350,320);

	//Data Visualization - widget drawing plots of results 
	plots.resize(4);
	for(int i=0; i<4; i++){
		plots[i] = new DataPlot(this);
		plots[i]->setGeometry(10,20+240*i,300,230);
		plots[i]->parameterList->setCurrentIndex(i);
	}

	//Global Arena Trajectory - widget drawing history of animal track - clear history button
	arenaTrack = new ArenaTrack(this);
	arenaTrack->setGeometry(320,40,310,300);
	connect(bioRuleList,SIGNAL(currentIndexChanged(int)),arenaTrack,SLOT(update()));

	//Behavior mode visualization (i.e. stopped, forward, back, casting left, etc)
	behaviorModeView = new BehaviorModeView(this);
	behaviorModeView->setGeometry(320,360,310,300);

	//Manual controls
	manualControls = new ManualControls(this);
	manualControls->setGeometry(320,680,310,250);

	//check for default config in pwd and load it
}