Class FocusScanUtils
java.lang.Object
uk.ac.diamond.daq.mapping.ui.experiment.focus.FocusScanUtils
Utility functions for
FocusScanWizard-
Method Summary
Modifier and TypeMethodDescriptionprotected static NumberAndUnitsComposite<javax.measure.quantity.Length> createNumberAndUnitsLengthComposite(org.eclipse.swt.widgets.Composite parent) Create aNumberAndUnitsCompositefor length units, assuming model units are mmstatic voiddisplayError(String text, String message, org.slf4j.Logger logger) Log an error and display it to the user in a pop-up message boxstatic booleandisplayYesNoMessage(String text, String message) Display a pop-up message box with Yes invalid input: '&' No buttonsstatic javax.measure.Unit<javax.measure.quantity.Length> Get the initial units (i.e.static voidsaveConfig(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
-
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 valuesenergyFocusConfigPath- file into which the parameters are to be savedlogger- for logging information or error messages
-
displayError
Log an error and display it to the user in a pop-up message box- Parameters:
text- message box titlemessage- message to be logged and displayed in the body of the message boxlogger- for logging information or error messages
-
displayYesNoMessage
Display a pop-up message box with Yes invalid input: '&' No buttons- Parameters:
text- message box titlemessage- message to be logged and displayed in the body of the message box- Returns:
trueif the user clicks Yes,falseif 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 aNumberAndUnitsCompositefor length units, assuming model units are mm- Parameters:
parent- composite- Returns:
- a
NumberAndUnitsCompositeinitialised for length
-