当前位置: 首页>>代码示例>>C++>>正文


C++ Files::append方法代码示例

本文整理汇总了C++中Files::append方法的典型用法代码示例。如果您正苦于以下问题:C++ Files::append方法的具体用法?C++ Files::append怎么用?C++ Files::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Files的用法示例。


在下文中一共展示了Files::append方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: outputFilesImpl

  Files ModelToRadPreProcessJob::outputFilesImpl() const
  {
    openstudio::path outpath = outdir();
    if (!boost::filesystem::exists(outpath / toPath("out.osm")) || !m_osm)
    {
      // no output file has been generated yet
      return Files();
    }

    Files f;
    FileInfo fi(outpath / toPath("out.osm"), "osm");
    fi.requiredFiles = m_osm->requiredFiles;

    if (!fi.hasRequiredFile(openstudio::toPath("in.epw")))
    {
      /// \todo we need better handling of OSM files and their attachments
      // epw wasn't found, look for parent one
      openstudio::path possibleepw = m_osm->fullPath.parent_path() / openstudio::toPath("in.epw");

      if (boost::filesystem::exists(possibleepw))
      {
        LOG(Info, "Fixing up EPW file for incoming OSM attachment to " << openstudio::toString(possibleepw));
        fi.addRequiredFile(possibleepw, openstudio::toPath("in.epw"));
      }
    }

    f.append(fi);
    return f;
  }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:29,代码来源:ModelToRadPreProcessJob.cpp

示例2: createEnergyPlusJob

  Job JobFactory::createEnergyPlusJob(
      ToolInfo t_energyPlusTool,
      const openstudio::path &t_idd,
      const openstudio::path &t_idf,
      const openstudio::path &t_epw,
      const openstudio::path &t_outdir,
      const boost::optional<openstudio::UUID> &t_uuid)
  {
    JobParams params;
    params.append("outdir", toString(t_outdir));

    Tools tools;
    t_energyPlusTool.name = "energyplus";
    tools.append(t_energyPlusTool);

    Files files;
    FileInfo idf(t_idf, "idf");

    if (!t_idd.empty())
    {
      idf.addRequiredFile(t_idd,toPath("Energy+.idd"));
    }

    idf.addRequiredFile(t_epw, toPath("in.epw"));
    files.append(idf);

    return createEnergyPlusJob(tools, params, files, std::vector<openstudio::URLSearchPath>(), t_uuid);
  }
开发者ID:airguider,项目名称:OpenStudio,代码行数:28,代码来源:JobFactory.cpp

示例3: ti

TEST_F(RunManagerTestFixture, Workflow_ToWorkItems)
{
  ToolInfo ti("tool", openstudio::toPath("somepath"));
  Tools tis;
  tis.append(ti);

  JobParam param("param1");
  JobParams params;
  params.append(param);

  FileInfo fi(openstudio::toPath("somefile.txt"), "txt");
  Files fis;
  fis.append(fi);

  Workflow wf("null->energyplus");
  wf.add(params);
  wf.add(tis);
  wf.add(fis);

  std::vector<WorkItem> wis = wf.toWorkItems();

  ASSERT_EQ(2u, wis.size());
  EXPECT_EQ(JobType(JobType::Null), wis[0].type);
  EXPECT_EQ(JobType(JobType::EnergyPlus), wis[1].type);

  EXPECT_EQ(params, wis[0].params);
  EXPECT_EQ(fis, wis[0].files);
  EXPECT_EQ(tis, wis[0].tools);

  EXPECT_TRUE(wis[1].params.params().empty());
  EXPECT_TRUE(wis[1].files.files().empty());
  EXPECT_TRUE(wis[1].tools.tools().empty());
} 
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:33,代码来源:Workflow_GTest.cpp

示例4: outputFilesHandlerImpl

  Files BasementJob::outputFilesHandlerImpl() const
  {
    FileInfo fi(outdir() / openstudio::toPath("basementmerged.idf"), "idf");
    fi.requiredFiles = m_expandedidf->requiredFiles;

    Files f;
    f.append(fi);
    return f;
  }
开发者ID:Anto-F,项目名称:OpenStudio,代码行数:9,代码来源:BasementJob.cpp

示例5: outputFilesImpl

  Files OpenStudioPostProcessJob::outputFilesImpl() const
  {
    // Dan: what's the output files generated?
    if (!boost::filesystem::exists(outdir() / toPath("report.xml")))
    {
      // no output file has been generated yet
      return Files();
    }

    Files f;
    f.append(FileInfo(outdir() / toPath("report.xml"), "xml"));
    return f;
  }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:13,代码来源:OpenStudioPostProcessJob.cpp

示例6: createIdfToModelJob

  Job JobFactory::createIdfToModelJob(
      const openstudio::path &t_idf,
      const openstudio::path &t_outdir,
      const boost::optional<openstudio::UUID> &t_uuid)
  {
    JobParams params;
    params.append("outdir", toString(t_outdir));

    Files files;
    files.append(FileInfo(t_idf, "idf"));

    return createIdfToModelJob(Tools(), params, files, std::vector<openstudio::URLSearchPath>(), t_uuid);
  }
开发者ID:airguider,项目名称:OpenStudio,代码行数:13,代码来源:JobFactory.cpp

示例7: outputFilesImpl

  Files ModelInModelOutJob::outputFilesImpl() const
  {
    Files outfiles;

    try {
      FileInfo osm(outdir() / toPath("out.osm"), "osm");
      osm.requiredFiles = modelFile().requiredFiles;

      outfiles.append(osm);
    } catch (const std::exception &) {
      //output file cannot be generated yet
    }
    return outfiles;
  }
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:14,代码来源:ModelInModelOutJob.cpp

示例8: outputFilesImpl

  Files ModelToRadPreProcessJob::outputFilesImpl() const
  {
    openstudio::path outpath = outdir();
    if (!boost::filesystem::exists(outpath / toPath("out.osm")) || !m_osm)
    {
      // no output file has been generated yet
      return Files();
    }

    Files f;
    FileInfo fi(outpath / toPath("out.osm"), "osm");
    fi.requiredFiles = m_osm->requiredFiles;
    f.append(fi);
    return f;
  }
开发者ID:Rahjou,项目名称:OpenStudio,代码行数:15,代码来源:ModelToRadPreProcessJob.cpp

示例9: outputFilesImpl

  Files IdfToModelJob::outputFilesImpl() const
  {
    openstudio::path outpath = outdir();

    if (!boost::filesystem::exists(outpath / toPath("out.osm")))
    {
      // no output file has been generated yet
      return Files();
    }

    QWriteLocker l(&m_mutex);

    if (!m_outputfiles)
    {
      // check if model has a weather file object
      boost::optional<QUrl> weatherFilePath;
      try {
        FileInfo idfFile = this->idfFile();

        try {
          std::pair<QUrl, openstudio::path> f = idfFile.getRequiredFile(toPath("in.epw"));
          LOG(Debug, "Setting user defined epw: " << toString(f.first.toString()));
          weatherFilePath = f.first;
        } catch (const std::exception &) {
        }

        // Specify the set of files we created so that the next Job in the chain (if there is one)
        // is able to pick them up
        Files outfiles;

        FileInfo osm(outpath / toPath("out.osm"), "osm");

        if (weatherFilePath){
          osm.addRequiredFile(*weatherFilePath, toPath("in.epw"));
        }else{
          LOG(Warn, "No weather file specified");
        }

        outfiles.append(osm);
        m_outputfiles = outfiles;
      } catch (const std::exception &) {
        LOG(Warn, "OSM file not yet available, outputfiles not known");
        return Files();
      }
    }

    return *m_outputfiles;
  }
开发者ID:MatthewSteen,项目名称:OpenStudio,代码行数:48,代码来源:IdfToModelJob.cpp

示例10: createRubyJob

 Job JobFactory::createRubyJob(
     const openstudio::runmanager::RubyJobBuilder &t_builder,
     const std::vector<openstudio::URLSearchPath> &t_url_search_paths,
     bool t_loading,
     const boost::optional<openstudio::UUID> &t_uuid)
 {
   Files files;
   openstudio::path scriptPath = t_builder.script();
   if (!scriptPath.empty())
   {
     openstudio::runmanager::FileInfo fi(scriptPath,"rb");
     BOOST_FOREACH(const PathPair& reqFile,t_builder.requiredFiles()) {
       fi.addRequiredFile(reqFile.first,reqFile.second);
     }
     files.append(fi);
   }
开发者ID:airguider,项目名称:OpenStudio,代码行数:16,代码来源:JobFactory.cpp

示例11: outputFilesImpl

  Files EnergyPlusPreProcessJob::outputFilesImpl() const
  {
    openstudio::path outpath = outdir();
    if (!boost::filesystem::exists(outpath / toPath("out.idf")))
    {
      // no output file has been generated yet
      return Files();
    }

    Files f;
    FileInfo fi(outpath / toPath("out.idf"), "idf");
    if (m_idf)
    {
      fi.requiredFiles = m_idf->requiredFiles;
    }
    f.append(fi);
    return f;
  }
开发者ID:CUEBoxer,项目名称:OpenStudio,代码行数:18,代码来源:EnergyPlusPreProcessJob.cpp

示例12: outputFilesImpl

  Files ParallelEnergyPlusSplitJob::outputFilesImpl() const
  {
    // Save off the set of requiredfiles, see below
    std::vector<std::pair<QUrl, openstudio::path> > requiredFiles = inputFile().requiredFiles;
    std::vector<openstudio::path> files = generateFileNames(outdir(), m_numSplits);

    Files retval;

    for (std::vector<openstudio::path>::const_iterator itr = files.begin();
         itr != files.end();
         ++itr)
    {
      if (boost::filesystem::exists(*itr))
      {
        FileInfo fi = RunManager_Util::dirFile(*itr);
        // we want to carry along the set of required files used in the original IDF to the children
        // (ie, the epw file)
        fi.requiredFiles = requiredFiles;
        retval.append(fi);
      }
    }

    return retval;
  }
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:24,代码来源:ParallelEnergyPlusSplitJob.cpp

示例13: startImpl

  void ModelToRadJob::startImpl(const boost::shared_ptr<ProcessCreator> &)
  {
    openstudio::path outpath = outdir();
    QWriteLocker l(&m_mutex);
    JobErrors errors;
    errors.result = ruleset::OSResultValue::Success;
    
    try {
      if (!m_model)
      {
        m_model = modelFile();
      }
      if (!m_sql)
      {
        m_sql = sqlFile();
      }

      resetFiles(m_files, m_model);
    } catch (const std::runtime_error &e) {
      errors.result = ruleset::OSResultValue::Fail;
      errors.addError(ErrorType::Error, e.what());
    }

    if (!m_sql || !m_model)
    {
      errors.result = ruleset::OSResultValue::Fail;
      errors.addError(ErrorType::Error, "Unable to find required model or sql file");
    }

    LOG(Info, "ModelToRad starting, filename: " << toString(m_model->fullPath));
    LOG(Info, "ModelToRad starting, outdir: " << toString(outpath));

    l.unlock();

    emitStatusChanged(AdvancedStatus(AdvancedStatusEnum::Starting));

    emitStarted();
    emitStatusChanged(AdvancedStatus(AdvancedStatusEnum::Processing));

    if (errors.result == ruleset::OSResultValue::Fail)
    {
      setErrors(errors);
      return;
    }


    try {
      boost::filesystem::create_directories(outpath);

      //
      // setup
      //
      LOG(Debug, "Working Directory: " + openstudio::toString(outpath));

      // get model
      boost::optional<openstudio::IdfFile> idf = openstudio::IdfFile::load(m_model->fullPath);
      openstudio::model::Model model = openstudio::model::Model(idf.get());

      // load the sql file
      openstudio::SqlFile sqlFile(m_sql->fullPath);

      if (!sqlFile.connectionOpen())
      {
        LOG(Error, "SqlFile connection is not open");
        errors.result = ruleset::OSResultValue::Fail;
        errors.addError(ErrorType::Error, "SqlFile collection is not open");
        setErrors(errors);
        return;
      }

      // set the sql file
      model.setSqlFile(sqlFile);
      if (!model.sqlFile())
      {
        LOG(Error, "SqlFile is not set on model");
        errors.result = ruleset::OSResultValue::Fail;
        errors.addError(ErrorType::Error, "SqlFile is not set on model");
        setErrors(errors);
        return;
      }

      openstudio::radiance::ForwardTranslator ft;
      std::vector<openstudio::path> outfiles = ft.translateModel(outpath, model);
      
      // capture translator errors and warnings?
      //ft.errors();
      //ft.warnings();
      
      Files outfileinfos;

      for (std::vector<openstudio::path>::const_iterator itr = outfiles.begin();
          itr != outfiles.end();
          ++itr)
      {
        FileInfo fi = RunManager_Util::dirFile(*itr);
        LOG(Info, "Output file generated: " << openstudio::toString(fi.fullPath));
        emitOutputFileChanged(fi);
        outfileinfos.append(fi);
      }

//.........这里部分代码省略.........
开发者ID:airguider,项目名称:OpenStudio,代码行数:101,代码来源:ModelToRadJob.cpp


注:本文中的Files::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。