Exemplo n.º 1
0
        private void PreviousJob_OnFinished(MyVertex vertex)
        {
            _nbPreviousJob--;

            vertex.OnFinished -= PreviousJob_OnFinished;

            Log.Debug($"{Job.Name} to finished {_nbPreviousJob}");
            if (vertex.State != NodeState.SUCCEED)
            {
                Log.Debug($"{vertex.Job.Name} is failed stop {Job.Name}");
                _previousStopped = true;
            }
            if (_nbPreviousJob == 0)
            {
                if (!_previousStopped && !Canceled)
                {
                    Launch();
                }
                else
                {
                    Log.Debug($"Stop {Job.Name} because previous are failed");
                    Finish();
                }
            }
        }
Exemplo n.º 2
0
 internal void RegisterFinished(MyVertex vertex)
 {
     Canceled = false;
     _nbPreviousJob++;
     _previousStopped = false;
     Log.Debug($"Register {_nbPreviousJob} {Job.Name}, link on {vertex.Job.Name}");
     vertex.OnFinished += PreviousJob_OnFinished;
 }
Exemplo n.º 3
0
        public IEnumerable <MyVertex> Duplicate(int nbtime)
        {
            var newjobs = new List <MyVertex>();

            Selected = false;

            for (var i = 0; i < nbtime; i++)
            {
                var newjob = Job.Clone() as INode;
                newjob.Cut(i + 1, nbtime + 1);
                var newvertex = new MyVertex(newjob);
                newjobs.Add(newvertex);
            }
            Job.Cut(0, nbtime + 1);

            return(newjobs);
        }