All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.esrf.TangoApi.DeviceInterface Maven / Gradle / Ivy

//+======================================================================
// $Source$
//
// Project:   Tango
//
// Description:  java source code for the TANGO client/server API.
//
// $Author: pascal_verdier $
//
// Copyright (C) :      2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,
//						European Synchrotron Radiation Facility
//                      BP 220, Grenoble 38043
//                      FRANCE
//
// This file is part of Tango.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with Tango.  If not, see .
//
// $Revision: 25296 $
//
//======================================================================


package fr.esrf.TangoApi;

import fr.esrf.Tango.DevFailed;
import fr.esrf.Tango.DevIntrChange;

/**
 * Object defining device interface (commands and attributes and
 * to callback when a InterfaceChange event is received.
 *
 * @author pascal_verdier
 */
public class DeviceInterface {
    /**
     * Attribute configuration list for the device.
     */
    public AttributeInfoEx[] attributeInfoList;
    /**
     * Command info list for the device.
     */
    public CommandInfo[]        commandInfoList;
    /**
     * false if change is possible, true if change is sure (in case of event).
     */
    public boolean              deviceStarted;
    //=============================================
    /**
     * Creates a new instance of DeviceInterface for specified device.
     * @param deviceName specified device name
     * @throws DevFailed if device connection failed.
     */
    //=============================================
    public DeviceInterface(String deviceName) throws DevFailed {
        this(new DeviceProxy(deviceName));
    }
    //=============================================
    /**
     * Creates a new instance of DeviceInterface for specified device.
     * @param deviceProxy specified device proxy object.
     * @throws DevFailed if device connection failed.
     */
    //=============================================
    public DeviceInterface(DeviceProxy deviceProxy) throws DevFailed {
        attributeInfoList = deviceProxy.get_attribute_info_ex();
        commandInfoList = deviceProxy.command_list_query();
        deviceStarted = false;
    }
    //=============================================
    /**
     * Creates a new instance of DeviceInterface
     */
    //=============================================
    public DeviceInterface(boolean deviceStarted,
                              CommandInfo[] commandInfoList, AttributeInfoEx[] attributeInfoList) {
        this.deviceStarted = deviceStarted;
        this.commandInfoList = commandInfoList;
        this.attributeInfoList = attributeInfoList;
    }
    //=============================================
    /**
     * Creates a new instance of DeviceInterface
     */
    //=============================================
    public DeviceInterface(DevIntrChange interfaceChange) {
        this.deviceStarted = interfaceChange.dev_started;
        this.commandInfoList = new CommandInfo[interfaceChange.cmds.length];
        for (int i=0 ; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy