Ejemplo n.º 1
0
        public void readBenchReport(string path)
        {
            string temp;
            this.numInBench = 0;
            foreach (var worksheet in Workbook.Worksheets(@path)){
                int rowNum = 0;

                foreach (var row in worksheet.Rows){
                    Resource res = new Resource();
                    foreach (var cell in row.Cells){
                        if(cell != null){
                            if (cell.ColumnIndex == 9 && !String.Equals(cell.Text, "")){
                                System.Diagnostics.Debug.Write(cell.Text);
                                System.Diagnostics.Debug.WriteLine("");
                                temp = cell.Text;

                                string[] splitText = temp.Split('.');
                                if(rowNum != 0){
                                    res.firstName = splitText[0];
                                    res.lastName = splitText[splitText.Length-1];
                                    benchReportNames.Add(res);
                                }
                            }else if (cell.ColumnIndex == 14){
                                if(cell.Text.Equals("In Bench")){
                                    System.Diagnostics.Debug.WriteLine("    "+res.lastName+" "+cell.Text);
                                    res.status = "In Bench";
                                    numInBench++;
                                }else
                                    res.status = cell.Text;
                            }
                        }//end if

                    }//end foreach
                    rowNum++;
                }//end foreach
                break;
            }
        }
Ejemplo n.º 2
0
        private void OnInit(InitCommand command)
        {
            // Clear state.
            processes.Clear();
            readyQueue[0] = readyQueue[1] = readyQueue[2] = null;
            resources.Clear();
            resources["R1"] = new Resource("R1", 1);
            resources["R2"] = new Resource("R2", 2);
            resources["R3"] = new Resource("R3", 3);
            resources["R4"] = new Resource("R4", 4);
            resources["IO"] = new Resource("IO", 1);

            // Start the Init process.
            var init = new Process("Init", null, 0) {Status = ProcessStatus.Ready};
            foreach (var resource in resources.Values)
                init.HeldResources[resource.Name] = 0;
            processes.Add(init.Name, init);
            var readyQueueNode = new Node<Process>(init);
            init.ReadyNode = readyQueueNode;
            Node<Process>.AddToBack(ref readyQueue[0], readyQueueNode);
        }
Ejemplo n.º 3
0
        public void readTimeReport(string path)
        {
            string temp;
            int rowNum = 0;
            foreach (var worksheet in Workbook.Worksheets(@path)){

                foreach (var row in worksheet.Rows){
                    foreach (var cell in row.Cells){
                        if(cell != null){
                            if(cell.ColumnIndex == 2){
                                System.Diagnostics.Debug.Write(cell.Text);
                                System.Diagnostics.Debug.WriteLine("");
                                temp = cell.Text;

                                string[] splitText = temp.Split(',');

                                if(rowNum != 0){
                                    splitText[1] = splitText[1].Trim().Split(' ')[0];
                                    Resource res = new Resource();
                                    res.firstName = splitText[1].ToLower();
                                    res.lastName = splitText[0].ToLower();
                                    timeReportNames.Add(res);
                                    System.Diagnostics.Debug.WriteLine(splitText[0]+" "+splitText[1]);
                                }
                            }//end if
                        }//end if

                    }//end foreach
                    rowNum++;
                }//end foreach
                break;
            }
        }