Esempio n. 1
0
  void DirSelect::Resync(Base::Model* model, const Base::ResyncMsg& /*msg*/)
  {
    if (model==this->model) {
      GenerateItemList();
      Redraw();
    }
    else { // Buttons
      size_t x=0;
      while (x<models.size()) {
        if (models[x].Get()==model && models[x]->IsFinished()) {
          if (this->model.Valid()) {
            Lum::Base::Path newPath;

            if (x==this->model->Get().GetPartCount()) {
              newPath.SetNativeDir(this->model->Get().GetRoot());
            }
            else {
              newPath.SetNativeDir(this->model->Get().GetSubDir(this->model->Get().GetPartCount()-x-1));
            }
            this->model->Set(newPath);
          }
          break;
        }
        x++;
      }
    }
  }
Esempio n. 2
0
bool DatabaseTask::Open(const std::wstring& path)
{
  Lum::OS::Guard<Lum::OS::Mutex> guard(mutex);

  Lum::Base::Path  p;

  p.SetNativeDir(path);

  if (!database->Open(Lum::Base::WStringToString(p.GetPath()).c_str())) {
    return false;
  }

  if (!router->Open()) {
    return false;
  }

  std::map<std::string,double> speedMap;

  GetCarSpeedTable(speedMap);

  routingProfile=new osmscout::FastestPathRoutingProfile(database->GetTypeConfig());
  routingProfile->ParametrizeForCar(*router->GetTypeConfig(),
                                   speedMap,
                                   160.0);

  return true;
}