Beispiel #1
0
        public void AddJob(JobModule job)
        {
            if (JobModules.Count != 0)
            {
                JobModule previousJob = JobModules[JobModules.Count];
                job.CalculateRoute(previousJob.Reciever.Address); // Todo: gør noget når det er den samme adresse
                job.Route.StartTime = previousJob.EndTime;
                job.StartTime       = job.Route.EndTime;
            }
            else
            {
                job.CalculateRoute(EmployeeGroup.GroupAddress);  // TODO, GroupAddress skal implementeres i Group klassen
                job.Route.StartTime = StartTime;
                job.StartTime       = job.Route.EndTime;
            }

            JobModules.Add(job);
            // raise event
        }
Beispiel #2
0
        public void InsertJob(int index, JobModule job)
        {
            JobModules.Insert(index, job);
            JobModule previous = JobModules[index - 1];
            JobModule next     = JobModules[index + 1];

            job.CalculateRoute(previous.Reciever.Address);
            next.CalculateRoute(job.Reciever.Address);
            AdjustTime(index);

            //raise event
        }
Beispiel #3
0
        public void RemoveJob(JobModule job)
        {
            int       index    = JobModules.IndexOf(job); //TODO håndter index = 0 / = count
            JobModule previous = JobModules[index - 1];
            JobModule next     = JobModules[index + 1];

            next.CalculateRoute(previous.Reciever.Address);

            JobModules.Remove(job);

            AdjustTime(index);

            //raise event
        }