Skip to content

Commit

Permalink
(#2980) Correctly reprocess dataset after coefficients change
Browse files Browse the repository at this point in the history
  • Loading branch information
squaregoldfish committed Oct 21, 2024
1 parent 8aa0da0 commit 207e346
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,24 @@ public List<Measurement> locateMeasurements(Connection conn,
runType = Measurement.MEASUREMENT_RUN_TYPE;
}

SensorValue rawValue = recordValues.get(rawColumn);
SensorValue refValue = recordValues.get(refColumn);

if (flushSensors) {
SensorValue rawValue = recordValues.get(rawColumn);
SensorValue refValue = recordValues.get(refColumn);
rawValue.setUserQC(Flag.FLUSHING, "Flushing");
refValue.setUserQC(Flag.FLUSHING, "Flushing");
flaggedSensorValues.add(rawValue);
flaggedSensorValues.add(refValue);
recordStatus = FLUSHING;
} else if (rawValue.getUserQCFlag().equals(Flag.FLUSHING)) {
/*
* If the Response Time has been changed, some values that were
* marked FLUSHING should have that flag removed.
*/
rawValue.removeUserQC(true);
refValue.removeUserQC(true);
flaggedSensorValues.add(rawValue);
flaggedSensorValues.add(refValue);
}

if (recordStatus != FLUSHING) {
Expand Down
28 changes: 28 additions & 0 deletions WebApp/src/uk/ac/exeter/QuinCe/data/Dataset/SensorValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,34 @@ public void setUserQC(Flag flag, String message) throws InvalidFlagException {
}
}

/**
* Remove any user QC flags, so the {@link #autoQC} becomes the basis for the
* value's QC result.
*
* <p>
* {@link Flag#LOOKUP} flags will not be replaced. {@link Flag#LOOKUP} flags
* will only be replaced if {@code force} is {@code true}.
* </p>
*
* @param force
* Force override of {@link Flag#FLUSHING} flags.
*/
public void removeUserQC(boolean force) {

boolean remove = true;

if (userQCFlag.equals(Flag.LOOKUP)
|| (!force && userQCFlag.equals(Flag.FLUSHING))) {
remove = false;
}

if (remove) {
userQCFlag = autoQC.size() > 0 ? Flag.NEEDED : Flag.ASSUMED_GOOD;
userQCMessage = "";
dirty = true;
}
}

/**
* Copy the user QC info from the specified SensorValue.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import uk.ac.exeter.QuinCe.data.Instrument.Calibration.Calibration;
import uk.ac.exeter.QuinCe.data.Instrument.Calibration.CalibrationDB;
import uk.ac.exeter.QuinCe.jobs.Job;
import uk.ac.exeter.QuinCe.jobs.files.DataReductionJob;
import uk.ac.exeter.QuinCe.jobs.files.LocateMeasurementsJob;

@ManagedBean
@SessionScoped
Expand All @@ -38,7 +38,7 @@ protected int getReprocessStatus() {

@Override
protected Class<? extends Job> getReprocessJobClass() {
return DataReductionJob.class;
return LocateMeasurementsJob.class;
}

@Override
Expand Down

0 comments on commit 207e346

Please sign in to comment.