Пример #1
0
        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);
        }
Пример #2
0
        /// <exception cref="ArgumentException">
        /// <paramref name="operation"/> cannot be overridden.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="operation"/> is null.
        /// </exception>
        public override Operation Override(Operation operation)
        {
            if (operation == null)
            {
                throw new ArgumentNullException("operation");
            }

            if (operation.Modifier == OperationModifier.None ||
                operation.Modifier == OperationModifier.Sealed)
            {
                throw new ArgumentException("error_cannot_override");
            }

            if (operation.Language != Language.CSharp)
            {
                throw new ArgumentException("error_languages_do_not_equal");
            }

            Operation newOperation = (Operation)operation.Clone();

            newOperation.Parent   = this;
            newOperation.Modifier = OperationModifier.Override;
            OperationList.Add(newOperation);

            return(newOperation);
        }
Пример #3
0
        internal ITransaction Map()
        {
            IOperationList operations = new OperationList();

            foreach (var item in Operations)
            {
                var rel = new LinkRelation(item.Rel);
                operations.Add(new HttpOperation(item.Href, rel, item.Method, item.ContentType));
            }

            var type  = string.IsNullOrEmpty(Type)? TransactionType.Unknown : Type.ParseTo <TransactionType>();
            var state = string.IsNullOrEmpty(State) ? "Unknown" : State;
            var id    = new Uri(Id, UriKind.RelativeOrAbsolute);

            var problem = Problem?.Map();

            var transaction = new Transaction(id,
                                              Created,
                                              Updated,
                                              type,
                                              state,
                                              Number,
                                              Amount,
                                              VatAmount,
                                              Description,
                                              PayeeReference,
                                              IsOperational,
                                              operations,
                                              Activity)
            {
                Problem = problem
            };

            return(transaction);
        }
Пример #4
0
        public Method AddDestructor()
        {
            Destructor destructor = new Destructor(this);

            OperationList.Add(destructor);
            return(destructor);
        }
Пример #5
0
        public VerifyTransaction(VerifyTransactionDto dto)
            : base(dto.Id)
        {
            Amount                 = dto.Amount;
            VatAmount              = dto.VatAmount;
            FailedReason           = dto.FailedReason;
            FailedActivityName     = dto.FailedActivityName;
            FailedErrorCode        = dto.FailedErrorCode;
            FailedErrorDescription = dto.FailedErrorDescription;
            Activities             = dto.Activities;
            Created                = dto.Created;
            Updated                = dto.Updated;
            Activity               = dto.Activity;
            Description            = dto.Description;
            IsOperational          = dto.IsOperational;
            Number                 = dto.Number;
            PayeeReference         = dto.PayeeReference;
            State = dto.State;

            Type    = string.IsNullOrEmpty(dto.Type) ? TransactionType.Unknown : dto.Type.ParseTo <TransactionType>();
            Problem = dto.Problem?.Map();
            IOperationList operations = new OperationList();

            foreach (var item in dto.Operations)
            {
                var rel = new LinkRelation(item.Rel);
                operations.Add(new HttpOperation(item.Href, rel, item.Method, item.ContentType));
            }
            Operations = operations;
        }
Пример #6
0
        /// <exception cref="BadSyntaxException">
        /// The <paramref name="name"/> does not fit to the syntax.
        /// </exception>
        public Property AddProperty(string name)
        {
            Property property = new Property(name, this);

            property.AccessModifier = AccessModifier.Public;
            OperationList.Add(property);
            return(property);
        }
Пример #7
0
        public void AddDelete()
        {
            var operation = new HydraOperation {
                Method = HttpMethod.DELETE
            };

            OperationList.Add(operation);
        }
Пример #8
0
        public void AddEmptyPut()
        {
            var operation = new HydraOperation {
                Method = HttpMethod.PUT
            };

            OperationList.Add(operation);
        }
Пример #9
0
        public override Method AddConstructor()
        {
            Constructor constructor = new CSharpConstructor(this);

            constructor.AccessModifier = AccessModifier.Public;
            OperationList.Add(constructor);
            return(constructor);
        }
Пример #10
0
        /// <exception cref="BadSyntaxException">
        /// The <paramref name="name"/> does not fit to the syntax.
        /// </exception>
        public override Method AddMethod(string name)
        {
            Method method = new CSharpMethod(name, this);

            method.AccessModifier = AccessModifier.Public;
            OperationList.Add(method);
            return(method);
        }
Пример #11
0
        /// <exception cref="BadSyntaxException">
        /// The <paramref name="name"/> does not fit to the syntax.
        /// </exception>
        public Event AddEvent(string name)
        {
            Event newEvent = new Event(name, this);

            newEvent.AccessModifier = AccessModifier.Public;
            OperationList.Add(newEvent);
            return(newEvent);
        }
Пример #12
0
        public void AddGet()
        {
            var operation = new HydraOperation {
                Method = HttpMethod.GET
            };

            OperationList.Add(operation);
        }
Пример #13
0
 protected void AddOperation(Operation operation)
 {
     if (operation != null && !OperationList.Contains(operation))
     {
         OperationList.Add(operation);
         operation.Changed += delegate { Modified(); };
         Modified();
     }
 }
Пример #14
0
        public void AddGet(IEnumerable <SupportingProperty> properties)
        {
            var operation = new HydraOperation {
                Method = HttpMethod.GET
            };

            properties.ToList().ForEach(operation.AddPropery);

            OperationList.Add(operation);
        }
Пример #15
0
        public ForaturaCommonOperazioniViewModel(DrillBaseClass drillBaseClass, EditWorkViewModel parent)
            : base("Operation", parent)
        {
            _drillBaseClass = drillBaseClass;

            foreach (var operazione in _drillBaseClass.Operazioni)
            {
                OperationList.Add(GetViewModel(operazione, drillBaseClass, parent));
            }
        }
Пример #16
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();
     }
 }
Пример #17
0
        public IOperationList Map()
        {
            var list = new OperationList();

            foreach (var item in this)
            {
                var rel = new LinkRelation(item.Rel);
                list.Add(new HttpOperation(item.Href, rel, item.Method, item.ContentType));
            }
            return(list);
        }
Пример #18
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);
        }
Пример #19
0
        public override Method AddConstructor()
        {
            Constructor constructor = new CSharpConstructor(this);

            if (Modifier == InheritanceModifier.Abstract)
            {
                constructor.AccessModifier = AccessModifier.Protected;
            }
            else if (Modifier != InheritanceModifier.Static)
            {
                constructor.AccessModifier = AccessModifier.Public;
            }
            OperationList.Add(constructor);
            return(constructor);
        }
Пример #20
0
        /*************************************************************************/
        public IDisposable StartOperation(string operationName)
        {
            var ops = new OperationList();

            foreach (var logger in _logs)
            {
                var op = logger.Log.StartOperation(operationName);

                if (op != null)
                {
                    ops.Add(op);
                }
            }

            return(ops);
        }
Пример #21
0
        public void Sync(IMp3File file, Mask mask, ISyncRule rule)
        {
            var errorFlag = true;

            _tager.CurrentFile = file;

            foreach (var operation in rule.OperationsList)
            {
                if (operation.Call(mask, _tager, file))
                {
                    OperationList.Add(operation);
                    ModifiedFiles.Add(_tager.CurrentFile);
                    errorFlag = false;
                    break;
                }
            }

            if (errorFlag)
            {
                ErrorFiles.Add(_tager.CurrentFile.Name, "Can't sync this file");
            }
        }
Пример #22
0
        /// <exception cref="ArgumentException">
        /// The language of <paramref name="operation"/> does not equal.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="operation"/> is null.
        /// </exception>
        public Operation Implement(Operation operation)
        {
            if (operation == null)
            {
                throw new ArgumentNullException("operation");
            }

            if (operation.Language != Language)
            {
                throw new ArgumentException("error_languages_do_not_equal");
            }

            Operation newOperation = (Operation)operation.Clone();

            newOperation.Parent         = this;
            newOperation.AccessModifier = AccessModifier.Public;
            newOperation.Modifier       = OperationModifier.None;
            newOperation.IsStatic       = false;
            OperationList.Add(newOperation);

            return(newOperation);
        }