private double CalculateRelativeStartPosition(BxlPipData pip, BxlBuildMeta meta) { var pos = 0.0; var buildStart = new DateTime(meta.BuildStartTimeTicks); var buildEnd = buildStart.AddMilliseconds(meta.BuildDurationMs); var duration = buildEnd - buildStart; var pipStart = new DateTime(pip.StartTimeTicks); var pipRelativeStart = pipStart - buildStart; if (pipStart >= buildStart && pipStart.AddMilliseconds(pip.DurationMs) <= buildEnd && duration.TotalMilliseconds > 0) { pos = ((1.0 * pipRelativeStart.Ticks) / (1.0 * duration.Ticks)); } else if (pipStart >= buildStart && pipStart.AddMilliseconds(pip.DurationMs) > buildEnd && duration.TotalMilliseconds > 0) { pos = 1.0; } return(pos); }
/// <summary> /// Constructor /// </summary> public ArtifactWithBuildMeta(BxlBuildMeta meta, BxlArtifact artifact) { Meta = meta; Artifact = artifact; }