Package fr.esrf.TangoApi

Examples of fr.esrf.TangoApi.Database


    }

    // Get the values of properties don t throw a error if not exist !!
    public ISuggestions getDevicesSuggestions(String scanServerName) throws SalsaDeviceException {
        ISuggestions suggestions = new SuggestionsImpl();
        Database m_database = null;
        try {
            m_database = new Database();
        }
        catch (DevFailed e) {
            return suggestions;
        }
        if (m_database != null) {
            // get ActuatorsFile property
            try {
                DbDatum m_dataActuators = m_database.get_device_property(scanServerName,
                        "ActuatorsFile");
                String[] actuatorsFile = m_dataActuators.extractStringArray();
                if (actuatorsFile != null && actuatorsFile.length > 0) {
                    suggestions.setActuatorSuggestionList(parseSuggestions(scanServerName,
                            "ActuatorsFile", actuatorsFile));
                }
            }
            catch (DevFailed e) {
            }

            // get SensorsFile property
            try {
                DbDatum m_dataSensors = m_database.get_device_property(scanServerName,
                        "SensorsFile");
                String[] sensorsFile = m_dataSensors.extractStringArray();
                if (sensorsFile != null && sensorsFile.length > 0) {
                    suggestions.setSensorSuggestionList(parseSuggestions(scanServerName,
                            "SensorsFile", sensorsFile));
                }
            }
            catch (DevFailed e) {
            }

            // get TimebasesFile property
            try {
                DbDatum m_dataTimebases = m_database.get_device_property(scanServerName,
                        "TimebasesFile");
                String[] timebasesFile = m_dataTimebases.extractStringArray();
                if (timebasesFile != null && timebasesFile.length > 0) {
                    suggestions.setTimebaseSuggestionList(parseSuggestions(scanServerName,
                            "TimebasesFile", timebasesFile));
View Full Code Here


        if (getDevicePreferences() != null) {
            String scanServer = getDevicePreferences().getScanServer();
            // Read the property of DataRecorder =
            // //storage/recorder/datarecorder.1/
            String dataRecorderDeviceName = "storage/recorder/datarecorder.1";
            Database database = TangoDeviceHelper.getDatabase();
            if (database != null) {
                try {
                    DbDatum dbDatum = database.get_device_property(scanServer, "DataRecorder");
                    if (dbDatum != null) {
                        dataRecorderDeviceName = dbDatum.extractString();
                    }

                    if (dataRecorderDeviceName != null && !dataRecorderDeviceName.isEmpty()) {
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

        long endTime = System.currentTimeMillis();
        System.out.println("RECORDED - duration = " + (endTime - beginTime));
    }

    private static void fillRecordedDevicesTreeMap() {
        Database database = TangoDeviceHelper.getDatabase();

        List<String> devicesList = new LinkedList<String>();
        try {
            // get all devices
            String[] exportedDevices = database.get_device_list(JOKER);
            for (String device : exportedDevices) {
                devicesList.add(device);
            }
        } catch (DevFailed e) {
            e.printStackTrace();
View Full Code Here

        String[] configList = null;
        if (getDevicePreferences() != null) {
            String scanServer = getDevicePreferences().getScanServer();
            // Read the property of DataRecorder = //storage/recorder/datarecorder.1/
            String dataRecorderDeviceName = "storage/recorder/datarecorder.1";
            Database database = TangoDeviceHelper.getDatabase();
            if (database != null) {
                try {
                    DbDatum dbDatum = database.get_device_property(scanServer, "DataRecorder");
                    if (dbDatum != null) {
                        dataRecorderDeviceName = dbDatum.extractString();
                    }

                    if (dataRecorderDeviceName != null && !dataRecorderDeviceName.isEmpty()) {
View Full Code Here

    }

    // Get the values of properties don t throw a error if not exist !!
    public ISuggestions getDevicesSuggestions(String scanServerName) throws SalsaDeviceException {
        ISuggestions suggestions = new SuggestionsImpl();
        Database m_database = null;
        try {
            m_database = new Database();
        }
        catch (DevFailed e) {
            return suggestions;
        }
        if (m_database != null) {
            // get ActuatorsFile property
            try {
                DbDatum m_dataActuators = m_database.get_device_property(scanServerName,
                        "ActuatorsFile");
                String[] actuatorsFile = m_dataActuators.extractStringArray();
                if (actuatorsFile != null && actuatorsFile.length > 0) {
                    suggestions.setActuatorSuggestionList(parseSuggestions(scanServerName,
                            "ActuatorsFile", actuatorsFile));
                }
            }
            catch (DevFailed e) {
                System.out.println(DevFailedUtils.toString(e));
            }

            // get SensorsFile property
            try {
                DbDatum m_dataSensors = m_database.get_device_property(scanServerName,
                        "SensorsFile");
                String[] sensorsFile = m_dataSensors.extractStringArray();
                if (sensorsFile != null && sensorsFile.length > 0) {
                    suggestions.setSensorSuggestionList(parseSuggestions(scanServerName,
                            "SensorsFile", sensorsFile));
                }
            }
            catch (DevFailed e) {
                System.out.println(DevFailedUtils.toString(e));
            }

            // get TimebasesFile property
            try {
                DbDatum m_dataTimebases = m_database.get_device_property(scanServerName,
                        "TimebasesFile");
                String[] timebasesFile = m_dataTimebases.extractStringArray();
                if (timebasesFile != null && timebasesFile.length > 0) {
                    suggestions.setTimebaseSuggestionList(parseSuggestions(scanServerName,
                            "TimebasesFile", timebasesFile));
View Full Code Here

        // System.out.println("PropertyDeviceArea : initProperty = " + deviceName + "/" +
        // propertyName);
        try {
            // BindingTango.createDevice(this,deviceName,refreshingPeriod);
            if (m_database == null) {
                m_database = new Database();
            }
            (new Thread() {
                @Override
                public void run() {
                    try {
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();
        }
        setBorder(BorderFactory.createTitledBorder(border, alias, TitledBorder.DEFAULT_JUSTIFICATION,
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

        forbiddenDevicesList = new LinkedList<String>();
    }

    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

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.