Beispiel #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();
 }
Beispiel #2
0
 public Machine()
 {
     processors = new ProcessorList();
     //System = Factories.OperatingSystemBuilder.CreateOSWithRoundRobin();
     //System.Setup(this);
     //scheduler = new IScheduler();
 }
Beispiel #3
0
        public ProcessorList GetFreeProcessors()
        {
            ProcessorList processors = new ProcessorList();

            foreach (Processor processor in this.processors)
            {
                if (processor.IsAvailable == true)
                {
                    processors.Add(processor);
                }
            }
            return(processors);
        }
Beispiel #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);
        }
Beispiel #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;
         }
     }
 }
Beispiel #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");
                }
            }
        }
 public void Clear()
 {
     ProcessorList.Clear();
 }
Beispiel #8
0
        private ProcessorList processors; //state

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