Examples of TangoAttribute


Examples of fr.soleil.tango.clientapi.TangoAttribute

     *
     * @param attr
     */
    protected void setAttribute(String attributeName, boolean attributeValue, boolean testIfIsRunning) throws DevFailed {
        if (!testIfIsRunning || TangoAttributeHelper.isAttributeRunning(scanServerName, attributeName)) {
            new TangoAttribute(scanServerName + "/" + attributeName).write(attributeValue);
        }
    }
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

     *
     * @param attr
     */
    protected void setAttribute(String attributeName, int attributeValue, boolean testIfIsRunning) throws DevFailed {
        if (!testIfIsRunning || TangoAttributeHelper.isAttributeRunning(scanServerName, attributeName)) {
            new TangoAttribute(scanServerName + "/" + attributeName).write(attributeValue);
        }
    }
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

     *
     * @param attr
     */
    protected void setAttribute(String attributeName, double attributeValue, boolean testIfIsRunning) throws DevFailed {
        if (!testIfIsRunning || TangoAttributeHelper.isAttributeRunning(scanServerName, attributeName)) {
            new TangoAttribute(scanServerName + "/" + attributeName).write(attributeValue);
        }
    }
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

     * @param attr
     */
    protected void setAttribute(String attributeName, String attributeValue, boolean testIfIsRunning) throws DevFailed {
        if (!testIfIsRunning
                || ((attributeValue != null) && TangoAttributeHelper.isAttributeRunning(scanServerName, attributeName))) {
            new TangoAttribute(scanServerName + "/" + attributeName).write(attributeValue);
        }
    }
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

     */
    protected void setAttribute(String attributeName, double[] attributeValue, boolean testIfIsRunning)
    throws DevFailed {
        if ((attributeValue != null)
                && (!testIfIsRunning || (TangoAttributeHelper.isAttributeRunning(scanServerName, attributeName)))) {
            new TangoAttribute(scanServerName + "/" + attributeName).write(attributeValue);
        }
    }
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

     */
    protected void setAttribute(String attributeName, String[] attributeValue, boolean testIfIsRunning)
    throws DevFailed {
        if ((attributeValue != null)
                && (!testIfIsRunning || TangoAttributeHelper.isAttributeRunning(scanServerName, attributeName))) {
            new TangoAttribute(scanServerName + "/" + attributeName).writeSpectrum((Object[]) attributeValue);
        }
    }
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

     */
    public static Double getDataWritten(IDevice device) throws SalsaDeviceException {
        Double data = null;
        if (device != null && device.getName() != null && !"".equals(device.getName().trim())) {
            try {
                TangoAttribute scalar = new TangoAttribute(device.getName());
                if (scalar != null) {
                    data = scalar.readWritten(Double.class);
                }
            }
            catch (DevFailed e) {
                e.printStackTrace();
                SalsaDeviceException salsaDeviceException = new SalsaDeviceException(
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

                double[] doubleArray = new double[length];
                for (int index = 0; index < length; ++index) {
                    doubleArray[index] = dataArray[index].doubleValue();
                }
                try {
                    TangoAttribute ta = new TangoAttribute(device.getName());
                    ta.writeSpectrum(doubleArray);
                }
                catch (DevFailed e) {
                    e.printStackTrace();
                    SalsaDeviceException salsaDeviceException = new SalsaDeviceException(
                            "Error while trying to write the TangORB attribute value for the device "
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

        report.setReadable(readable);
        report.setWriteable(writeable);

        // Data and data format.
        try {
            TangoAttribute tangoAttribute = new TangoAttribute(name);
            String format = null;
            try {
                AttributeProxy attributeProxy = tangoAttribute.getAttributeProxy();
                if (attributeProxy != null) {
                    AttributeInfo attributeInfo = attributeProxy.get_info();
                    if (attributeInfo != null) {
                        format = attributeInfo.format;
                    }
                }
            }
            catch (Exception e) {
                // Ignore exception: it is not a problem if format is not recovered
                format = null;
            }
            report.setFormat(format);

            double[] rawData;
            switch (info.data_format.value()) {
                case AttrDataFormat._SCALAR:
                    report.setDimensionType(DimensionType.SCALAR);
                    rawData = AttributeHelper.extractToDoubleArray(attribute);
                    if (readable) {
                        report.setReadScalarData(rawData[0]);
                    }
                    else {
                        report.setReadScalarData(null);
                    }
                    if (writeable) {
                        Double dataWritten = tangoAttribute.readWritten(Double.class);
                        report.setWriteScalarData(dataWritten);
                    }
                    else {
                        report.setWriteScalarData(null);
                    }
                    report.setReadSpectrumData(null);
                    report.setWriteSpectrumData(null);
                    report.setReadImageData(null);
                    report.setWriteImageData(null);
                    break;
                case AttrDataFormat._SPECTRUM:
                    report.setDimensionType(DimensionType.SPECTRUM);
                    rawData = AttributeHelper.extractToDoubleArray(attribute);
                    int spectrumLength = attribute.getDimX();
                    Double[] readSpectrumData = null;
                    Double[] writeSpectrumData = null;

                    if (readable) {
                        readSpectrumData = new Double[spectrumLength];
                        writeSpectrumData = null;
                        for (int index = 0; index < spectrumLength; ++index) {
                            readSpectrumData[index] = rawData[index];
                        }
                    }

                    if (writeable) {
                        writeSpectrumData = new Double[spectrumLength];
                        for (int index = 0; index < spectrumLength; ++index) {
                            writeSpectrumData = tangoAttribute.readSpecOrImage(Double.class);

                        }

                    }
                    report.setReadScalarData(null);
                    report.setWriteScalarData(null);
                    report.setReadSpectrumData(readSpectrumData);
                    report.setWriteSpectrumData(writeSpectrumData);
                    report.setReadImageData(null);
                    report.setWriteImageData(null);
                    break;
                case AttrDataFormat._IMAGE:
                    report.setDimensionType(DimensionType.IMAGE);
                    rawData = AttributeHelper.extractToDoubleArray(attribute);
                    int xDim = attribute.getDimX();
                    int yDim = attribute.getDimY();
                    Double[][] readImageData;
                    Double[][] writeImageData;
                    Double[] writtenImage = tangoAttribute.readSpecOrImage(Double.class);
                    int yOffset;
                    if (readable) {
                        readImageData = new Double[yDim][xDim];
                        if (writeable) {
                            writeImageData = new Double[yDim][xDim];
View Full Code Here

Examples of fr.soleil.tango.clientapi.TangoAttribute

     *
     * @param attr
     */
    protected void setAttribute(String attributeName, boolean attributeValue, boolean testIfIsRunning) throws DevFailed {
        if (!testIfIsRunning || TangoAttributeHelper.isAttributeRunning(scanServerName, attributeName)) {
            new TangoAttribute(scanServerName + "/" + attributeName).write(attributeValue);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.