/// <inheritdoc/>
        internal override void Build(WorkspacePanel workspace, List <Speed4Dstep> speedPoints, ItemJoin incommingJoin)
        {
            if (incommingJoin.Item1 != workspace.EntryPoint)
            {
                throw new NotSupportedException("Native controll item can be run only from entry point.");
            }

            var outJoins = workspace.FindOutgoingJoins(this);

            if (outJoins.Any())
            {
                throw new NotSupportedException("Native controll item cannot have outgoing joins.");
            }

            var cutPoints = CutPoints.ToArray();
            var speeds    = SegmentSpeeds.ToArray();

            if (cutPoints.Length != speeds.Length + 1)
            {
                throw new NotSupportedException("Invalid point/speed matching.");
            }

            for (var i = 1; i < cutPoints.Length; ++i)
            {
                speedPoints.Add(cutPoints[i].With(speeds[i - 1]));
            }
        }
Exemple #2
0
 public TrainingSegment(int number, SegmentSpeeds speed, double value, SegmentValueTypes valType = SegmentValueTypes.Minutes, SegmentTypes type = SegmentTypes.Time)
 {
     SegmentNumber = number;
     Type          = type;
     Speed         = speed;
     ValueType     = valType;
     Value         = value;
 }
 private void AddSegment(SegmentSpeeds speed, string name)
 {
     Segments.Add(new BindableTrainingSegment(speed, 5, name));
     ToggleFABs();
 }