+ * The maximum value defaults to 100, in which case the progress value is + * assumed to be a percentage. Otherwise the value will be calculated as a + * percentage of the maximum. + *
+ */ +public class Progress { + + /** + * The label for the progress bar. + */ + private String name = "Progress"; + + /** + * The maximum (target) value of the progress bar. + * + *+ * Defaults to 100 so it acts as a percentage. + *
+ */ + private float max = 100F; + + /** + * The current value. Starts at zero. + */ + private float value = 0F; + + /** + * Set the name/label for the progress bar. + * + * @param name + * The name. + */ + public void setName(String name) { + this.name = name; + } + + /** + * Set the maximum value for the progress bar. + * + * @param max + * The maximum value. + */ + public void setMax(float max) { + this.max = max; + } + + /** + * Set the value for the progress bar. + * + * @param value + * The value. + */ + public void setValue(float value) { + this.value = value; + } + + public void increment() { + this.value += 1; + } + + /** + * Get the name/label for the progress bar. + * + * @return The name. + */ + public String getName() { + return name; + } + + /** + * Get the current progress as a percentage. + * + * @return The progress percentage. + */ + public float getProgress() { + return max == 100F ? value : (value / max) * 100; + } +} diff --git a/WebApp/src/uk/ac/exeter/QuinCe/web/files/DataFilesBean.java b/WebApp/src/uk/ac/exeter/QuinCe/web/files/DataFilesBean.java index 37094e1cf..2dd5cec8e 100644 --- a/WebApp/src/uk/ac/exeter/QuinCe/web/files/DataFilesBean.java +++ b/WebApp/src/uk/ac/exeter/QuinCe/web/files/DataFilesBean.java @@ -23,7 +23,7 @@ public class DataFilesBean extends FileUploadBean { /** - * Navigation to the file upload page + * Navigation to the file list page */ public static final String NAV_FILE_LIST = "file_list"; diff --git a/WebApp/src/uk/ac/exeter/QuinCe/web/files/MissingRunType.java b/WebApp/src/uk/ac/exeter/QuinCe/web/files/MissingRunType.java new file mode 100644 index 000000000..5bb302a67 --- /dev/null +++ b/WebApp/src/uk/ac/exeter/QuinCe/web/files/MissingRunType.java @@ -0,0 +1,15 @@ +package uk.ac.exeter.QuinCe.web.files; + +import java.util.List; + +import uk.ac.exeter.QuinCe.data.Instrument.FileDefinition; +import uk.ac.exeter.QuinCe.data.Instrument.RunTypes.RunTypeAssignment; + +public record MissingRunType(FileDefinition fileDefinition, + RunTypeAssignment runType) { + protected static boolean contains(List