コード例 #1
0
ファイル: Project.cpp プロジェクト: Akfreak/OpenSCAM
void Project::load(const string &_filename) {
  setFilename(_filename);

  XMLReader reader;
  reader.addFactory("tool_table", tools.get());
  reader.read(filename, &options);

  // Default workpiece
  if (!options["automatic-workpiece"].hasValue())
    options["automatic-workpiece"].
      setDefault(workpieceMin.empty() && workpieceMax.empty());

  // Load NC files
  Option::strings_t ncFiles = options["nc-files"].toStrings();
  options["nc-files"].reset();
  for (unsigned i = 0; i < ncFiles.size(); i++)
    addFile(decodeFilename(ncFiles[i]));

  markClean();
}
コード例 #2
0
ファイル: Project.cpp プロジェクト: stevegt/CAMotics
void Project::load(const string &_filename) {
  setFilename(_filename);

  if (SystemUtilities::exists(_filename)) {
    XMLReader reader;
    reader.addFactory("tool_table", &tools);
    reader.read(filename, &options);

    // Default workpiece
    if (!options["automatic-workpiece"].hasValue())
      options["automatic-workpiece"].
        setDefault(workpieceMin.empty() && workpieceMax.empty());

    // Load NC files
    files.clear();
    Option::strings_t ncFiles = options["nc-files"].toStrings();
    for (unsigned i = 0; i < ncFiles.size(); i++) {
      string relPath = decodeFilename(ncFiles[i]);
      addFile(SystemUtilities::absolute(getDirectory(), relPath));
    }
  }

  markClean();
}