Ejemplo n.º 1
0
static int Pstat(lua_State *L)			/** stat(path,[options]) */
{
	struct stat s;
	const char *path=luaL_checkstring(L, 1);
	if (lstat(path,&s)==-1)
		return pusherror(L, path);
	return doselection(L, 2, Sstat, Fstat, &s);
}
Ejemplo n.º 2
0
Archivo: lposix.c Proyecto: ktf/apt-rpm
static int Pstat(lua_State *L)			/** stat(path,[selector]) */
{
	struct mystat s;
	const char *path=luaL_checkstring(L, 1);
	if (lstat(path,&s.s)==-1) return pusherror(L, path);
	s.type=filetype(s.s.st_mode);
	modechopper(s.s.st_mode, s.mode);
	return doselection(L, 2, Sstat, Fstat, &s);
}
Ejemplo n.º 3
0
Archivo: lposix.c Proyecto: ktf/apt-rpm
static int Pgetpasswd(lua_State *L)		/** getpasswd(name or id) */
{
	struct passwd *p=NULL;
	if (lua_isnoneornil(L, 1))
		p = getpwuid(geteuid());
	else if (lua_isnumber(L, 1))
		p = getpwuid((uid_t)lua_tonumber(L, 1));
	else if (lua_isstring(L, 1))
		p = getpwnam(lua_tostring(L, 1));
	else
		luaL_typerror(L, 1, "string or number");
	if (p==NULL)
		lua_pushnil(L);
	else
		doselection(L, 2, Sgetpasswd, Fgetpasswd, p);
	return 1;
}
Ejemplo n.º 4
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    connect(ui->actionBackground, SIGNAL(triggered()), this, SLOT(background_file_open()));
    connect(ui->actionClosed_Aperature, SIGNAL(triggered()), this, SLOT(closedapp_file_open()));
    connect(ui->actionImage_Stack, SIGNAL(triggered()), this, SLOT(imagelist_file_open()));
    connect(ui->actionRun_Experiment, SIGNAL(triggered()), this, SLOT(run_experiment()));

    set_background = false;
    set_closed = false;
    set_image_list = false;

    ui->actionClosed_Aperature->setDisabled(true);
    ui->actionImage_Stack->setDisabled(true);
    ui->actionRun_Experiment->setDisabled(true);
    ui->actionShow_Graph->setDisabled(true);

    frapmodel = new FrapModel(0);

    connect(this,SIGNAL(primaset(QString)),frapmodel,SLOT(setPrima(QString)));
    connect(this,SIGNAL(closedset(QString)),frapmodel,SLOT(setClosed(QString)));
    connect(this,SIGNAL(doselection()),frapmodel,SLOT(doSelection()));
    connect(this,SIGNAL(imagelistset(QStringList)),frapmodel,SLOT(setImageList(QStringList)));

    connect(ui->actionShow_Graph, SIGNAL(triggered()),frapmodel, SLOT(prepareLinearFit()));

    //connect(frapmodel,SIGNAL(dataChanged(QModelIndex,QModelIndex)), ui->tableView,SLOT(dataChanged(QModelIndex,QModelIndex)));
    connect(frapmodel,SIGNAL(update_result(QString)), this, SLOT(show_result(QString)));
    connect(frapmodel,SIGNAL(plotLinearFit(int,std::vector<double>&,std::vector<double>&,std::vector<double>&,double,double)), ui->pl_widget, SLOT(plotLinearFit(int,std::vector<double>&,std::vector<double>&,std::vector<double>&,double,double)));

    ui->tabWidget->setCurrentIndex(0);
    starting_dir = "/home/jon/Programming/C/frap-tool-old";
}
Ejemplo n.º 5
0
Archivo: lposix.c Proyecto: ktf/apt-rpm
static int Psysconf(lua_State *L)		/** sysconf([selector]) */
{
	return doselection(L, 1, Ssysconf, Fsysconf, NULL);
}
Ejemplo n.º 6
0
Archivo: lposix.c Proyecto: ktf/apt-rpm
static int Ppathconf(lua_State *L)		/** pathconf(path,[selector]) */
{
	const char *path=luaL_checkstring(L, 1);
	return doselection(L, 2, Spathconf, Fpathconf, path);
}
Ejemplo n.º 7
0
Archivo: lposix.c Proyecto: ktf/apt-rpm
static int Ptimes(lua_State *L)			/** times() */
{
	struct mytimes t;
	t.elapsed = times(&t.t);
	return doselection(L, 1, Stimes, Ftimes, &t);
}
Ejemplo n.º 8
0
Archivo: lposix.c Proyecto: ktf/apt-rpm
static int Pgetprocessid(lua_State *L)		/** getprocessid([selector]) */
{
	return doselection(L, 1, SgetID, FgetID, NULL);
}
Ejemplo n.º 9
0
static int Pgetpid(lua_State *L)		/** getpid([options]) */
{
	return doselection(L, 1, SgetID, FgetID, NULL);
}
Ejemplo n.º 10
0
static int Ppathconf(lua_State *L)		/** pathconf([path,options]) */
{
	const char *path = luaL_optstring(L, 1, ".");
	return doselection(L, 2, Spathconf, Fpathconf, path);
}
Ejemplo n.º 11
0
void MainWindow::run_experiment()
{
    emit doselection();
    ui->tableView->setModel( frapmodel );
    ui->tableView->show();
}