@OPERATION void stopDevice() { try { execLinkedOp("to-device", "stopDevice"); } catch (Exception e) { e.printStackTrace(); failed("stopDevice linked operation failed", "fail", e.getMessage()); } }
@SuppressWarnings("unchecked") @OPERATION void input_data() { String file = "simulation.yaml"; Yaml yaml = new Yaml(); Object data; try { data = yaml.load(new FileInputStream(file)); } catch (FileNotFoundException e) { failed("User Input failed", "fail", file, e.getMessage()); return; } LinkedHashMap<String, Object> map = (LinkedHashMap<String, Object>) data; try { for (Entry<String, Object> entry : map.entrySet()) { switch (entry.getKey()) { case "World": defineObsProperty("parameter", "world"); readWorld((LinkedHashMap<String, Object>) entry.getValue()); break; case "Simulation": defineObsProperty("parameter", "simulation"); readSimulation((LinkedHashMap<String, Object>) entry.getValue()); break; case "Analysis": defineObsProperty("parameter", "analysis"); readAnalysis((LinkedHashMap<String, Object>) entry.getValue()); break; case "People": defineObsProperty("parameter", "people"); readPeople((ArrayList<Object>) entry.getValue()); break; case "Hovering": defineObsProperty("parameter", "hovering"); readHovering((ArrayList<Object>) entry.getValue()); break; } } } catch (Exception e) { failed("Parameter parsing failed", "fail", file, e.getMessage()); return; } }