Package fr.esrf.TangoApi

Examples of fr.esrf.TangoApi.Database


        try {
            if (forbiddenDevicesList.isEmpty() && withoutForbiddenDevices) {
                fillForbiddenDevicesList();
            }

            Database database = new Database();
            DeviceData deviceData = new DeviceData();

            deviceData.insert(JOKER);
            database.set_timeout_millis(10000);
            if (onlyExportedDevices) {
                deviceArray = database.get_device_exported(JOKER);
            } else {
                deviceArray = database.get_device_list(JOKER);
            }

        } catch (DevFailed e) {
            throw new SourceDeviceException(DevFailedUtils.toString(e));
        }
View Full Code Here


        }
    }

    private void fillForbiddenDevicesList() throws SourceDeviceException {
        try {
            Database database = new Database();

            for (String className : FORBIDDEN_CLASSES) {
                DeviceData deviceData = new DeviceData();

                deviceData.insert(className);
                database.set_timeout_millis(1000);

                String[] classDevices = database.get_device_exported_for_class(className);

                for (String device : classDevices) {
                    forbiddenDevicesList.add(device);

                }
View Full Code Here

    public List<String> getSourceList() throws SourceDeviceException {

        List<String> devicesList = new LinkedList<String>();
        String[] deviceArray = null;

        Database database;

        try {
            database = new Database();
            DeviceData deviceData = new DeviceData();

            deviceData.insert(JOKER);
            database.set_timeout_millis(10000);
            if (onlyExportedDevices) {
                deviceArray = database.get_device_exported(JOKER);
            } else {
                deviceArray = database.get_device_list(JOKER);
            }

        } catch (DevFailed e) {
            throw new SourceDeviceException(DevFailedUtils.toString(e));
        }
View Full Code Here

public class ArchivingSourceDevice implements ISourceDevice {

    @Override
    public List<String> getSourceList() throws SourceDeviceException {
        Database database;
        String[] deviceNameList = null;
        List<String> sourceList = new ArrayList<String>();
        try {
            database = new Database();

            deviceNameList = database.get_device_exported_for_class("HdbExtractor");
        } catch (DevFailed e) {
            throw new SourceDeviceException(DevFailedUtils.toString(e));
        }

        if ((deviceNameList != null) && (deviceNameList.length > 0)) {
View Full Code Here

                                    nexusFileName = attribute.extractString();
                                }
                            }
                            nexusFileNameMap.put(scanServerName.toLowerCase(), nexusFileName);
                            String dataRecorderDeviceName = DEFAULT_RECORDER;
                            Database database = TangoDeviceHelper.getDatabase();
                            if (database != null) {
                                DbDatum dbDatum = database.get_device_property(scanServerName, DATA_RECORDER);
                                if (dbDatum != null) {
                                    dataRecorderDeviceName = dbDatum.extractString();
                                }

                                if (TangoDeviceHelper.isDeviceRunning(dataRecorderDeviceName)) {
View Full Code Here

        String tempAuthModel = null;
        String tempTechModel = null;
        String property = "";
        try {
            Database database = TangoDeviceHelper.getDatabase();
            property = AUTH_DEVICE;
            DbDatum dbDatum = database.get_device_property(getModel(), property);
            tempAuthModel = dbDatum.extractString();

            property = TECH_DEVICE;
            dbDatum = database.get_device_property(getModel(), property);
            tempTechModel = dbDatum.extractString();

            if ((tempAuthModel != null) && (!tempAuthModel.trim().isEmpty())
                    && (!ObjectUtils.sameObject(getAuthModel(), tempAuthModel))) {
                authModel = tempAuthModel;
View Full Code Here

        }

        // - Getting Device Alias
        String alias = getModel();
        try {
            Database db = ApiUtil.get_db_obj();
            db.setAccessControl(TangoConst.ACCESS_WRITE);
            alias = db.get_alias_from_device(getModel());
        } catch (final DevFailed df) {
            // no alias for this device: not really important
            alias = getModel();
        }
        final Font myFont = new Font("Dialog", Font.PLAIN, 12);
View Full Code Here

        }
        bean.setExecutedBatchFile(batchPath);
        bean.start();
        final JPanel mainPanel = new JPanel(new BorderLayout());
        mainPanel.add(bean, BorderLayout.CENTER);
        Database db = ApiUtil.get_db_obj();
        Collection<String> models = new TreeSet<String>(Collator.getInstance());
        models.add("");
        String[] devices = null;
        try {
            devices = db.get_device_exported_for_class("GalilAxis");
        } catch (Exception e) {
            devices = null;
        }
        if (devices != null) {
            for (String device : devices) {
                models.add(device);
            }
        }
        try {
            devices = db.get_device_exported_for_class("Motor");
        } catch (Exception e) {
            devices = null;
        }
        if (devices != null) {
            for (String device : devices) {
View Full Code Here

        }
    }

    public ISuggestions getDevicesSuggestions(String scanServerName) throws SalsaDeviceException {
        try {
            Database m_database = new Database();
            DbDatum m_dataActuators = m_database.get_device_property(scanServerName,
                    "ActuatorsFile");
            String[] actuatorsFile = m_dataActuators.extractStringArray();

            DbDatum m_dataSensors = m_database.get_device_property(scanServerName, "SensorsFile");
            String[] sensorsFile = m_dataSensors.extractStringArray();

            DbDatum m_dataTimebases = m_database.get_device_property(scanServerName,
                    "TimebasesFile");
            String[] timebasesFile = m_dataTimebases.extractStringArray();

            ISuggestions suggestions = new SuggestionsImpl();
            suggestions.setActuatorSuggestionList(parseSuggestions(scanServerName, "ActuatorsFile",
View Full Code Here

                String dataRecorderDeviceName = "storage/recorder/datarecorder.1";
                // Read the property of DataRecorder = //storage/recorder/datarecorder.1/
                try {

                    if (database == null) {
                        database = new Database();
                    }
                    if (database != null) {
                        DbDatum dbDatum = database.get_device_property(context.getScanServerName(),
                                "DataRecorder");
                        if (dbDatum != null) {
View Full Code Here

TOP

Related Classes of fr.esrf.TangoApi.Database

Copyright © 2018 www.massapicom. 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.