Examples of DevicePreferences


Examples of fr.soleil.salsa.preferences.DevicePreferences

            initPreferences();
        }
    }

    public void initPreferences() {
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();

        try {
            uiPreferences = UIPreferencesPersistence.loadSystemPreferences();
            if (uiPreferences != null && devicePreferences != null) {
                String scanServerName = devicePreferences.getScanServer();
                setScanServerName(scanServerName);
                dataFitterName = devicePreferences.getDataFitter();

                if (TangoAttributeHelper.isAttributeRunning(scanServerName, "data_01")) {

                    Map<String, PlotProperties> propertiesMap = uiPreferences
                            .getPlotPropertiesMap();
                    // Parse plot properties to set the axis
                    Set<String> plotKeySet = propertiesMap.keySet();
                    PlotProperties plotProp = null;
                    Vector<String> y2SensorDataVector = new Vector<String>();
                    Vector<String> y1SensorDataVector = new Vector<String>();
                    Vector<String> y2DataVector = new Vector<String>();
                    Vector<String> y1DataVector = new Vector<String>();
                    Vector<String> zDataVector = new Vector<String>();
                    Vector<String> noneDataVector = new Vector<String>();
                    String simpleActuatorName = null;
                    String y1dataFitterAttribute = null;
                    String y2dataFitterAttribute = null;
                    for (String dataViewId : plotKeySet) {
                        plotProp = propertiesMap.get(dataViewId);
                        int axis = plotProp.getAxisChoice();
                        // System.out.println(dataViewId + " getAxis =>" + axis);

                        if (dataFitterName != null && !dataFitterName.isEmpty()
                                && dataViewId.startsWith(dataFitterName)) {
                            switch (axis) {
                                case IChartViewer.Y1:
                                    y1dataFitterAttribute = dataViewId;
                                    break;
                                case IChartViewer.Y2:
                                    y2dataFitterAttribute = dataViewId;
                                    break;
                                default:
                                    break;
                            }
                        }
                        else {
                            switch (axis) {
                                case IChartViewer.X:
                                    simpleActuatorName = dataViewId;
                                    break;
                                case IChartViewer.Y1:
                                    if (dataViewId.indexOf("/") > -1) {
                                        y1DataVector.add(dataViewId);
                                    }
                                    else {
                                        y1SensorDataVector.add(dataViewId);
                                    }
                                    break;
                                case IChartViewer.Y2:
                                    if (dataViewId.indexOf("/") > -1) {
                                        y2DataVector.add(dataViewId);
                                    }
                                    else {
                                        y2SensorDataVector.add(dataViewId);
                                    }

                                    break;

                                case 3:
                                    zDataVector.add(dataViewId);
                                    break;
                                default:
                                    noneDataVector.add(dataViewId);
                                    break;
                            }
                        }
                    }

                    if (simpleActuatorName != null && !simpleActuatorName.isEmpty()) {
                        userEvent = true;
                        // CurrentScanDataModel.setActuatorName(scanServerName, simpleActuatorName);
                        setActuatorName(simpleActuatorName);
                    }

                    if (y1dataFitterAttribute != null && !y1dataFitterAttribute.isEmpty()) {
                        firefittedY1DataChanged(y1dataFitterAttribute);
                    }

                    if (y2dataFitterAttribute != null && !y2dataFitterAttribute.isEmpty()) {
                        firefittedY1DataChanged(y2dataFitterAttribute);
                    }

                    if (!y2DataVector.isEmpty()) {
                        userEvent = true;
                        setY2DataList(y2DataVector.toArray(new String[y2DataVector.size()]));
                    }
                    if (!y2SensorDataVector.isEmpty()) {
                        userEvent = true;
                        setY2SensorsDataList(y2SensorDataVector
                                .toArray(new String[y2SensorDataVector.size()]));
                    }
                    if (!y1DataVector.isEmpty()) {
                        userEvent = true;
                        setY1DataList(y1DataVector.toArray(new String[y1DataVector.size()]));
                    }
                    if (!y1SensorDataVector.isEmpty()) {
                        userEvent = true;
                        setY1SensorsDataList(y1SensorDataVector
                                .toArray(new String[y1SensorDataVector.size()]));
                    }
                    if (!zDataVector.isEmpty()) {
                        setZSensorsDataList(zDataVector.toArray(new String[zDataVector.size()]));
                    }
                    if (!noneDataVector.isEmpty()) {
                        setNoneSensorsDataList(noneDataVector.toArray(new String[noneDataVector
                                .size()]));
                    }

                }
            }
        }
        catch (SalsaPreferencesException e) {
            e.printStackTrace();

        }

        if (devicePreferences != null) {
            // System.out.println("setScanServerDeviceName " + devicePreferences.getScanServer());
            String scanServerName = devicePreferences.getScanServer();
            if (scanServerName != null) {
                scanServerName = scanServerName.toLowerCase();
                setScanServerDeviceName(scanServerName);
                start();
                // if (autostart) {
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

            start();
        }
    }

    public void initPreferences() {
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();
        // Load the scanServerName
        if (devicePreferences != null) {
            String scanServerName = devicePreferences.getScanServer();
            setScanServerDeviceName(scanServerName);
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

            start();
        }
    }

    public void initPreferences() {
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();
        // Load the scanServerName
        if (devicePreferences != null) {
            String scanServerName = devicePreferences.getScanServer();
            setScanServerDeviceName(scanServerName);
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

public class ScanFunctionsBean extends ScanServerActionBean {

    private static final long serialVersionUID = -6686557091364566778L;

    public ScanFunctionsBean() {
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();
        // Load the scanServerName
        if (devicePreferences != null) {
            // System.out.println("setScanServerDeviceName " + devicePreferences.getScanServer());
            String scanServerName = devicePreferences.getScanServer();
            setScanServerName(scanServerName);
            start();
        }
    }
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

    private long fitterErrorTmps = 0;

    private final List<String> attributeNameList = new ArrayList<String>();

    public DisplayManagerBean() {
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();

        try {
            uiPreferences = UIPreferencesPersistence.loadSystemPreferences();
            if (uiPreferences != null && devicePreferences != null) {
                String scanServerName = devicePreferences.getScanServer();
                setScanServerName(scanServerName);
                dataFitterName = devicePreferences.getDataFitter();

                if (TangoAttributeHelper.isAttributeRunning(scanServerName, "data_01")) {

                    Map<String, PlotProperties> propertiesMap = uiPreferences
                            .getPlotPropertiesMap();
                    // Parse plot properties to set the axis
                    Set<String> plotKeySet = propertiesMap.keySet();
                    PlotProperties plotProp = null;
                    Vector<String> y2SensorDataVector = new Vector<String>();
                    Vector<String> y1SensorDataVector = new Vector<String>();
                    Vector<String> y2DataVector = new Vector<String>();
                    Vector<String> y1DataVector = new Vector<String>();
                    Vector<String> zDataVector = new Vector<String>();
                    Vector<String> noneDataVector = new Vector<String>();
                    String simpleActuatorName = null;
                    String y1dataFitterAttribute = null;
                    String y2dataFitterAttribute = null;
                    for (String dataViewId : plotKeySet) {
                        plotProp = propertiesMap.get(dataViewId);
                        int axis = plotProp.getAxisChoice();

                        if (dataFitterName != null && !dataFitterName.isEmpty()
                                && dataViewId.startsWith(dataFitterName)) {
                            switch (axis) {
                                case IChartViewer.Y1:
                                    y1dataFitterAttribute = dataViewId;
                                    break;
                                case IChartViewer.Y2:
                                    y2dataFitterAttribute = dataViewId;
                                    break;
                                default:
                                    break;
                            }
                        }
                        else {
                            switch (axis) {
                                case IChartViewer.X:
                                    simpleActuatorName = dataViewId;
                                    break;
                                case IChartViewer.Y1:
                                    if (dataViewId.indexOf("/") > -1) {
                                        y1DataVector.add(dataViewId);
                                    }
                                    else {
                                        y1SensorDataVector.add(dataViewId);
                                    }
                                    break;
                                case IChartViewer.Y2:
                                    if (dataViewId.indexOf("/") > -1) {
                                        y2DataVector.add(dataViewId);
                                    }
                                    else {
                                        y2SensorDataVector.add(dataViewId);
                                    }

                                    break;

                                case 3:
                                    zDataVector.add(dataViewId);
                                    break;
                                default:
                                    noneDataVector.add(dataViewId);
                                    break;
                            }
                        }
                    }

                    if (simpleActuatorName != null && !simpleActuatorName.isEmpty()) {
                        userEvent = true;
                        setActuatorName(simpleActuatorName);
                    }

                    if (y1dataFitterAttribute != null && !y1dataFitterAttribute.isEmpty()) {
                        firefittedY1DataChanged(y1dataFitterAttribute);
                    }

                    if (y2dataFitterAttribute != null && !y2dataFitterAttribute.isEmpty()) {
                        firefittedY1DataChanged(y2dataFitterAttribute);
                    }

                    if (!y2DataVector.isEmpty()) {
                        userEvent = true;
                        setY2DataList(y2DataVector.toArray(new String[y2DataVector.size()]));
                    }
                    if (!y2SensorDataVector.isEmpty()) {
                        userEvent = true;
                        setY2SensorsDataList(y2SensorDataVector
                                .toArray(new String[y2SensorDataVector.size()]));
                    }
                    if (!y1DataVector.isEmpty()) {
                        userEvent = true;
                        setY1DataList(y1DataVector.toArray(new String[y1DataVector.size()]));
                    }
                    if (!y1SensorDataVector.isEmpty()) {
                        userEvent = true;
                        setY1SensorsDataList(y1SensorDataVector
                                .toArray(new String[y1SensorDataVector.size()]));
                    }
                    if (!zDataVector.isEmpty()) {
                        setZSensorsDataList(zDataVector.toArray(new String[zDataVector.size()]));
                    }
                    if (!noneDataVector.isEmpty()) {
                        setNoneSensorsDataList(noneDataVector.toArray(new String[noneDataVector
                                .size()]));
                    }

                }
            }
        }
        catch (SalsaPreferencesException e) {
            e.printStackTrace();

        }

        if (devicePreferences != null) {
            // System.out.println("setScanServerDeviceName " + devicePreferences.getScanServer());
            String scanServerName = devicePreferences.getScanServer();
            if (scanServerName != null) {
                scanServerName = scanServerName.toLowerCase();
                setScanServerDeviceName(scanServerName);
                start();
                String currentConfig = CurrentScanDataModel.readRunName(scanServerName);
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

     */
    private JButton clearButton;

    public HistoricView() {
        this.initialize();
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();
        // Load the scanServerName
        if (devicePreferences != null) {
            scanServerName = devicePreferences.getScanServer();
            CurrentScanDataModel.addScanServerListener(scanServerName, this);
        }
        refresh();
    }
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

    /**
     * Load preference from file.
     */
    public void loadPreferences() throws SalsaPreferencesException {
        DevicePreferences modelPreferences = DevicePreferencesPersistence.loadSystemPreferences();
        initPerspectiveManager();
        setPreferences(modelPreferences, getUiPreferences());
    }
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

    /**
     * Load preference from file.
     */
    public void loadPreferences() throws SalsaPreferencesException {
        DevicePreferences modelPreferences = DevicePreferencesPersistence.loadSystemPreferences();
        initPerspectiveManager();
        setPreferences(modelPreferences, getUiPreferences());
    }
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

    private static final long serialVersionUID = -7936838531758140280L;
    protected IContext context = null;

    public PauseButton() {
        super(ACTION_TYPE.PAUSE);
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();
        context = SalsaAPI.extractContext(devicePreferences);
    }
View Full Code Here

Examples of fr.soleil.salsa.preferences.DevicePreferences

    private static final long serialVersionUID = -7936838531758140280L;
    protected IContext context = null;

    public ResumeButton() {
        super(ACTION_TYPE.RESUME);
        DevicePreferences devicePreferences = SalsaAPI.getDevicePreferences();
        context = SalsaAPI.extractContext(devicePreferences);
    }
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.