Ejemplo n.º 1
0
 public Station(string nameIn, FLOWObject parentIn, int capacityIn, RVGenerator transferTimeIn)
     : base(nameIn, parentIn, capacityIn)
 {
     this.TransferTime = transferTimeIn;
     this.operations   = new OperationList();
     this.processors   = new ProcessorList();
 }
Ejemplo n.º 2
0
 public Machine()
 {
     processors = new ProcessorList();
     //System = Factories.OperatingSystemBuilder.CreateOSWithRoundRobin();
     //System.Setup(this);
     //scheduler = new IScheduler();
 }
Ejemplo n.º 3
0
        public ProcessorList GetFreeProcessors()
        {
            ProcessorList processors = new ProcessorList();

            foreach (Processor processor in this.processors)
            {
                if (processor.IsAvailable == true)
                {
                    processors.Add(processor);
                }
            }
            return(processors);
        }
Ejemplo n.º 4
0
        public ProcessorList GetBusyWaitingProcessors()
        {
            ProcessorList processors = new ProcessorList();

            foreach (Processor processor in this.processors)
            {
                if (processor.IsBusy == true && processor.IsBlocked == false)
                {
                    Unitload unitload = (Unitload)processor.Content[0];
                    if (unitload.InTransfer == false && unitload.Operation == null)
                    {
                        processors.Add(processor);
                    }
                }
            }
            return(processors);
        }
Ejemplo n.º 5
0
 public void GetMaxAsset()
 {
     Client.GetMaxAssetsAsync();
     if (AssetsTypeList != null)
     {
         SelectedMainRow.AssetTypePerRow = AssetsTypeList.FirstOrDefault(x => x.Code == "N/A");
         if (SelectedMainRow.AssetTypePerRow != null)
         {
             SelectedMainRow.TblAssetsType = SelectedMainRow.AssetTypePerRow.Iserial;
         }
     }
     if (HardDiskList != null)
     {
         SelectedMainRow.HardDiskPerRow = HardDiskList.FirstOrDefault(x => x.Code == "N/A");
         if (SelectedMainRow.HardDiskPerRow != null)
         {
             SelectedMainRow.TblHardDisk = SelectedMainRow.HardDiskPerRow.Iserial;
         }
     }
     if (MemoryList != null)
     {
         SelectedMainRow.MemoryPerRow = MemoryList.FirstOrDefault(x => x.Code == "N/A");
         if (SelectedMainRow.MemoryPerRow != null)
         {
             SelectedMainRow.TblMemory = SelectedMainRow.MemoryPerRow.Iserial;
         }
     }
     if (ProcessorList != null)
     {
         SelectedMainRow.ProcessorPerRow = ProcessorList.FirstOrDefault(x => x.Code == "N/A");
         if (SelectedMainRow.ProcessorPerRow != null)
         {
             SelectedMainRow.TblProcessor = SelectedMainRow.ProcessorPerRow.Iserial;
         }
     }
 }
Ejemplo n.º 6
0
        public void SaveMainRow()
        {
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (isvalid)
                {
                    var save = SelectedMainRow.Iserial == 0;
                    if (save)
                    {
                        if (AllowAdd != true)
                        {
                            MessageBox.Show(strings.AllowAddMsg);
                            return;
                        }
                    }
                    else
                    {
                        if (AllowUpdate != true)
                        {
                            MessageBox.Show(strings.AllowUpdateMsg);
                            return;
                        }
                    }
                    var saveRow = new TblAsset();
                    if (AssetsTypeList != null && SelectedMainRow.TblAssetsType == null)
                    {
                        SelectedMainRow.AssetTypePerRow = AssetsTypeList.FirstOrDefault(x => x.Code == "N/A");
                        if (SelectedMainRow.AssetTypePerRow != null)
                        {
                            SelectedMainRow.TblAssetsType = SelectedMainRow.AssetTypePerRow.Iserial;
                        }
                    }
                    if (HardDiskList != null && SelectedMainRow.TblHardDisk == 0)
                    {
                        SelectedMainRow.HardDiskPerRow = HardDiskList.FirstOrDefault(x => x.Code == "N/A");
                        if (SelectedMainRow.HardDiskPerRow != null)
                        {
                            SelectedMainRow.TblHardDisk = SelectedMainRow.HardDiskPerRow.Iserial;
                        }
                    }
                    if (MemoryList != null && SelectedMainRow.TblMemory == 0)
                    {
                        SelectedMainRow.MemoryPerRow = MemoryList.FirstOrDefault(x => x.Code == "N/A");
                        if (SelectedMainRow.MemoryPerRow != null)
                        {
                            SelectedMainRow.TblMemory = SelectedMainRow.MemoryPerRow.Iserial;
                        }
                    }
                    if (ProcessorList != null && SelectedMainRow.TblProcessor == 0)
                    {
                        SelectedMainRow.ProcessorPerRow = ProcessorList.FirstOrDefault(x => x.Code == "N/A");
                        if (SelectedMainRow.ProcessorPerRow != null)
                        {
                            SelectedMainRow.TblProcessor = SelectedMainRow.ProcessorPerRow.Iserial;
                        }
                    }
                    saveRow.InjectFrom(SelectedMainRow);
                    Client.UpdateOrInsertTblAssetsAsync(saveRow, save, 0);
                }
                else
                {
                    MessageBox.Show("Data Was Not Saved");
                }
            }
        }
Ejemplo n.º 7
0
 public void Clear()
 {
     ProcessorList.Clear();
 }
Ejemplo n.º 8
0
        private ProcessorList processors; //state

        public Station()
        {
            this.operations = new OperationList();
            this.processors = new ProcessorList();
            this.CreateStatistics();
        }
Ejemplo n.º 9
0
 System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
 {
     return(ProcessorList.GetEnumerator());
 }
Ejemplo n.º 10
0
 public void Add(IProcessorNode <TResult, TSerializer> item)
 {
     ProcessorList.Add(item);
 }
Ejemplo n.º 11
0
 public IEnumerator <IProcessorNode <TResult, TSerializer> > GetEnumerator()
 {
     return(ProcessorList.GetEnumerator());
 }
Ejemplo n.º 12
0
 public bool Remove(IProcessorNode <TResult, TSerializer> item)
 {
     return(ProcessorList.Remove(item));
 }
Ejemplo n.º 13
0
 public void CopyTo(IProcessorNode <TResult, TSerializer>[] array, int arrayIndex)
 {
     ProcessorList.CopyTo(array, arrayIndex);
 }
Ejemplo n.º 14
0
 public bool Contains(IProcessorNode <TResult, TSerializer> item)
 {
     return(ProcessorList.Contains(item));
 }
Ejemplo n.º 15
0
 public void Initialize(ProcessorList processors)
 {
     this.processors = processors;
 }