protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(SamplesCount.Filter))); writer.WriteField(naming.Get(nameof(SamplesCount.InputSamples))); writer.WriteField(naming.Get(nameof(SamplesCount.OutputSamples))); writer.WriteField(naming.Get(nameof(SamplesCount.Runtime))); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref ValidationPoint result) { // Validation,Point,X,Y,StartTime,EndTime int validation; int point; Point2 position; DateTimeOffset startTime; DateTimeOffset endTime; if ( reader.TryGetField <int>(naming.Get(nameof(ValidationPoint.Validation)), out validation) && reader.TryGetField <int>(naming.Get(nameof(ValidationPoint.Point)), out point) && TryGetMember <Point2>(reader, serializer, naming, out position) && reader.TryGetField <DateTimeOffset>(naming.Get(nameof(ValidationPoint.StartTime)), out startTime) && reader.TryGetField <DateTimeOffset>(naming.Get(nameof(ValidationPoint.EndTime)), out endTime) ) { result = new ValidationPoint(validation, point, position, startTime, endTime); return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref EyeMovement result) { ITimestampedData timestampedData; EyeMovementType movementType; double durationMilliseconds; EyeSample averageSample; if ( TryGetMember <ITimestampedData>(reader, serializer, naming, out timestampedData) && reader.TryGetField <EyeMovementType>(naming.Get(nameof(EyeMovement.MovementType)), out movementType) && reader.TryGetField <double>(naming.Get(nameof(EyeMovement.Duration)), out durationMilliseconds) && TryGetMember <EyeSample>(reader, serializer, naming, "Average", out averageSample) ) { long durationTicks = (long)(durationMilliseconds * 1000 * 10); result = new EyeMovement ( movementType, averageSample, timestampedData.Timestamp, timestampedData.Timestamp.AddTicks(durationTicks) ); return(true); } return(false); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { serializer.WriteHeader <ITimestampedData>(writer, naming); writer.WriteField(naming.Get(nameof(EyeMovement.MovementType))); writer.WriteField(naming.Get(nameof(EyeMovement.Duration))); serializer.WriteHeader <EyeSample>(writer, naming, "Average"); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(ValidationPoint.Validation))); writer.WriteField(naming.Get(nameof(ValidationPoint.Point))); serializer.WriteHeader <Point2>(writer, naming); writer.WriteField(naming.Get(nameof(ValidationPoint.StartTime))); writer.WriteField(naming.Get(nameof(ValidationPoint.EndTime))); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(ValidationPoint.Validation))); writer.WriteField(naming.Get(nameof(ValidationPoint.Point))); serializer.WriteHeader <Point2>(writer, naming); serializer.WriteHeader <EyeValidationPointResult>(writer, naming, nameof(ValidationPointResult.LeftEye)); serializer.WriteHeader <EyeValidationPointResult>(writer, naming, nameof(ValidationPointResult.RightEye)); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { // Validation,Point,X,Y,<GazeData> writer.WriteField(naming.Get(nameof(ValidationPoint.Validation))); writer.WriteField(naming.Get(nameof(ValidationPoint.Point))); serializer.WriteHeader <Point2>(writer, naming); writer.WriteField(naming.Get("RelativeTimestamp")); serializer.WriteHeader <GazeData>(writer, naming); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref EyeSample result) { Point2 gazePoint2D; Point3 gazePoint3D; Point3 eyePosition3D; double pupilDiameter; if ( TryGetMember <Point2>(reader, serializer, naming, nameof(EyeData.GazePoint2D), out gazePoint2D) && TryGetMember <Point3>(reader, serializer, naming, nameof(EyeData.GazePoint3D), out gazePoint3D) && TryGetMember <Point3>(reader, serializer, naming, nameof(EyeData.EyePosition3D), out eyePosition3D) && reader.TryGetField <double>(naming.Get(nameof(EyeData.PupilDiameter)), out pupilDiameter) ) { result = new EyeSample ( gazePoint2D, gazePoint3D, eyePosition3D, pupilDiameter ); return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref Point2 result) { double x; double y; if ( reader.TryGetField <double>(naming.Get(nameof(Point2.X)), out x) && reader.TryGetField <double>(naming.Get(nameof(Point2.Y)), out y) ) { result = new Point2(x, y); return(true); } return(false); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { serializer.WriteHeader <Point2>(writer, naming, nameof(EyeSample.GazePoint2D)); serializer.WriteHeader <Point3>(writer, naming, nameof(EyeSample.GazePoint3D)); serializer.WriteHeader <Point3>(writer, naming, nameof(EyeSample.EyePosition3D)); writer.WriteField(naming.Get(nameof(EyeSample.PupilDiameter))); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref Selection result) { DateTimeOffset?from, to; string name; if ( reader.TryGetField <DateTimeOffset?>(naming.Get(nameof(Selection.From)), out from) && reader.TryGetField <DateTimeOffset?>(naming.Get(nameof(Selection.To)), out to) && reader.TryGetField <string>(naming.Get(nameof(Selection.Name)), out name) ) { result = new Selection(name, from, to); return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref MultipleValues result) { int id; string name; if (reader.TryGetField <int>(naming.Get(nameof(MultipleValues.Id)), out id) && reader.TryGetField <string>(naming.Get(nameof(MultipleValues.Name)), out name)) { result = new MultipleValues() { Id = id, Name = name }; return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref ITimestampedData result) { DateTimeOffset timestamp; if (reader.TryGetField <DateTimeOffset>(naming.Get(_timestampFieldName), out timestamp)) { result = new TimestampedData(timestamp); return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref CompositeStruct result) { int id; double duration; if ( reader.TryGetField <int>(naming.Get(nameof(CompositeStruct.Id)), out id) && reader.TryGetField <double>(naming.Get(nameof(CompositeStruct.Duration)), out duration) ) { result = new CompositeStruct() { Id = id, Duration = duration }; return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref EyeValidationPointResult result) { double?accuracy; double?precisionSD; double?precisionRMS; double validRatio; double?distance; double?pupilDiameter; if ( reader.TryGetField <double?>(naming.Get(nameof(EyeValidationPointResult.Accuracy)), out accuracy) && reader.TryGetField <double?>(naming.Get(nameof(EyeValidationPointResult.PrecisionSD)), out precisionSD) && reader.TryGetField <double?>(naming.Get(nameof(EyeValidationPointResult.PrecisionRMS)), out precisionRMS) && reader.TryGetField <double>(naming.Get(nameof(EyeValidationPointResult.ValidRatio)), out validRatio) && reader.TryGetField <double?>(naming.Get(nameof(EyeValidationPointResult.Distance)), out distance) && reader.TryGetField <double?>(naming.Get(nameof(EyeValidationPointResult.PupilDiameter)), out pupilDiameter) ) { result = new EyeValidationPointResult ( accuracy, precisionSD, precisionRMS, validRatio, distance, pupilDiameter ); return(true); } return(false); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(TimestampsDiff.Count))); writer.WriteField(naming.Get(nameof(TimestampsDiff.Duration))); writer.WriteField(naming.Get(nameof(TimestampsDiff.NewDuration))); writer.WriteField(naming.Get(nameof(TimestampsDiff.StartOffset))); writer.WriteField(naming.Get(nameof(TimestampsDiff.EndOffset))); writer.WriteField(naming.Get(nameof(TimestampsDiff.DurationChange))); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(EyeValidationPointResult.Accuracy))); writer.WriteField(naming.Get(nameof(EyeValidationPointResult.PrecisionSD))); writer.WriteField(naming.Get(nameof(EyeValidationPointResult.PrecisionRMS))); writer.WriteField(naming.Get(nameof(EyeValidationPointResult.ValidRatio))); writer.WriteField(naming.Get(nameof(EyeValidationPointResult.Distance))); writer.WriteField(naming.Get(nameof(EyeValidationPointResult.PupilDiameter))); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref EyeVelocity result) { double velocity; SingleEyeGazeData eye; if ( reader.TryGetField <double>(naming.Get(nameof(EyeVelocity.Velocity)), out velocity) && TryGetMember <SingleEyeGazeData>(reader, serializer, naming, out eye) ) { result = new EyeVelocity(velocity, eye); return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref EyeData result) { EyeValidity validity; EyeSample sample; if ( reader.TryGetField <EyeValidity>(naming.Get(nameof(EyeData.Validity)), out validity) && TryGetMember <EyeSample>(reader, serializer, naming, out sample) ) { result = new EyeData ( validity, sample ); return(true); } return(false); }
protected override bool TryRead(CsvReader reader, CsvSerializerContext serializer, CsvHeaderNamingContext naming, ref CompositeObject result) { SingleIntValue single; MultipleValues composite; double doubleValue; if ( TryGetMember <SingleIntValue>(reader, serializer, naming, nameof(CompositeObject.Single), out single) && TryGetMember <MultipleValues>(reader, serializer, naming, nameof(CompositeObject.Composite), out composite) && reader.TryGetField <double>(naming.Get(nameof(CompositeObject.Double)), out doubleValue) ) { result = new CompositeObject() { Single = single, Composite = composite, Double = doubleValue }; return(true); } return(false); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { serializer.WriteHeader <SingleIntValue>(writer, naming, nameof(CompositeObject.Single)); serializer.WriteHeader <MultipleValues>(writer, naming, nameof(CompositeObject.Composite)); writer.WriteField(naming.Get(nameof(CompositeObject.Double))); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(_timestampFieldName)); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(CompositeStruct.Id))); writer.WriteField(naming.Get(nameof(CompositeStruct.Duration))); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(EyeData.Validity))); serializer.WriteHeader <EyeSample>(writer, naming); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(Point3.X))); writer.WriteField(naming.Get(nameof(Point3.Y))); writer.WriteField(naming.Get(nameof(Point3.Z))); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(MultipleValues.Id))); writer.WriteField(naming.Get(nameof(MultipleValues.Name))); }
protected override void WriteHeader(CsvWriter writer, CsvSerializerContext serializer, CsvHeaderNamingContext naming) { writer.WriteField(naming.Get(nameof(EyeVelocity.Velocity))); serializer.WriteHeader <SingleEyeGazeData>(writer, naming); }