コード例 #1
0
ファイル: fileMapping.cpp プロジェクト: AlphaBeth/ITMO
void createIndexFile(const char *path, char *inputMapping, char *indxName) {
    char *inputFileMapping = inputMapping;
    char name[50];
    selectName(path, name);
    char dir[50];
    selectDir(path, dir);
//    int len = strlen(name);
    sprintf(indxName, "%s.%s.indx", dir, name);
    int size = readInt(&inputFileMapping);
    DWORD fsLow = size * sizeof(Record);
    FileMapping map = createSizedFileMapping(indxName, CREATE_ALWAYS, fsLow);
    Record *records = (Record *)map.pObjFile;
    int skipped;
    inputFileMapping = skipUntilNewLine(inputFileMapping, &skipped);
    for (int i = 0; i < size; i++) {
        int key = readInt(&inputFileMapping);
        inputFileMapping++;
        size_t offset = inputFileMapping - _BASE_STR;
        inputFileMapping = skipUntilNewLine(inputFileMapping, &skipped);
        BasedStr based = {offset, skipped - 2};
        Record rec = {key, based};
        records[i] = rec;
    }
    removeFileMapping(map);
}
コード例 #2
0
OutputDirectory::OutputDirectory( Config *_config, QWidget *parent )
    : QWidget( parent ),
    config( _config )
{
    QGridLayout *grid = new QGridLayout( this );
    grid->setMargin( 0 );

    QHBoxLayout *box = new QHBoxLayout( );
    grid->addLayout( box, 0, 0 );

    cMode = new KComboBox( this );
    cMode->addItem( i18n("By meta data") );
    cMode->addItem( i18n("Source directory") );
    cMode->addItem( i18n("Specify output directory") );
    cMode->addItem( i18n("Copy directory structure") );
    box->addWidget( cMode );
    connect( cMode, SIGNAL(activated(int)), this, SLOT(modeChangedSlot(int)) );

    cDir = new KComboBox( true, this );
    box->addWidget( cDir, 1 );
    connect( cDir, SIGNAL(editTextChanged(const QString&)),  this, SLOT(directoryChangedSlot(const QString&)) );

    pDirSelect = new KPushButton( KIcon("folder"), "", this );
    box->addWidget( pDirSelect );
    pDirSelect->setFixedWidth( pDirSelect->height() );
    pDirSelect->setToolTip( i18n("Choose an output directory") );
    connect( pDirSelect, SIGNAL(clicked()), this, SLOT(selectDir()) );
    pDirGoto = new KPushButton( KIcon("system-file-manager"), "", this );
    box->addWidget( pDirGoto );
    pDirGoto->setFixedWidth( pDirGoto->height() );
    pDirGoto->setToolTip( i18n("Open the output directory with Dolphin") );
    connect( pDirGoto, SIGNAL(clicked()), this, SLOT(gotoDir()) );

    setMode( (OutputDirectory::Mode)config->data.general.lastOutputDirectoryMode );
}
コード例 #3
0
EditBookmarkDialog::EditBookmarkDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::EditBookmarkDialog)
{
    ui->setupUi(this);

    connect(ui->pushSelectDir, SIGNAL(clicked()), SLOT(selectDir()));
    connect(ui->lineDir, SIGNAL(textChanged(QString)), SLOT(changed()));

    changed();
}
コード例 #4
0
ファイル: dirdao.cpp プロジェクト: MrMattMunro/filesearch
// 更新目录
bool DirDao::updateDir(Dir dir){

    // 取得数据库原来的
    Dir orgDir = selectDir(dir.DIR_GUID);

    // 取得数据库存在的目录
    QString dirparentuuid = orgDir.DIR_PARENT_UUID;
    QString dirname = orgDir.DIR_NAME;
    QString dirdesp = orgDir.DIR_DESCRIPTION;
    QString diricon = orgDir.DIR_ICON;
    int dirorder = orgDir.DIR_ORDER;
    int version = orgDir.MF_VERSION;
    QString protect = orgDir.DIR_PROTECT;
    QString delflg = orgDir.DELETE_FLAG;

    if(! dir.DIR_PARENT_UUID.isEmpty()){
       dirparentuuid = dir.DIR_PARENT_UUID;
    }

    if(! dir.DIR_NAME.isEmpty()){
       dirname = dir.DIR_NAME;
    }

    if(! dir.DIR_DESCRIPTION.isEmpty()){
       dirdesp = dir.DIR_DESCRIPTION;
    }

    if(! dir.DIR_ICON.isEmpty()){
       diricon = dir.DIR_ICON;
    }

    if(dir.DIR_ORDER != 0){
       dirorder = dir.DIR_ORDER;
    }

    if(! dir.DIR_PROTECT.isEmpty()){
       protect = dir.DIR_PROTECT;
    }

    if(dir.MF_VERSION != 0){
       version = dir.MF_VERSION;
    }

    if(dir.DELETE_FLAG != 0){
       delflg = dir.DELETE_FLAG;
    }

    SqlLoader* sqlLoader = SqlLoader::instance();
    QString sql = sqlLoader->getSql("mf_update_dir.sql");
    sql = sql.arg(dirparentuuid, dirname, dirdesp, diricon, QString::number(dirorder), protect, QString::number(version), delflg, dir.DIR_GUID);
    return Database::execSql(sql);
}
コード例 #5
0
NewProject::NewProject( QString prefix ) : KDialogBase( Plain,
			i18n( "Create New Project" ), Help | Ok | Cancel, Ok ) {
	QFrame* top = plainPage();

	QGridLayout* layoutGeneral = new QGridLayout( top, 2, 3, 5, 6 );

	int row = 0;
	QLabel* vobFilesLabel = new QLabel( i18n( "Vob or Sub files" ), top );
	vobFilesLabel->setAlignment( Qt::AlignTop );
	layoutGeneral->addWidget( vobFilesLabel, row, 0 );
	vobFilesList = new KListBox( top );
	layoutGeneral->addWidget( vobFilesList, row, 1 );

	QVBoxLayout* layoutFilesButton = new QVBoxLayout( 0, 0, 6 );
	KPushButton* vobFilesButton = new KPushButton ( top );
	layoutFilesButton->addWidget( vobFilesButton );
	layoutFilesButton->addItem( new QSpacerItem( 20, 40, QSizePolicy::Minimum,
								QSizePolicy::Expanding ) );
	layoutGeneral->addLayout( layoutFilesButton, row, 2 );

	++row;
	QLabel* dirLabel = new QLabel( i18n( "Directory" ), top );
	layoutGeneral->addWidget( dirLabel, row, 0 );

	dirEdit = new KLineEdit( top );
	dirEdit->setValidator( new DirValidator( dirEdit ) );
	dirEdit->setURLDropsEnabled( true );
	KURLCompletion* complet = new KURLCompletion( KURLCompletion::DirCompletion );
	dirEdit->setCompletionObject( complet );
	layoutGeneral->addWidget( dirEdit, row, 1 );

	KPushButton* dirButton = new KPushButton ( top );
	layoutGeneral->addWidget( dirButton, row, 2 );

	++row;
	QLabel* prefixLabel = new QLabel( i18n( "Prefix" ), top );
	layoutGeneral->addWidget( prefixLabel, row, 0 );
	prefixEdit = new KLineEdit( prefix, top );
	prefixEdit->setValidator( new QRegExpValidator( QRegExp( "\\S+" ), prefixEdit ) );
	layoutGeneral->addWidget( prefixEdit, row, 1 );

	enableButtonOK( false );
	vobFilesButton->setPixmap( KGlobal::iconLoader()->loadIcon( "fileopen", KIcon::Small ) );
	dirButton->setPixmap( KGlobal::iconLoader()->loadIcon( "fileopen", KIcon::Small ) );

	connect( vobFilesButton, SIGNAL( clicked() ), this, SLOT( selectVobs() ) );
	connect( dirButton, SIGNAL( clicked() ), this, SLOT( selectDir() ) );
	connect( prefixEdit, SIGNAL( textChanged( const QString& ) ),
			 this, SLOT( tryEnableButtonOk() ) );
	connect( dirEdit, SIGNAL( textChanged( const QString& ) ),
			 this, SLOT( tryEnableButtonOk() ) );
}
コード例 #6
0
ファイル: desktopwidget.cpp プロジェクト: sglass68/paperman
void Desktopwidget::locateFolder ()
   {
   QModelIndex ind = _view->getSelectedItem ();
   QString filename, pathname;

   if (ind.isValid ())
      {
      filename = ind.model ()->data (ind, Desktopmodel::Role_filename).toString ();
      pathname = ind.model ()->data (ind, Desktopmodel::Role_pathname).toString ();
      QString dir = pathname;
      dir.truncate (dir.length () - filename.length ());

      // once the folder has finished refreshing, we want to ensure that this item is visible
      _scroll_to = filename;

      QModelIndex dirindex = _model->index (dir);
      selectDir (dirindex);
      }
   }
コード例 #7
0
ファイル: configwidget.cpp プロジェクト: jonntd/screengrab-qt
configwidget::configwidget(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::configwidget)
{
    m_ui->setupUi(this);
    conf = Config::instance();

    m_ui->tabWidget->setCurrentIndex(0);
    loadSettings();
    on_defDelay_valueChanged(conf->getDefDelay());
    setVisibleDateTplEdit(conf->getDateTimeInFilename());    

    connect(m_ui->butSaveOpt, SIGNAL(clicked()), this, SLOT(saveSettings()));
    connect(m_ui->buttonBrowse, SIGNAL(clicked()), this, SLOT(selectDir()));
    connect(m_ui->butRestoreOpt, SIGNAL(clicked()), this, SLOT(restoreDefaults()) );
    connect(m_ui->checkIncDate, SIGNAL(toggled(bool)), this, SLOT(setVisibleDateTplEdit(bool)));
    connect(m_ui->keyWidget, SIGNAL(keySequenceAccepted(QKeySequence)), this, SLOT(acceptShortcut(QKeySequence)));
    connect(m_ui->keyWidget, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(changeShortcut(QKeySequence)));
    connect(m_ui->keyWidget, SIGNAL(keyNotSupported()), this, SLOT(keyNotSupported()));
    on_editDateTmeTpl_textEdited(conf->getDateTimeTpl());

    m_ui->treeKeys->expandAll();
    m_ui->treeKeys->header()->setResizeMode(QHeaderView::Stretch);
    
    // adding shortcut values in treewidget    
    int action = 0;
    QTreeWidgetItemIterator iter(m_ui->treeKeys);
    while(*iter)
    {
	if ((*iter)->parent() != NULL)
	{
	    (*iter)->setData(1, Qt::DisplayRole, conf->shortcuts()->getShortcut(action));
	    ++action;
	}
	++iter;
    }
    
    // set false visibility to edit hokey controls
    m_ui->labUsedShortcut->setVisible(false);
    m_ui->keyWidget->setVisible(false);

}
コード例 #8
0
ファイル: desktopwidget.cpp プロジェクト: sglass68/paperman
err_info *Desktopwidget::addDir (QString in_dirname, bool ignore_error)
   {
   err_info *err = NULL;

   QDir dir (in_dirname);

//    dirname = dir.absPath () + "/";
   QString dirname = dir.canonicalPath ();
   if (dirname.isEmpty ())
      {
      dirname = in_dirname;
      if (dirname.endsWith ("/"))
         dirname.chop (1);
      err = err_make (ERRFN, ERR_directory_not_found1,
                       qPrintable(dirname));
      }

   // Check that the dirname isn't overlapping another
   CALL (_model->checkOverlap (dirname, in_dirname));
   dirname += "/";

   QModelIndex index = _model->index (dirname, 0);

   if (index != QModelIndex ())
      return err_make (ERRFN, ERR_directory_is_already_present_as2,
                       qPrintable(in_dirname), qPrintable(dirname));
   else if (err && !ignore_error)
      ;
   else if (_model->addDir (dirname, ignore_error))
      {
      QModelIndex index = _model->index (dirname);
      selectDir (index);
      }
   else
      err = err_make (ERRFN, ERR_directory_could_not_be_added1,
                       qPrintable(in_dirname));
   return err;
   }
コード例 #9
0
void XFE_ABDirListView::selectLine(int line)
{
#if defined(USE_ABCOM)
	AB_ContainerAttribValue *value = NULL;
	int error = AB_GetContainerAttributeForPane(m_pane,
												line,
												attribContainerInfo,
												&value);
	XP_ASSERT(value && value->attrib == attribContainerInfo && value->u.container);

	// set active one
	m_activeContainer = value->u.container;

	notifyInterested(XFE_ABDirListView::dirSelect, 
					 (void *) value->u.container);
	AB_FreeContainerAttribValue(value);
#else
	DIR_Server *dir = 
		(DIR_Server *) XP_ListGetObjectNum(m_directories, 
										   line+1);
	selectDir(dir);
#endif /* USE_ABCOM */
}
コード例 #10
0
ConfigDialog::ConfigDialog(QWidget *parent) :
    QDialog(parent),
    _ui(new Ui::configwidget)
{
    _ui->setupUi(this);
    conf = Config::instance();

    connect(_ui->butSaveOpt, SIGNAL(clicked()), this, SLOT(saveSettings()));
    connect(_ui->buttonBrowse, SIGNAL(clicked()), this, SLOT(selectDir()));
    connect(_ui->butRestoreOpt, SIGNAL(clicked()), this, SLOT(restoreDefaults()) );
    connect(_ui->checkIncDate, SIGNAL(toggled(bool)), this, SLOT(setVisibleDateTplEdit(bool)));
    connect(_ui->keyWidget, SIGNAL(keySequenceAccepted(QKeySequence)), this, SLOT(acceptShortcut(QKeySequence)));
    connect(_ui->keyWidget, SIGNAL(keyNotSupported()), this, SLOT(keyNotSupported()));
    connect(_ui->checkAutoSave, SIGNAL(clicked(bool)), this, SLOT(setVisibleAutoSaveFirst(bool)));
    connect(_ui->butCancel, SIGNAL(clicked(bool)), this, SLOT(reject()));
    connect(_ui->treeKeys, SIGNAL(expanded(QModelIndex)), _ui->treeKeys, SLOT(clearSelection()));
    connect(_ui->treeKeys, SIGNAL(collapsed(QModelIndex)), this, SLOT(collapsTreeKeys(QModelIndex)));
    connect(_ui->checkShowTray, SIGNAL(toggled(bool)), this, SLOT(toggleCheckShowTray(bool)));
    connect(_ui->editDateTmeTpl, SIGNAL(textEdited(QString)), this, SLOT(editDateTmeTpl(QString)));
    connect(_ui->defDelay, SIGNAL(valueChanged(int)), this, SLOT(changeDefDelay(int)));
    connect(_ui->timeTrayMess, SIGNAL(valueChanged(int)), this, SLOT(changeTimeTrayMess(int)));
    connect(_ui->cbxTrayMsg, SIGNAL(currentIndexChanged(int)), this, SLOT(changeTrayMsgType(int)));
    connect(_ui->treeKeys, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(doubleclickTreeKeys(QModelIndex)));
    connect(_ui->treeKeys, SIGNAL(activated(QModelIndex)), this, SLOT(doubleclickTreeKeys(QModelIndex)));
    connect(_ui->treeKeys->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentItemChanged(const QModelIndex,const QModelIndex)));
    connect(_ui->keyWidget, SIGNAL(keySequenceCleared()), this, SLOT(clearShrtcut()));
    connect(_ui->listWidget, SIGNAL(currentRowChanged(int)), _ui->stackedWidget, SLOT(setCurrentIndex(int)));
    connect(_ui->slideImgQuality, SIGNAL(valueChanged(int)), this, SLOT(changeImgQualituSlider(int)));
    connect(_ui->cbxFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(changeFormatType(int)));

    loadSettings();
    changeDefDelay(conf->getDefDelay());
    setVisibleDateTplEdit(conf->getDateTimeInFilename());

    setVisibleAutoSaveFirst(conf->getAutoSave());

    _ui->listWidget->setCurrentRow(0);
    _ui->tabMain->setCurrentIndex(0);

    editDateTmeTpl(conf->getDateTimeTpl());

    _ui->treeKeys->expandAll();
    _ui->treeKeys->header()->setSectionResizeMode(QHeaderView::Stretch);

    // adding shortcut values in treewidge
    int action = 0;
    QTreeWidgetItemIterator iter(_ui->treeKeys);
    while(*iter)
    {
        if ((*iter)->parent() != NULL)
        {
            (*iter)->setData(1, Qt::DisplayRole, conf->shortcuts()->getShortcut(action));

#ifndef SG_GLOBAL_SHORTCUTS
            if (conf->shortcuts()->getShortcutType(action) == Config::globalShortcut)
            {
                (*iter)->setHidden(true);
            }
#endif
            ++action;
        }
        else
        {
#ifndef SG_GLOBAL_SHORTCUTS
            int numGlobalShortcuts = conf->shortcuts()->getShortcutsList(Config::globalShortcut).count();
            if ((*iter)->childCount() == numGlobalShortcuts)
            {
                (*iter)->setHidden(true);
            }
#endif
        }
    ++iter;
    }

    // set false visibility to edit hokey controls
    _ui->labUsedShortcut->setVisible(false);
    _ui->keyWidget->setVisible(false);

    // Load config widgets for modules
    quint8 countModules = Core::instance()->modules()->count();

    for (int i = 0; i < countModules; ++i)
    {
        AbstractModule* currentModule = Core::instance()->modules()->getModule(i);

        if (currentModule->initConfigWidget() != 0)
        {
            _ui->listWidget->addItem(currentModule->moduleName());
            QWidget *currentModWidget = currentModule->initConfigWidget();
            _ui->stackedWidget->addWidget(currentModWidget);
            _moduleWidgetNames << currentModWidget->objectName();
        }
    }
}
コード例 #11
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
}