internal static IStepBuilder <TData, CalculateGlobalOffset> CalculateGlobalOffset <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : StitchWorkflowData => builder .Then <TStep, CalculateGlobalOffset, TData>("Calculate global offset") .Input(step => step.Activity, data => data.Activity) .Output(data => data.GlobalOffset, step => step.GlobalOffset);
internal static IStepBuilder <TData, CreateActivity> CreateActivity <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, CreateActivity, TData>("Create activity") .Input(step => step.SourceRegistrations, data => data.SourceRegistrations) .Output(data => data.Activity, step => step.Activity);
internal static IStepBuilder <TData, ToEquirectangular> ToEquirectangular <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : EquirectangularStitchWorkflowData => builder .Then <TStep, ToEquirectangular, TData>("Reprojecting to equirectangular") .WithRegistration() .Input(step => step.GlobalOffset, data => data.GlobalOffset);
internal static IStepBuilder <EquirectangularStitchWorkflowData, ToGeostationary> ToGeostationary <TStep>(this IStepBuilder <EquirectangularStitchWorkflowData, TStep> builder) where TStep : IStepBody => builder .Then <TStep, ToGeostationary, EquirectangularStitchWorkflowData>("Reprojecting to geostationary") .WithActivity() .Input(step => step.TargetImage, data => data.TargetImage) .Output(data => data.TargetImage, step => step.TargetImage);
internal static IStepBuilder <TData, NormaliseImage> NormaliseImage <TData, TStep>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData { return(builder .Then <TStep, NormaliseImage, TData>("Normalise image") .WithRegistration()); }
internal static IStepBuilder <TData, LogCompletion> LogCompletion <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, LogCompletion, TData>() .WithProgressBar() .Input(step => step.RenderedCount, data => data.RenderedCount) .Input(step => step.AlreadyRenderedCount, data => data.AlreadyRenderedCount);
internal static IStepBuilder <TData, RenderOverlay> RenderOverlay <TStep, TData>( this IStepBuilder <TData, TStep> builder, Expression <Func <TData, Image <Rgba32>?> >?image) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, RenderOverlay, TData>("Render overlay") .Input(step => step.SourceImage, image) .Output(data => data.OverlayImage, step => step.OverlayImage);
internal static IStepBuilder <TData, ToEquirectangular> ToEquirectangular <TStep, TData>( this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : StitchWorkflowData => builder .Then <TStep, ToEquirectangular, TData>("Reprojecting to equirectangular") .WithRegistration() .Input(step => step.SourceImage, data => data.Registration !.Image)
internal static IStepBuilder <TData, GetCropBounds> GetCropBounds <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : EquirectangularStitchWorkflowData { return(builder .Then <TStep, GetCropBounds, TData>("Get crop bounds") .Input(step => step.TargetImage, data => data.TargetImage) .Output(data => data.CropBounds, step => step.CropBounds)); }
internal static IStepBuilder <TData, ShouldWriteSingle> ShouldWriteSingle <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, ShouldWriteSingle, TData>() .WithRegistration() .WithProgressBar() .Input(step => step.AlreadyRenderedCount, data => data.AlreadyRenderedCount) .Output(data => data.AlreadyRenderedCount, step => step.AlreadyRenderedCount);
internal static IStepBuilder <TData, ShouldWrite> ShouldWrite <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : EquirectangularTimelapseWorkflowData => builder .Then <TStep, ShouldWrite, TData>() .WithActivity() .WithProgressBar() .Input(step => step.Timestamp, data => data.TargetTimestamp) .Output(data => data.AlreadyRenderedCount, step => step.AlreadyRenderedCount);
internal static IStepBuilder <TData, SaveImage> SaveImage <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, SaveImage, TData>("Save image") .WithRegistration() .Input(step => step.TargetImage, data => data.TargetImage) .Input(step => step.RenderedCount, data => data.RenderedCount) .Output(data => data.RenderedCount, step => step.RenderedCount);
internal static IStepBuilder <TData, LoadImage> LoadImage <TStep, TData>(this IStepBuilder <TData, TStep> builder, Expression <Func <TData, IProgressBar?> > progressBar) where TStep : IStepBody where TData : WorkflowData { return(builder .Then <TStep, LoadImage, TData>("Load image") .Input(step => step.ProgressBar, progressBar) .WithRegistration()); }
internal static IStepBuilder <TData, CreateActivities> CreateActivities <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : EquirectangularTimelapseWorkflowData => builder .Then <TStep, CreateActivities, TData>("Create activities") .Input(step => step.SourceRegistrations, data => data.SourceRegistrations) .Input(step => step.Timestamp, data => data.TargetTimestamp) .Input(step => step.NumTimeIntervals, data => data.TimeIntervals.Count) .Output(data => data.Activity, step => step.Activity);
internal static IStepBuilder <TData, ShouldWrite> ShouldWrite <TStep, TData>(this IStepBuilder <TData, TStep> builder, DateTime?timestamp) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, ShouldWrite, TData>() .WithActivity() .WithProgressBar() .Input(step => step.Timestamp, data => timestamp) .Output(data => data.AlreadyRenderedCount, step => step.AlreadyRenderedCount);
internal static IStepBuilder <TData, CropImage> CropImage <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : StitchWorkflowData { return(builder .Then <TStep, CropImage, TData>("Crop image") .WithActivity() .Input(step => step.TargetImage, data => data.TargetImage) .Input(step => step.CropBounds, data => data.CropBounds)); }
internal static IStepBuilder <TData, StitchImages> StitchImages <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : StitchWorkflowData { return(builder .Then <TStep, StitchImages, TData>("Stitch images") .WithRegistration() .WithActivity() .Output(data => data.TargetImage, step => step.TargetImage)); }
internal static IStepBuilder <TData, RenderUnderlay> RenderUnderlay <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : EquirectangularStitchWorkflowData { return(builder .Then <TStep, RenderUnderlay, TData>("Render underlay") .WithActivity() .Input(step => step.TargetImage, data => data.TargetImage) .Output(data => data.TargetImage, step => step.TargetImage)); }
internal static IStepBuilder <TData, ToGeostationary> ToGeostationary <TStep, TData>( this IStepBuilder <TData, TStep> builder, Expression <Func <TData, double?> > longitude) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, ToGeostationary, TData>("Reprojecting to geostationary") .WithActivity() .Input(step => step.Longitude, longitude) .Input(step => step.TargetImage, data => data.TargetImage) .Output(data => data.TargetImage, step => step.TargetImage);
internal static IStepBuilder <TData, SaveStitchedImage> SaveStitchedImage <TStep, TData>(this IStepBuilder <TData, TStep> builder, Expression <Func <TData, IProgressBar?> > progressBar) where TStep : IStepBody where TData : StitchWorkflowData { return(builder .Then <TStep, SaveStitchedImage, TData>("Save image") .WithActivity() .Input(step => step.ProgressBar, progressBar) .Input(step => step.RenderedCount, data => data.RenderedCount) .Input(step => step.TargetImage, data => data.TargetImage) .Output(data => data.RenderedCount, step => step.RenderedCount)); }
internal static IStepBuilder <TData, GetCropBounds> GetCropBounds <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : StitchWorkflowData { return(builder .Then <TStep, GetCropBounds, TData>("Get crop bounds") .Input(step => step.FullEarthCoverage, data => data.Activity !.IsFullEarthCoverage()) .Input(step => step.TargetImage, data => data.TargetImage) .Input(step => step.Activity, data => data.Activity) .Input(data => data.GlobalOffset, step => step.GlobalOffset) .Output(data => data.CropBounds, step => step.CropBounds)); }
internal static IStepBuilder <TData, ShouldWrite> ShouldWrite <TStep, TData>( this IStepBuilder <TData, TStep> builder, Expression <Func <TData, string?> >?identifier = null) where TStep : IStepBody where TData : TimelapseWorkflowData { var result = builder .Then <TStep, ShouldWrite, TData>() .WithActivity() .WithProgressBar() .Input(step => step.Timestamp, data => data.TargetTimestamp) .Output(data => data.AlreadyRenderedCount, step => step.AlreadyRenderedCount); if (identifier != null) { result.Input(step => step.Identifier, identifier); } return(result); }
public override void Build(IWorkflowBuilder <object> builder) { builder.StartWith(x => { }) .While(d => true) .Do(x => { var scheduleOptions = scheduleOptionRepository .GetByWorkflow(Id) .Where(o => o.Enabled); var entities = entityRepository .GetAll() .Where(e => e.Enabled && scheduleOptions.Any(o => o.TargetEntityId == e.Id && o.TargetEntityType == e.EntityType)); var attributes = attributeRepository .GetAll() .Where(e => e.Enabled && scheduleOptions.Any(o => o.TargetEntityId == e.Id && o.TargetEntityType == e.EntityType)); var indexes = entities .Select(e => e as IIndexModel) .Union(attributes.Select(a => a as IIndexModel)); if (indexes == null || indexes.Count() <= 0) { x.StartWith(c => { }) .Delay(d => TimeSpan.FromMinutes(10)); } IStepBuilder <object, QueueIndexChangesStep> ip = null; foreach (var i in indexes) { if (ip == null) { ip = x.StartWith <QueueIndexChangesStep>() .Input(s => s.IndexModel, d => i); } else { ip = ip.Then <QueueIndexChangesStep>() .Input(s => s.IndexModel, d => i); } } ip?.Delay(d => TimeSpan.FromSeconds(5)); }); }
internal static IStepBuilder <TData, CalculateVisibleRange> CalculateVisibleRange <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, CalculateVisibleRange, TData>("Calculate visible range") .WithActivity();
public override void Build(IWorkflowBuilder <object> builder) { builder.StartWith(x => { }) .While(d => true) .Do(x => { IEnumerable <IIndexModel> indexes = null; //if ((Mode & WorkflowMode.Test) > 0 && IndexModel != null) //{ // indexes = new List<IIndexModel> { IndexModel }; //} //else //{ // var scheduleOptions = scheduleOptionRepository // .GetByWorkflow(Id) // .Where(o => !o.IsParallel && o.Enabled); // var entities = entityRepository // .GetAll() // .Where(e => e.Enabled && scheduleOptions.Any(o => o.TargetEntityId == e.Id && o.TargetEntityType == e.EntityType)); // var attributes = attributeRepository // .GetAll() // .Where(e => e.Enabled && scheduleOptions.Any(o => o.TargetEntityId == e.Id && o.TargetEntityType == e.EntityType)); // indexes = entities // .Select(e => e as IIndexModel) // .Union(attributes.Select(a => a as IIndexModel)); //} /** * WORKFLOW is pre-built, we can only test via settings Enable/Disable in the form **/ var scheduleOptions = scheduleOptionRepository .GetByWorkflow(Id) .Where(o => !o.IsParallel && o.Enabled); var entities = entityRepository .GetAll() .Where(e => e.Enabled && scheduleOptions.Any(o => o.TargetEntityId == e.Id && o.TargetEntityType == e.EntityType)); var attributes = attributeRepository .GetAll() .Where(e => e.Enabled && scheduleOptions.Any(o => o.TargetEntityId == e.Id && o.TargetEntityType == e.EntityType)); indexes = entities .Select(e => e as IIndexModel) .Union(attributes.Select(a => a as IIndexModel)); if (indexes == null || indexes.Count() <= 0) { x.StartWith(c => { }) .Delay(d => TimeSpan.FromMinutes(10)); } else { IStepBuilder <object, UpdateIndexChangesStep> ip = null; foreach (var i in indexes) { if (ip == null) { ip = x.StartWith <UpdateIndexChangesStep>() .Input(s => s.IndexModel, d => i); } else { ip = ip.Then <UpdateIndexChangesStep>() .Input(s => s.IndexModel, d => i); } } ip.Delay(d => TimeSpan.FromSeconds(1)); } }); }
/// <summary> /// Renders an overlay on a registration image. /// </summary> internal static IStepBuilder <TData, RenderOverlay> RenderOverlay <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, RenderOverlay, TData>("Render overlay") .Input(step => step.SourceImage, data => data.Registration !.Image)
internal static IStepBuilder <GeostationaryWorkflowData, RenderUnderlay> RenderUnderlay <TStep>(this IStepBuilder <GeostationaryWorkflowData, TStep> builder) where TStep : IStepBody => builder .Then <TStep, RenderUnderlay, GeostationaryWorkflowData>("Render underlay") .WithRegistration() .Output(data => data.TargetImage, step => step.TargetImage);
internal static IStepBuilder <EquirectangularWorkflowData, RegisterImages> RegisterImages <TStep>(this IStepBuilder <EquirectangularWorkflowData, TStep> builder) where TStep : IStepBody => builder .Then <TStep, RegisterImages, EquirectangularWorkflowData>("Register images") .Input(step => step.SourceRegistrations, data => data.SourceRegistrations) .Output(data => data.Activities, step => step.Activities);
internal static IStepBuilder <TData, InitialiseSatelliteRegistry> InitialiseSatelliteRegistry <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, InitialiseSatelliteRegistry, TData>("Initialise satellite registry");
internal static IStepBuilder <TData, GetSourceFiles> GetSourceFiles <TStep, TData>(this IStepBuilder <TData, TStep> builder) where TStep : IStepBody where TData : WorkflowData => builder .Then <TStep, GetSourceFiles, TData>() .Output(data => data.SourceRegistrations, step => step.SourceRegistrations);