Class FocusScanUtils

java.lang.Object
uk.ac.diamond.daq.mapping.ui.experiment.focus.FocusScanUtils

public class FocusScanUtils extends Object
Utility functions for FocusScanWizard
  • Method Details

    • saveConfig

      public static void saveConfig(ILinearFunction<javax.measure.quantity.Energy,javax.measure.quantity.Length> energyFocusFunction, String energyFocusConfigPath, String csvFilePath, org.slf4j.Logger logger)
      Save energy/focus configuration parameters to a file
      Parameters:
      energyFocusFunction - live function containing parameter values
      energyFocusConfigPath - file into which the parameters are to be saved
      logger - for logging information or error messages
    • displayError

      public static void displayError(String text, String message, org.slf4j.Logger logger)
      Log an error and display it to the user in a pop-up message box
      Parameters:
      text - message box title
      message - message to be logged and displayed in the body of the message box
      logger - for logging information or error messages
    • displayYesNoMessage

      public static boolean displayYesNoMessage(String text, String message)
      Display a pop-up message box with Yes invalid input: '&' No buttons
      Parameters:
      text - message box title
      message - message to be logged and displayed in the body of the message box
      Returns:
      true if the user clicks Yes, false if they click No
    • getInitialLengthUnit

      public static javax.measure.Unit<javax.measure.quantity.Length> getInitialLengthUnit()
      Get the initial units (i.e. the units shown in the combo box when it is first displayed)

      This defaults to millimetres but can be set in a property

      Returns:
      the initial units
    • createNumberAndUnitsLengthComposite

      protected static NumberAndUnitsComposite<javax.measure.quantity.Length> createNumberAndUnitsLengthComposite(org.eclipse.swt.widgets.Composite parent)
      Create a NumberAndUnitsComposite for length units, assuming model units are mm
      Parameters:
      parent - composite
      Returns:
      a NumberAndUnitsComposite initialised for length