internal static LightCurveReductionContext Load(BinaryReader reader) { LightCurveReductionContext instance = new LightCurveReductionContext(); byte version = reader.ReadByte(); if (version > 0) { instance.DigitalFilter = (TangraConfig.PreProcessingFilter)reader.ReadInt32(); instance.NoiseMethod = (TangraConfig.BackgroundMethod)reader.ReadInt32(); instance.LightCurveReductionType = (LightCurveReductionType)reader.ReadInt32(); instance.ReductionMethod = (TangraConfig.PhotometryReductionMethod)reader.ReadInt32(); instance.FullDisappearance = reader.ReadBoolean(); instance.HighFlickeringOrLargeStars = reader.ReadBoolean(); instance.WindOrShaking = reader.ReadBoolean(); instance.AllFaintStars = reader.ReadBoolean(); instance.FrameIntegratingMode = (FrameIntegratingMode)reader.ReadInt32(); instance.PixelIntegrationType = (PixelIntegrationType)reader.ReadInt32(); instance.NumberFramesToIntegrate = reader.ReadInt32(); #region Default values of properties added after V1 instance.BitPix = 8; instance.MaxPixelValue = 255; instance.DisplayBitmapConverterImpl = DisplayBitmapConverter.Default; instance.HasEmbeddedTimeStamps = false; instance.UsedTracker = null; instance.PsfQuadratureMethod = TangraConfig.PsfQuadrature.NumericalInAperture; instance.LightCurveReductionSubType = ReductionSubType.Unknown; #endregion if (version > 1) { instance.IsColourVideo = reader.ReadBoolean(); instance.ColourChannel = (TangraConfig.ColourChannel)reader.ReadInt32(); int left = reader.ReadInt32(); int top = reader.ReadInt32(); int width = reader.ReadInt32(); int height = reader.ReadInt32(); instance.OSDFrame = new Rectangle(left, top, width, height); if (version > 2) { instance.UseStretching = reader.ReadBoolean(); instance.UseClipping = reader.ReadBoolean(); instance.UseBrightnessContrast = reader.ReadBoolean(); instance.FromByte = reader.ReadByte(); instance.ToByte = reader.ReadByte(); instance.Brightness = reader.ReadInt32(); instance.Contrast = reader.ReadInt32(); if (version > 3) { instance.IsDriftThrough = reader.ReadBoolean(); if (version > 4) { instance.BitPix = reader.ReadInt32(); instance.MaxPixelValue = reader.ReadUInt32(); string config = reader.ReadString(); instance.DisplayBitmapConverterImpl = DisplayBitmapConverter.ConstructConverter(instance.BitPix, instance.MaxPixelValue, config); if (version > 5) { instance.HasEmbeddedTimeStamps = reader.ReadBoolean(); if (version > 6) { instance.UsedTracker = reader.ReadString(); if (version > 7) { instance.PsfQuadratureMethod = (TangraConfig.PsfQuadrature)reader.ReadInt32(); if (version > 8) { instance.LightCurveReductionSubType = (ReductionSubType)reader.ReadInt32(); } } } } } } } } } return instance; }
internal static LightCurveReductionContext Load(BinaryReader reader) { LightCurveReductionContext instance = new LightCurveReductionContext(); byte version = reader.ReadByte(); if (version > 0) { instance.DigitalFilter = (TangraConfig.PreProcessingFilter)reader.ReadInt32(); instance.NoiseMethod = (TangraConfig.BackgroundMethod)reader.ReadInt32(); instance.LightCurveReductionType = (LightCurveReductionType)reader.ReadInt32(); instance.ReductionMethod = (TangraConfig.PhotometryReductionMethod)reader.ReadInt32(); instance.FullDisappearance = reader.ReadBoolean(); instance.HighFlickeringOrLargeStars = reader.ReadBoolean(); instance.WindOrShaking = reader.ReadBoolean(); instance.AllFaintStars = reader.ReadBoolean(); instance.FrameIntegratingMode = (FrameIntegratingMode)reader.ReadInt32(); instance.PixelIntegrationType = (PixelIntegrationType)reader.ReadInt32(); instance.NumberFramesToIntegrate = reader.ReadInt32(); #region Default values of properties added after V1 instance.BitPix = 8; instance.MaxPixelValue = 255; instance.DisplayBitmapConverterImpl = DisplayBitmapConverter.Default; instance.HasEmbeddedTimeStamps = false; instance.UsedTracker = null; instance.PsfQuadratureMethod = TangraConfig.PsfQuadrature.NumericalInAperture; instance.LightCurveReductionSubType = ReductionSubType.Unknown; #endregion if (version > 1) { instance.IsColourVideo = reader.ReadBoolean(); instance.ColourChannel = (TangraConfig.ColourChannel)reader.ReadInt32(); int left = reader.ReadInt32(); int top = reader.ReadInt32(); int width = reader.ReadInt32(); int height = reader.ReadInt32(); instance.OSDFrame = new Rectangle(left, top, width, height); if (version > 2) { instance.UseStretching = reader.ReadBoolean(); instance.UseClipping = reader.ReadBoolean(); instance.UseBrightnessContrast = reader.ReadBoolean(); instance.FromByte = reader.ReadByte(); instance.ToByte = reader.ReadByte(); instance.Brightness = reader.ReadInt32(); instance.Contrast = reader.ReadInt32(); if (version > 3) { instance.IsDriftThrough = reader.ReadBoolean(); if (version > 4) { instance.BitPix = reader.ReadInt32(); instance.MaxPixelValue = reader.ReadUInt32(); string config = reader.ReadString(); instance.DisplayBitmapConverterImpl = DisplayBitmapConverter.ConstructConverter(instance.BitPix, instance.MaxPixelValue, config); if (version > 5) { instance.HasEmbeddedTimeStamps = reader.ReadBoolean(); if (version > 6) { instance.UsedTracker = reader.ReadString(); if (version > 7) { instance.PsfQuadratureMethod = (TangraConfig.PsfQuadrature)reader.ReadInt32(); if (version > 8) { instance.LightCurveReductionSubType = (ReductionSubType)reader.ReadInt32(); } } } } } } } } } return(instance); }