Beispiel #1
0
 protected void AddOperation(Operation operation)
 {
     if (operation != null && !OperationList.Contains(operation))
     {
         OperationList.Add(operation);
         operation.Changed += delegate { Modified(); };
         Modified();
     }
 }
Beispiel #2
0
 protected void AddOperation(Operation operation)
 {
     if (operation != null && !OperationList.Contains(operation))
     {
         OnBeginUndoableOperation();
         OperationList.Add(operation);
         operation.BeginUndoableOperation += delegate { OnBeginUndoableOperation(); };
         operation.Modified += delegate { Changed(); };
         Changed();
     }
 }
Beispiel #3
0
        public override ProcessorOperationCouple Select(Unitload unit)
        {
            ProcessorOperationCouple decision  = new ProcessorOperationCouple();
            Operation     selectedOperation    = null;
            Processor     selectedProcessor    = null;
            double        shortesttime         = double.PositiveInfinity;
            OperationList consideredOperations = new OperationList();

            foreach (JobRoute currentRoute in unit.Alternates)
            {
                Operation operation = currentRoute.Operations[unit.Completed.Count];
                if (consideredOperations.Contains(operation) == false)
                {
                    if (operation.Processor == null)
                    {
                        if (unit.Station.BinMagazine.CheckComponent(operation.ComponentUsages))
                        {
                            foreach (Processor processor in unit.Station.Processors)
                            {
                                if ((processor.IsAvailable == true) && (processor.Operations.Contains(operation)))
                                {
                                    if (shortesttime > operation.GetExpectedProcessTime(unit.Station))
                                    {
                                        selectedOperation = operation;
                                        selectedProcessor = processor;
                                        shortesttime      = operation.GetExpectedProcessTime(unit.Station);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    else //operation's processor not null but have a unique processor
                    {
                        if (operation.Processor.IsAvailable == true)
                        {
                            if (unit.Station.BinMagazine.CheckComponent(operation.ComponentUsages))
                            {
                                if (shortesttime > operation.GetExpectedProcessTime(unit.Station))
                                {
                                    selectedOperation = operation;
                                    selectedProcessor = operation.Processor;
                                    shortesttime      = operation.GetExpectedProcessTime(unit.Station); //fonksiyon boş, nasıl stationa bağlı process time yazılabilir?
                                }
                            }
                        }
                    }
                    consideredOperations.Add(operation);
                }
            }
            decision.Operation = selectedOperation;
            decision.Processor = selectedProcessor;
            return(decision);
        }
        protected override UnitloadList UnitloadListSelection(UnitloadList unitloads)
        {
            UnitloadList unitloadsinQueue    = new UnitloadList();
            UnitloadList consideredunitloads = new UnitloadList();

            foreach (Unitload unit in unitloads)
            {
                if (unit.IsCompleted == false)
                {
                    OperationList consideredOperations = new OperationList();
                    foreach (JobRoute currentRoute in unit.Alternates)
                    {
                        Operation operation = currentRoute.Operations[unit.Completed.Count];
                        if (consideredOperations.Contains(operation) == false && consideredunitloads.Contains(unit) == false)
                        {
                            //operation can be done in identical processors
                            if (operation.Processor == null)
                            {
                                foreach (Processor processor in unit.Station.Processors)
                                {
                                    if ((processor.IsAvailable == true) && (processor.Operations.Contains(operation)))
                                    {
                                        unitloadsinQueue.Add(unit);
                                        consideredOperations.Add(operation);
                                        consideredunitloads.Add(unit);
                                        break;
                                    }
                                }
                            }
                            else //if the processor of the operation is determined from beginning (not identical)
                            {
                                if (operation.Processor.IsAvailable == true)
                                {
                                    unitloadsinQueue.Add(unit);
                                    consideredOperations.Add(operation);
                                    consideredunitloads.Add(unit);
                                    break;
                                }
                            }
                        }
                        if (consideredunitloads.Contains(unit))
                        {
                            break;
                        }
                    }
                }
            }
            return(unitloadsinQueue);
        }
 private void DoDeleteOperationExecute()
 {
     Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
     try
     {
         if (SelectedOperation != null && OperationList != null && OperationList.Contains(SelectedOperation))
         {
             OperationList.Remove(SelectedOperation);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Exception found on DoDeleteOperationExecute :" + ex.Message);
     }
     Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow;
 }