Class ScannerDocument


  • public class ScannerDocument
    extends xal.extension.fxapplication.XalFxDocument
    Author:
    yngvelevinsen
    • Field Detail

      • constraintsAllowed

        public final boolean constraintsAllowed
    • Method Detail

      • initScannerDocument

        public static ScannerDocument initScannerDocument​(javafx.stage.Stage stage)
      • getCurrentMeasurementArray

        public double[][] getCurrentMeasurementArray()
      • getCurrentTimestampsArray

        public xal.ca.Timestamp[][] getCurrentTimestampsArray()
      • resetCurrentMeasArrays

        public void resetCurrentMeasArrays()
      • increaseNumCombosDone

        public void increaseNumCombosDone()
      • setZeroCombosDone

        public void setZeroCombosDone()
      • getNumCombosDone

        public int getNumCombosDone()
      • getConstraints

        public javafx.collections.ObservableList<String> getConstraints()
      • setConstraint

        public void setConstraint​(int index,
                                  String constraint)
      • clearAllConstraints

        public void clearAllConstraints()
      • setDelayBetweenMeasurements

        public void setDelayBetweenMeasurements​(long delay)
      • setDelayBetweenMeasurements

        public void setDelayBetweenMeasurements​(double delay)
      • getDelayBetweenMeasurements

        public long getDelayBetweenMeasurements()
      • getNumberMeasurementsPerCombo

        public int getNumberMeasurementsPerCombo()
      • setNumberMeasurementsPerCombo

        public void setNumberMeasurementsPerCombo​(int numberMeasurements)
      • getCommandToExecute

        public String getCommandToExecute()
      • setCommandToExecute

        public void setCommandToExecute​(String command)
      • getPVChannels

        public javafx.collections.ObservableList<ChannelWrapper> getPVChannels()
      • getNumPVChannels

        public int getNumPVChannels()
      • getDataSets

        public Map<String,​double[][]> getDataSets()
      • getDataSet

        public double[][] getDataSet​(String setKey)
      • getDataSetForPV

        public double[] getDataSetForPV​(String setKey,
                                        String pvName)
        Get the array of data values for the PV in the specified data set.
        Parameters:
        setKey - The key of the data set
        pvName - The name of the PV
        Returns:
        An array of double values
      • setDataSet

        public void setDataSet​(String setName)
      • getPVrbScalarData

        public List<xal.ca.Channel> getPVrbScalarData​(String setKey)
      • setPVreadbackScalarData

        public void setPVreadbackScalarData​(String setKey,
                                            List<xal.ca.Channel> data)
      • setPVreadbackData

        public void setPVreadbackData​(String setKey)
      • setPVwriteData

        public void setPVwriteData​(String setKey)
      • getTimestamps

        public xal.ca.Timestamp[][] getTimestamps​(String setKey)
      • setTimestamps

        public void setTimestamps​(String setKey,
                                  xal.ca.Timestamp[][] timestamps)
      • setTimestamps

        public void setTimestamps​(String setKey)
      • getScanNumberProperty

        public javafx.beans.property.SimpleIntegerProperty getScanNumberProperty()
      • increaseScanNumber

        public int increaseScanNumber()
      • getNumberOfCombos

        public int getNumberOfCombos()
      • getCombo

        public double[] getCombo​(int i)
      • unsetInitialCombo

        public void unsetInitialCombo()
      • getInitialCombo

        public double[] getInitialCombo()
      • setCommandActive

        public void setCommandActive​(boolean active)
      • isCommandActive

        public boolean isCommandActive()
      • setIncludeInitialSettings

        public void setIncludeInitialSettings​(boolean include)
      • getIncludeInitialSettings

        public boolean getIncludeInitialSettings()
      • getIncludeInitialSettingsProperty

        public javafx.beans.property.SimpleBooleanProperty getIncludeInitialSettingsProperty()
      • setIncludeReverseScan

        public void setIncludeReverseScan​(boolean include)
      • getIncludeReverseScan

        public boolean getIncludeReverseScan()
      • getIncludeReverseScanProperty

        public javafx.beans.property.SimpleBooleanProperty getIncludeReverseScanProperty()
      • getSimple1B1Property

        public javafx.beans.property.SimpleBooleanProperty getSimple1B1Property()
      • setReturnHome

        public void setReturnHome​(boolean return_home)
      • getReturnHome

        public boolean getReturnHome()
      • getReturnHomeProperty

        public javafx.beans.property.SimpleBooleanProperty getReturnHomeProperty()
      • addCurrentMeasLoadedListener

        public void addCurrentMeasLoadedListener​(javafx.beans.value.ChangeListener listener)
      • addDelayBetweenMeasListener

        public void addDelayBetweenMeasListener​(javafx.beans.value.ChangeListener listener)
      • addNumberMeasPerCombosListener

        public void addNumberMeasPerCombosListener​(javafx.beans.value.ChangeListener listener)
      • saveDocumentAs

        public void saveDocumentAs​(URL url)
        Save the ScannerDocument document to the specified URL.
        Specified by:
        saveDocumentAs in class xal.extension.fxapplication.XalFxDocument
        Parameters:
        url - The file URL where the data should be saved
      • setSelectedSets

        public void setSelectedSets​(List<String> selectedItems)
        Called when there is a change in selection in the list of completed scans
        Parameters:
        selectedItems - list of items selected by user
      • getSelectedSets

        public List<String> getSelectedSets()
      • deleteSet

        public void deleteSet​(String setName)
      • exportToCSV

        public void exportToCSV​(File filePath)
        TODO combine multiple sets, for now just dumps the first selected set (in case of multiple selection)
        Parameters:
        filePath - Path to new CSV file
      • getUsingHDF5

        public boolean getUsingHDF5()
      • getUsingHDF5Property

        public javafx.beans.property.SimpleBooleanProperty getUsingHDF5Property()
      • saveCurrentMeas

        public void saveCurrentMeas​(int nmeas)
      • setCurrentMeasurementKey

        public void setCurrentMeasurementKey​(String name)
      • setCurrentMeasurementKey

        public void setCurrentMeasurementKey()
      • getCurrentMeasurementKey

        public String getCurrentMeasurementKey()
      • getSetName

        public String getSetName​(String key)
        Get the name for this data set if no name has been defined, key is the name
        Parameters:
        key - unique key for this data set
        Returns:
        name for this data set
      • getSetKey

        public String getSetKey​(String setName)
        Get the key for a named measurement (data set)
        Parameters:
        setName - Name of measurement
        Returns:
        The key for the given measurement name
      • setMeasurementName

        public void setMeasurementName​(String oldName,
                                       String newName)
                                throws NoSuchFieldException
        Set name of a measurement. Name could also be considered the short description of the measurement
        Parameters:
        oldName - Current name of the data set
        newName - New name of the data set
        Throws:
        NoSuchFieldException
      • setDataSetNotes

        public void setDataSetNotes​(String hashKey,
                                    String notes)
        Set the description of a measurement. Old description is overwritten.
        Parameters:
        hashKey - The hash of the measurement data set
        notes - New notes for this data set
      • h5_writeCurrentArrayData

        public int h5_writeCurrentArrayData​(ArrayList<xal.ca.ChannelTimeRecord> arrayReadings)
        This will write the array to the currently active measurement file
        Parameters:
        arrayReadings -
      • h5_writeCurrentScalarData

        public int h5_writeCurrentScalarData​(ArrayList<xal.ca.ChannelTimeRecord> scalarReadings)
      • h5_writeCurrentSetValues

        public int h5_writeCurrentSetValues()
      • loadDocument

        public void loadDocument​(URL url)
        Reads the content of the document from the specified URL, and loads the information into the application.
        Specified by:
        loadDocument in class xal.extension.fxapplication.XalFxDocument
        Parameters:
        url - The path to the XML file (ignored, see setSource)
      • loadDocument

        public void loadDocument​(boolean testMode)
        Parameters:
        testMode - if true, skip connecting to channels etc
      • getActivePVreadableScalar

        public ChannelWrapper getActivePVreadableScalar​(int i)
        This function returns the i'th scalar PV to be read
        Parameters:
        i - the channel index (counting active only)
        Returns:
        Return the i'th active readable channel
      • getActivePVreadableArray

        public ChannelWrapper getActivePVreadableArray​(int i)
        This function returns the i'th array PV to be read
        Parameters:
        i - the channel index (counting active only)
        Returns:
        Return the i'th active readable channel
      • getActivePVwriteback

        public ChannelWrapper getActivePVwriteback​(int i)
        Parameters:
        i - the channel index (counting active only)
        Returns:
        Return the i'th active scannable channel
      • checkConstraints

        public boolean checkConstraints​(double[] combo)
                                 throws ScriptException
        Check a combo for any of the potentially defined constraints TODO there are probably better/safer ways to do this?
        Parameters:
        combo - the combo to verify
        Returns:
        true if combo pass all constraints
        Throws:
        ScriptException - if there was an evaluation issue
      • calculateCombos

        public int calculateCombos()
      • newDocument

        public void newDocument()
        Specified by:
        newDocument in class xal.extension.fxapplication.XalFxDocument