示例#1
0
void SHPImportDialog::accept()
{
    QString list_name(_listName->text());
    if (list_name.compare("") == 0)
    {
        OGSError::box("Please insert a name for the data in this file.");
        return;
    }
    else
    {
        if (_fileType == 1 && _choice1->isChecked())
            _shpInterface->readSHPFile(_filename,
                                       FileIO::SHPInterface::OGSType::POINT,
                                       list_name.toStdString());
        if (_fileType == 1 && _choice2->isChecked())
            _shpInterface->readSHPFile(_filename,
                                       FileIO::SHPInterface::OGSType::STATION,
                                       list_name.toStdString());
        if (_fileType == 2 && _choice1->isChecked())
            _shpInterface->readSHPFile(_filename,
                                       FileIO::SHPInterface::OGSType::POLYLINE,
                                       list_name.toStdString());
        if (_fileType == 2 && _choice2->isChecked())
            _shpInterface->readSHPFile(_filename,
                                       FileIO::SHPInterface::OGSType::POLYGON,
                                       list_name.toStdString());
        emit shpLoaded(list_name);
    }
    this->done(QDialog::Accepted);
}
示例#2
0
文件: main.cpp 项目: ASGusev/nir
	ArgParser(int argc, char **argv) {
		int cur_arg = 1;
		if (argc == 1) {
			tasks.push_back(0);
		}
		while (cur_arg < argc) {
			if (strcmp(FILENAME_KEY, argv[cur_arg]) == 0) {
				filenames.push_back(std::string(argv[++cur_arg]));
			}
			else if (strcmp(LIST_KEY, argv[cur_arg]) == 0) {
				std::string list_name(argv[++cur_arg]);
				std::ifstream file(list_name);
				std::string line;
				while (getline(file, line)) {
					filenames.push_back(line);
				}
				file.close();
			}
			else if (strcmp(TASK_KEY, argv[cur_arg]) == 0) {
				tasks.push_back(std::stoi(argv[++cur_arg]));
			}
			else if (strcmp(ERROR_BORDER_KEY, argv[cur_arg]) == 0) {
				evalue_border = std::stod(argv[++cur_arg]);
			}
			else if (strcmp(EPS_KEY, argv[cur_arg]) == 0) {
				eps = std::stod(argv[++cur_arg]);
			}
			else if (strcmp(HELP_KEY, argv[cur_arg]) == 0) {
				tasks.push_back(0);
			}
			cur_arg++;
		}
	}
示例#3
0
int list(int argc, char *argv[])
{
    printf("list cmd\n");

    if(argc == 1)
        list_all();
    else
        list_name(argv[1]);

    return 0;
}
示例#4
0
int main() {

  head hd;
  LIBRARY* lib;
  int count = 1;
  hd.name = NULL;
  hd.year = NULL;

  add(&hd, "2121212", "kelebek", 2010);
  add(&hd, "7867667", "osman", 2008);

  printf("Name ____\n");
  list_name( &hd );
  printf("Year ____\n");
  list_year( &hd );

  find_name(&hd, "kamil");
  printf("__\n");
  find_year(&hd, 2012);

  return 0;
}