Skip to content

Commit 142447a

Browse files
(#2980) Correctly reprocess dataset after coefficients change
1 parent 8aa0da0 commit 142447a

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

WebApp/src/uk/ac/exeter/QuinCe/data/Dataset/ControsPco2MeasurementLocator.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,24 @@ public List<Measurement> locateMeasurements(Connection conn,
125125
runType = Measurement.MEASUREMENT_RUN_TYPE;
126126
}
127127

128+
SensorValue rawValue = recordValues.get(rawColumn);
129+
SensorValue refValue = recordValues.get(refColumn);
130+
128131
if (flushSensors) {
129-
SensorValue rawValue = recordValues.get(rawColumn);
130-
SensorValue refValue = recordValues.get(refColumn);
131132
rawValue.setUserQC(Flag.FLUSHING, "Flushing");
132133
refValue.setUserQC(Flag.FLUSHING, "Flushing");
133134
flaggedSensorValues.add(rawValue);
134135
flaggedSensorValues.add(refValue);
135136
recordStatus = FLUSHING;
137+
} else if (rawValue.getUserQCFlag().equals(Flag.FLUSHING)) {
138+
/*
139+
* If the Response Time has been changed, some values that were
140+
* marked FLUSHING should have that flag removed.
141+
*/
142+
rawValue.removeUserQC(true);
143+
refValue.removeUserQC(true);
144+
flaggedSensorValues.add(rawValue);
145+
flaggedSensorValues.add(refValue);
136146
}
137147

138148
if (recordStatus != FLUSHING) {

WebApp/src/uk/ac/exeter/QuinCe/data/Dataset/SensorValue.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,34 @@ public void setUserQC(Flag flag, String message) throws InvalidFlagException {
367367
}
368368
}
369369

370+
/**
371+
* Remove any user QC flags, so the {@link #autoQC} becomes the basis for the
372+
* value's QC result.
373+
*
374+
* <p>
375+
* {@link Flag#LOOKUP} flags will not be replaced. {@link Flag#LOOKUP} flags
376+
* will only be replaced if {@code force} is {@code true}.
377+
* </p>
378+
*
379+
* @param force
380+
* Force override of {@link Flag#FLUSHING} flags.
381+
*/
382+
public void removeUserQC(boolean force) {
383+
384+
boolean remove = true;
385+
386+
if (userQCFlag.equals(Flag.LOOKUP)
387+
|| (!force && userQCFlag.equals(Flag.FLUSHING))) {
388+
remove = false;
389+
}
390+
391+
if (remove) {
392+
userQCFlag = autoQC.size() > 0 ? Flag.NEEDED : Flag.ASSUMED_GOOD;
393+
userQCMessage = "";
394+
dirty = true;
395+
}
396+
}
397+
370398
/**
371399
* Copy the user QC info from the specified SensorValue.
372400
*

WebApp/src/uk/ac/exeter/QuinCe/web/Instrument/CalculationCoefficientsBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import uk.ac.exeter.QuinCe.data.Instrument.Calibration.Calibration;
1212
import uk.ac.exeter.QuinCe.data.Instrument.Calibration.CalibrationDB;
1313
import uk.ac.exeter.QuinCe.jobs.Job;
14-
import uk.ac.exeter.QuinCe.jobs.files.DataReductionJob;
14+
import uk.ac.exeter.QuinCe.jobs.files.LocateMeasurementsJob;
1515

1616
@ManagedBean
1717
@SessionScoped
@@ -38,7 +38,7 @@ protected int getReprocessStatus() {
3838

3939
@Override
4040
protected Class<? extends Job> getReprocessJobClass() {
41-
return DataReductionJob.class;
41+
return LocateMeasurementsJob.class;
4242
}
4343

4444
@Override

0 commit comments

Comments
 (0)