namespace TraceCad.Vision.Calibration;

public sealed record CalibrationQuality(
    bool ControlLineDetected,
    double TargetLineLengthMm,
    double ControlLineMeasuredMm,
    double ControlLineErrorMm,
    bool CrosshairDetected,
    double CrosshairOffsetMm,
    bool MeetsTargetAccuracy)
{
    public double EstimatedAccuracyMm => Math.Abs(ControlLineErrorMm);

    public double ScaleCorrectionFactor =>
        ControlLineDetected && ControlLineMeasuredMm > 0.0
            ? TargetLineLengthMm / ControlLineMeasuredMm
            : 1.0;
}
