diff --git a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8App.java b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8App.java index 33b9264f..11052d98 100644 --- a/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8App.java +++ b/numass-control/cryotemp/src/main/java/inr/numass/cryotemp/PKT8App.java @@ -49,103 +49,5 @@ public class PKT8App extends NumassControlApplication { return Objects.equals(meta.getString("type"), "PKT8"); } - // public static final String DEFAULT_CONFIG_LOCATION = "numass-devices.xml"; -// -// -// PKT8Device device; -// -// /** -// * @param args the command line arguments -// */ -// public static void main(String[] args) { -// launch(args); -// } -// -// @Override -// public void start(Stage primaryStage) throws IOException, ControlException, ParseException { -//// Locale.setDefault(Locale.US);// чтобы отделение десятичных знаков было точкой -// ch.qos.logback.classic.Logger rootLogger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME); -// rootLogger.setLevel(Level.INFO); -// new StorageManager().startGlobal(); -// -// String deviceName = getParameters().getNamed().getOrDefault("device", "PKT-8"); -// -// Meta config; -// -// if (Boolean.parseBoolean(getParameters().getNamed().getOrDefault("debug", "false"))) { -// config = loadTestConfig(); -// } else { -// config = MetaFileReader.read(new File(getParameters().getNamed().getOrDefault("config", DEFAULT_CONFIG_LOCATION))); -// } -// -// -// device = setupDevice(deviceName, config); -// -// // setting up storage connections -// NumassControlUtils.connectStorage(device, config); -// -// FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/PKT8Indicator.fxml")); -// PKT8View controller = new PKT8View(); -// device.connect(controller, "view"); -// loader.setController(controller); -// -// Parent parent = loader.load(); -// -// -// Scene scene = new Scene(parent, 400, 400); -// primaryStage.setTitle("Numass temperature view"); -// primaryStage.setScene(scene); -// primaryStage.setMinHeight(400); -// primaryStage.setMinWidth(400); -//// primaryStage.setResizable(false); -// -// primaryStage.show(); -// -// Platform.runLater(() -> { -// try { -// device.init(); -// } catch (ControlException e) { -// e.printStackTrace(); -// throw new RuntimeException(e); -// } -// }); -// } -// -// public Meta loadTestConfig() throws ControlException { -// try { -// return MetaFileReader -// .read(new File(getClass().getResource("/config/defaultConfig.xml").toURI())); -// } catch (URISyntaxException | IOException | ParseException ex) { -// throw new Error(ex); -// } -// } -// -// public PKT8Device setupDevice(String deviceName, Meta config) throws ControlException { -// Meta deviceMeta; -// -// if (config.hasMeta("device")) { -// deviceMeta = MetaUtils.findNodeByValue(config, "device", "name", deviceName); -// } else { -// deviceMeta = config; -// } -// -// PKT8Device device = new PKT8Device(); -// device.configure(deviceMeta); -// -// if(!deviceMeta.hasValue(PORT_NAME_KEY)){ -// device.getLogger().warn("Port name not provided, will try to use emulation port"); -// } -// -// -// return device; -// } -// -// @Override -// public void stop() throws Exception { -// super.stop(); -// if (device != null) { -// device.shutdown(); -// } -// } } diff --git a/numass-control/cryotemp/src/main/resources/config-debug/devices.xml b/numass-control/cryotemp/src/main/resources/config-debug/devices.xml index 8a431b9f..9d7c9e96 100644 --- a/numass-control/cryotemp/src/main/resources/config-debug/devices.xml +++ b/numass-control/cryotemp/src/main/resources/config-debug/devices.xml @@ -1,6 +1,7 @@ + 120 diff --git a/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java b/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java index c1f3a20f..5de247d4 100644 --- a/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java +++ b/numass-server/src/main/java/inr/numass/server/NumassStorageHandler.java @@ -54,7 +54,7 @@ public class NumassStorageHandler extends StorageRatpackHandler { ctx.getResponse().contentType("text/html"); Template template = ServletUtils.freemarkerConfig().getTemplate("NoteLoader.ftl"); - List notes = getNotes(noteLoader).limit(100).map(note -> render(note)).collect(Collectors.toList()); + List notes = getNotes(noteLoader).limit(100).map(this::render).collect(Collectors.toList()); Map data = new HashMap<>(2); data.put("notes", notes); @@ -75,7 +75,7 @@ public class NumassStorageHandler extends StorageRatpackHandler { @Override protected MetaBuilder pointLoaderPlotOptions(PointLoader loader) { MetaBuilder builder = super.pointLoaderPlotOptions(loader); - if (loader.getName().startsWith("msp") || loader.getName().startsWith("vac") || loader.getName().startsWith("cryptemp")) { + if (loader.getName().startsWith("msp") || loader.getName().startsWith("vac") || loader.getName().startsWith("cryotemp")) { builder.putValue("legend.position", "bottom"); builder.putValue("title", "\"" + loader.getName() + "\""); builder.putNode(new MetaBuilder("vAxis")