Exemple #1
0
        public override void AddControlToTop(ICoatingScheduleLogic newLogic)
        {
            if (newLogic.GetType() == typeof(CoatingScheduleShift))
            {
                CoatingScheduleShift newController = (CoatingScheduleShift)newLogic;

                bool foundLineMatch = false;
                for (Int32 index = 0; !foundLineMatch && index < ChildrenLogic.Count; index++)
                {
                    var shift = ChildrenLogic[index];
                    if (newController.CoatingLine == shift.CoatingLine)
                    {
                        foundLineMatch = true;
                        shift.AddControlToTop(newController);
                    }
                }
            }
            else if (ChildrenLogic.Count > 0)
            {
                var foundShift =
                    ChildrenLogic.FirstOrDefault(
                        shift => shift.CoatingLine == newLogic.CoatingLine);
                if (foundShift != null)
                {
                    foundShift.AddControlToTop(newLogic);
                }
            }
        }
Exemple #2
0
        public override void AddControlToBottom(ICoatingScheduleLogic upChild)
        {
            if (upChild.GetType() == typeof(CoatingScheduleShift))
            {
                CoatingScheduleShift newController = (CoatingScheduleShift)upChild;

                bool foundLineMatch = false;
                for (Int32 index = 0; !foundLineMatch && index < ChildrenLogic.Count; index++)
                {
                    var shift = ChildrenLogic[index];
                    if (newController.CoatingLine == shift.CoatingLine)
                    {
                        foundLineMatch = true;
                        shift.AddControlToBottom(newController);
                    }
                }
            }
            else if (ChildrenLogic.Count > 0)
            {
                var foundShift =
                    ChildrenLogic.Last(
                        shift => shift.CoatingLine == upChild.CoatingLine);
                if (foundShift != null)
                {
                    foundShift.AddControlToBottom(upChild);
                }
            }
        }
Exemple #3
0
 public override void AddLogic(ICoatingScheduleLogic newController = null)
 {
     if (newController == null)
     {
         foreach (string coatingLine in StaticFactoryValuesManager.CoatingLines)
         {
             CoatingScheduleShift newLogic = new CoatingScheduleShift();
             newLogic.CoatingLine = coatingLine;
             ChildrenLogic.Add(newLogic);
             newLogic.Connect(this);
             if (Control != null)
             {
                 Control.AddControlToBottom(newLogic);
             }
         }
     }
     else
     {
         ChildrenLogic.Add(newController);
         newController.Connect(this);
         if (Control != null)
         {
             Control.AddControlToBottom(newController);
         }
     }
 }
Exemple #4
0
        public double UnitsConsumed(ProductMasterItem item)
        {
            double consumed = 0;

            foreach (var coatingScheduleLogic in ChildrenLogic)
            {
                CoatingScheduleShift shift = coatingScheduleLogic as CoatingScheduleShift;
                consumed += shift.UnitsConsumed(item);
            }

            return(consumed);
        }
Exemple #5
0
        public List <Machine> GetMachinesOnShift()
        {
            List <Machine> machines = new List <Machine>();

            foreach (var coatingScheduleLogic in ChildrenLogic)
            {
                CoatingScheduleShift shift = coatingScheduleLogic as CoatingScheduleShift;
                if (shift != null)
                {
                    machines.AddRange(shift.GetMachinesUsed());
                }
            }

            return(machines);
        }
Exemple #6
0
 public void AddProduct(CoatingScheduleProduct next, CoatingScheduleShift coatingScheduleShift)
 {
 }