Exemplo n.º 1
0
Ut::Ut(QWidget *parent) : QDialog(parent)
{
qDebug() << "start Ut";
	ui.setupUi(this);
	connect(ui.convert, SIGNAL(clicked()), this, SLOT(read_write()));
	connect(ui.file, SIGNAL(textChanged(QString)), this, SLOT(newfile()));
	connect(ui.cat, SIGNAL(textChanged(QString)), this, SLOT(newcat()));
	connect(ui.observatory, SIGNAL(currentIndexChanged(int)), this, SLOT(observatory(int)));
	connect(ui.dir, SIGNAL(textChanged(QString)), this, SLOT(newdir()));
	connect(ui.convert, SIGNAL(pressed()), this, SLOT(processing()));

	connect(ui.LT2UT, SIGNAL(clicked()), this, SLOT(inpfilename()));	
	connect(ui.ST2UT, SIGNAL(clicked()), this, SLOT(inpfilename()));
    connect(ui.JD2UT, SIGNAL(clicked()), this, SLOT(inpfilename()));

	red.setColor(QPalette::Base,QColor(Qt::red));
	white.setColor(QPalette::Base,QColor(Qt::white));

//	filename = "..\\data\\" + ui.file->text() + "maindata_lt.txt";

	int index = 0;
	read_cfg(index);
	newfile();

	read_cat();
	observatory(index);

	read_dst();
	inpfilename();
qDebug() << "stop Ut";
}
Exemplo n.º 2
0
Dataset::Dataset(string str): root(str){
  path full_path =  system_complete(root);
  directory_iterator end_itr;
  size_t label = 0;
  if(is_directory(full_path)){
    try{
      for (directory_iterator itr( full_path ); itr != end_itr;++itr ){
	if(is_directory(itr->path())){
	  string root, descriptor, catname;
	  root = (string) itr->path().string().c_str();
	  catname = (string) itr->path().filename().c_str();
	  vector<DataPoint> dps = getDataPoints(itr->path(), label, catname);
	  Category newcat(catname, root, label, dps);
	  category_names[label] = catname;
	  if(newcat.size() > 10){
	    addCategory(newcat);
	    label++;
	  }
	}
      }
    }
    catch(...){
    }
  } 
}