/** * @param stripChartPart * @throws WrongADLFormatException */ private void plotcom(ADLWidget stripChartPart) throws WrongADLFormatException { for (FileLine fileLine : stripChartPart.getBody()) { String stripChart = fileLine.getLine(); String[] row = stripChart.split("="); if (row.length != 2) { throw new WrongADLFormatException(Messages.Bargraph_1); } String parameter = row[0].trim(); /** period=30.000000 units="minute" */ if (parameter.equals("title")) { String name = row[1].replaceAll("\"", "").trim(); _widget.setPropertyValue(AbstractChartModel.PROP_LABEL, name); } else if (parameter.equals("clr")) { _widget.setColor(AbstractWidgetModel.PROP_COLOR_FOREGROUND, ADLHelper.getRGB(row[1])); } else if (parameter.equals("bclr")) { _widget.setColor(AbstractWidgetModel.PROP_COLOR_BACKGROUND, ADLHelper.getRGB(row[1])); } else if (parameter.equals("xlabel")) { String xLabel = row[1].replaceAll("\"", "").trim(); _widget.setPropertyValue(AbstractChartModel.PROP_X_AXIS_LABEL, xLabel); } else if (parameter.equals("ylabel")) { String yLabel = row[1].replaceAll("\"", "").trim(); _widget.setPropertyValue(AbstractChartModel.PROP_Y_AXIS_LABEL, yLabel); } else { LOG.info("Unknown StripChart {} parameter: {}", stripChartPart.getType(), fileLine); } } }
/** * @param stripChartPart * @throws WrongADLFormatException */ private void pen(ADLWidget stripChartPart) throws WrongADLFormatException { int start = stripChartPart.getType().indexOf("["); int end = stripChartPart.getType().indexOf("]"); String id = stripChartPart.getType().substring(start + 1, end); int index = Integer.parseInt(id); for (FileLine fileLine : stripChartPart.getBody()) { String stripChart = fileLine.getLine(); String[] row = stripChart.split("="); if (row.length != 2) { throw new WrongADLFormatException(Messages.Bargraph_1); } String parameter = row[0].trim(); /** chan="$(epn_ai)" utilChan="$(epn_ai)_h" clr=62 */ if (parameter.equals("chan")) { DebugHelper.add(this, row[1]); row = ADLHelper.cleanString(row[1]); if (index == 0) { _widget.setPrimarPv(row[1]); } _widget.setPropertyValue(StripChartModel.enablePlotPropertyId(index), true); DynamicsDescriptor dynamicsDescriptor = new DynamicsDescriptor(); // FIXME: Parameter was String[].class @SuppressWarnings("restriction") ParameterDescriptor parameterDescriptor = new ParameterDescriptor(row[1], ""); dynamicsDescriptor.addInputChannel(parameterDescriptor); _widget.setPropertyValue(StripChartModel.valuePropertyId(index), index); _widget.setDynamicsDescriptor(StripChartModel.valuePropertyId(index), dynamicsDescriptor); } else if (parameter.equals("utilChan")) { // not used in SDS } else if (parameter.equals("clr")) { _widget.setPropertyValue( AbstractChartModel.plotColorPropertyId(index), ADLHelper.getRGB(row[1])); } else { LOG.info("Unknown StripChart {} parameter: {}", stripChartPart.getType(), fileLine); } } }