コード例 #1
0
ファイル: Panel.cs プロジェクト: joja6309/InterviewScripts-
        public void SetPanelZones(IFIPerimeter perimeter)
        {
            if (((Math.Abs(perimeter.NW_corner.Item1 - Center.Item1)) < (787.402) && (Math.Abs(perimeter.NW_corner.Item2 - Center.Item2) < 787.402)))
            {
                NW_Zone = 1;
            }


            else if ((Math.Abs(perimeter.NW_corner.Item1 - Center.Item1) < 787.402) && (Math.Abs(perimeter.NW_corner.Item2 - Center.Item2) > 787.402))
            {
                NW_Zone = 2;
            }


            else if (Math.Abs(perimeter.NW_corner.Item1 - Center.Item1) < 1574.804)
            {
                NW_Zone = 3;
            }


            else if (Math.Abs(perimeter.NW_corner.Item1 - Center.Item1) < 2362.206)
            {
                NW_Zone = 4;
            }

            else
            {
                NW_Zone = 5;
            }
            if ((Math.Abs(perimeter.NE_corner.Item1 - Center.Item1) < 787.402) && (Math.Abs(perimeter.NE_corner.Item2 - Center.Item2) < 787.402))
            {
                NE_Zone = 1;
            }


            else if ((Math.Abs(perimeter.NE_corner.Item1 - Center.Item1) < 787.402) && (Math.Abs(perimeter.NE_corner.Item2 - Center.Item2) > 787.402))
            {
                NE_Zone = 2;
            }


            else if (Math.Abs(perimeter.NE_corner.Item1 - Center.Item1) < 1574.804)
            {
                NE_Zone = 3;
            }


            else if (Math.Abs(perimeter.NE_corner.Item1 - Center.Item1) < 2362.206)
            {
                NE_Zone = 4;
            }

            else
            {
                NE_Zone = 5;
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            //GetUserInputs()
            Console.WriteLine("Press Enter to Continue: ");
            DxfParser file_data = new DxfParser("file_name");

            //Console.WriteLine("Copy and Paste the input file path");
            //string IncomingFilePath = Console.ReadLine();
            //IncomingFilePath =
            file_data.ParseFile();
            file_data.ParseEntities();

            BasicDimensions BlockPerimeter = file_data.ParseBlocks();

            IFIPerimeter IFIboarder = file_data.IFIBoarder;

            List <Panel> PanelList = file_data.PanelList;

            IFIboarder.CalculateIFICenter();

            IFIboarder.SetCorners();


            foreach (Panel panel in PanelList)
            {
                panel.CalculatePanelCenter(IFIboarder.Center.Item1, IFIboarder.Center.Item2);
            }

            foreach (Panel panel in PanelList)
            {
                panel.SetPanelZones(IFIboarder);
            }

            Console.WriteLine("Input (N) radius that should be checked: ");

            string input_string = Console.ReadLine();

            int input_n = 0;

            if (string.IsNullOrEmpty(input_string))
            {
                input_n = 3;
            }
            else
            {
                input_n = Convert.ToInt32(input_string);
            }

            PanelGrid grid = new PanelGrid(BlockPerimeter, PanelList);

            IFIboarder.PrintIFIData();

            grid.PrintPanelData();
        }