Exemplo n.º 1
0
  @Override
  public IStatus execute(final IProgressMonitor monitor) throws CoreException {
    final Modeldata modeldata =
        SimulationKalypsoRiskModelspecHelper.getModeldata(
            SIMULATION_KALYPSORISK_TYPEID.RISK_ZONES_CALCULATION);
    final URL scenarioURL = ResourceUtilities.createQuietURL(m_scenarioFolder);

    final Map<String, Object> inputs = SimulationRunnerFactory.resolveInputs(modeldata.getInput());
    final List<String> outputs = SimulationRunnerFactory.resolveOutputs(modeldata.getOutput());

    final ISimulationRunner runner = SimulationRunnerFactory.createRunner(modeldata, scenarioURL);
    return runner.run(inputs, outputs, monitor);
  }
 private void logMessage(final CoreException ex) {
   try {
     final GMLWorkspace workspace = GmlSerializer.createGMLWorkspace(m_rcmUrl, null);
     final IRainfallCatchmentModel rcmModel = (IRainfallCatchmentModel) workspace.getRootFeature();
     final String logPath = rcmModel.getLogPath();
     final URL context = workspace.getContext();
     final URL url = new URL(context, logPath);
     final IFile member = ResourceUtilities.findFileFromURL(url);
     if (member != null) {
       final GeoStatusLog log = new GeoStatusLog(member.getLocation().toFile());
       log.log(ex.getStatus());
       log.serialize();
     }
   } catch (final Exception e) {
     e.printStackTrace();
   }
 }