diff --git a/etc/qc/default/definitions.yaml b/etc/qc/default/definitions.yaml index b165601..8f637c7 100644 --- a/etc/qc/default/definitions.yaml +++ b/etc/qc/default/definitions.yaml @@ -122,6 +122,37 @@ true; } + - + name: "Synchronisation (warning)" + check: | + const currentShot = currentItem; + const gunData = currentShot._("raw_meta.smsrc"); + let result = []; + if (gunData && gunData.num_nofire == 0) { + + // These are the indices into the gun array for the different + // values of interest. + const subarray = 0; + const aimpoint = 7; + const firetime = 8; + + // We only care about the source which actually fired (or was supposed to) + const sourceFired = gunData.guns.filter(g => g[2] == gunData.src_number); + + sourceFired + .filter(gun => Math.abs(gun[firetime]-gun[aimpoint]) >= parameters.gunTimingWarning && Math.abs(gun[firetime]-gun[aimpoint]) <= parameters.gunTiming) + .forEach(gun => { + const value = Math.abs(gun[firetime]-gun[aimpoint]); + result.push(`Delta error: source ${gun[2]}, string ${gun[0]}, gun ${gun[1]}: ${parameters.gunTimingWarning} ≤ ${value.toFixed(2)} ≤ ${parameters.gunTimingWarning}`); + }); + } + if (result.length) { + result.join("; "); + } else { + // Either there were no error or gun data was missing, which we take care of elsewhere + true; + } + - name: "Autofire" check: | diff --git a/etc/qc/default/parameters.yaml b/etc/qc/default/parameters.yaml index f5ec194..78d843c 100644 --- a/etc/qc/default/parameters.yaml +++ b/etc/qc/default/parameters.yaml @@ -1,6 +1,7 @@ gunDepth: 6.0 gunDepthTolerance: 0.5 +gunTimingWarning: 1.0 gunTiming: 1.5 gunTimingSubarrayAverage: 0.5 gunPressureNominal: 2000